X-Git-Url: https://git.saurik.com/apple/configd.git/blobdiff_plain/dbf6a266c384fc8b55e00a396eebe5cb62e21547..af243a0d9bf37c3818926f82705eec9b22b50a4d:/dnsinfo/dnsinfo_private.c diff --git a/dnsinfo/dnsinfo_private.c b/dnsinfo/dnsinfo_private.c index 6ada24f..f7b256f 100644 --- a/dnsinfo/dnsinfo_private.c +++ b/dnsinfo/dnsinfo_private.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2004, 2005, 2007, 2009 Apple Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * @@ -28,10 +28,12 @@ * - initial revision */ +#include #include #include #include #include +#include #include "dnsinfo_private.h" #include "shared_dns_info_types.h" @@ -41,7 +43,7 @@ __private_extern__ const char * _dns_configuration_notify_key() { - return "com.apple.SystemConfiguration.dns_configuration"; + return "com.apple.system.SystemConfiguration.dns_configuration"; } @@ -58,16 +60,30 @@ _dns_configuration_server_port() server_name = DNS_SERVER; } +#ifdef BOOTSTRAP_PRIVILEGED_SERVER + status = bootstrap_look_up2(bootstrap_port, + server_name, + &server, + 0, + BOOTSTRAP_PRIVILEGED_SERVER); +#else // BOOTSTRAP_PRIVILEGED_SERVER status = bootstrap_look_up(bootstrap_port, server_name, &server); +#endif // BOOTSTRAP_PRIVILEGED_SERVER + switch (status) { case BOOTSTRAP_SUCCESS : /* service currently registered, "a good thing" (tm) */ break; + case BOOTSTRAP_NOT_PRIVILEGED : + /* the service is not privileged */ + return MACH_PORT_NULL; case BOOTSTRAP_UNKNOWN_SERVICE : /* service not currently registered, try again later */ return MACH_PORT_NULL; default : - mach_error("could not lookup DNS configuration info service:", status); + fprintf(stderr, + "could not lookup DNS configuration info service: %s\n", + bootstrap_strerror(status)); return MACH_PORT_NULL; }