- /*
- * Connect to DS server
- */
- session = ODSessionCreate(NULL, NULL, &error);
- if ( !session && error && CFErrorGetCode(error) == eServerNotRunning ) {
- /*
- * In single-user mode, attempt to load the local DS daemon.
- */
- if (is_singleuser() && load_DirectoryServicesLocal()) {
- CFTypeRef keys[] = { kODSessionLocalPath };
- CFTypeRef vals[] = { CFSTR("/var/db/dslocal") };
- CFDictionaryRef opts = CFDictionaryCreate(NULL, keys, vals, 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
- if (opts) {
- session = ODSessionCreate(NULL, opts, &error);
- CFRelease(opts);
- }
-
- if (!location) {
- location = CFRetain(CFSTR("/Local/Default"));
- }
- } else {
- show_error(error);
- return -1;
- }
- }
-
-