Branch: Tag:

2001-04-09

2001-04-09 16:53:54 by 0

Added get_netinfo_property() on Mac OS X.

Rev: lib/modules/Protocols.pmod/DNS.pmod:1.57
Rev: src/modules/system/configure.in:1.44
Rev: src/modules/system/system.c:1.100

4:   //! module Protocols   //! submodule DNS    - //! $Id: DNS.pmod,v 1.56 2001/03/14 15:45:00 grubba Exp $ + //! $Id: DNS.pmod,v 1.57 2001/04/09 16:50:59 jonasw Exp $      #pike __REAL_VERSION__   
513:    break;       if (!resolv_conf) { +  if (system->get_netinfo_property) { +  // Mac OS X / Darwin (and possibly other systems) that use +  // NetInfo may have these values in the database. +  if (nameservers = +  system->get_netinfo_property(".", +  "/locations/resolver", +  "nameserver")) { +  nameservers = sizeof(nameservers) && map(nameservers, `-, "\n"); +  } +  +  if (domains = system->get_netinfo_property(".", +  "/locations/resolver", +  "domain")) { +  domains = sizeof(domains) && map(domains, `-, "\n"); +  } +  } else {    /* FIXME: Is this a good idea?    * Why not just try the fallback?    * /grubba 1999-04-14
521:    * /grubba 2000-10-17    */    resolv_conf = "nameserver 127.0.0.1"; +  }   #if 0    throw(({ "Protocols.DNS.client(): No /etc/resolv.conf!\n",    backtrace() }));   #endif /* 0 */    }    -  +  if (resolv_conf) {    foreach(resolv_conf/"\n", string line)    {    string rest;
563:    break;    }    } +  }    if(domain)    domains = ({ domain }) + domains;   #endif