/*
- * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2004, 2005, 2007, 2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* - initial revision
*/
+#include <stdio.h>
#include <stdlib.h>
#include <mach/mach.h>
#include <mach/mach_error.h>
#include <servers/bootstrap.h>
+#include <bootstrap_priv.h>
#include "dnsinfo_private.h"
#include "shared_dns_info_types.h"
const char *
_dns_configuration_notify_key()
{
- return "com.apple.SystemConfiguration.dns_configuration";
+ return "com.apple.system.SystemConfiguration.dns_configuration";
}
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;
}