]> git.saurik.com Git - apple/configd.git/commitdiff
configd-289.2.tar.gz mac-os-x-1062 v289.2
authorApple <opensource@apple.com>
Thu, 12 Nov 2009 17:56:48 +0000 (17:56 +0000)
committerApple <opensource@apple.com>
Thu, 12 Nov 2009 17:56:48 +0000 (17:56 +0000)
14 files changed:
Plugins/ATconfig/Info.plist
Plugins/IPMonitor/Info.plist
Plugins/InterfaceNamer/Info.plist
Plugins/KernelEventMonitor/Info.plist
Plugins/Kicker/Info.plist
Plugins/LinkConfiguration/Info.plist
Plugins/Logger/Info.plist
Plugins/NetworkIdentification/Info.plist
Plugins/PreferencesMonitor/Info.plist
SCMonitor/Info.plist
SystemConfiguration.fproj/Info.plist
SystemConfiguration.fproj/SCNetworkConnection.c
SystemConfiguration.fproj/SCNetworkInterface.c
scutil.tproj/net_service.c

index b00efea444e07f99a1e9db4089a989489427cb36..0dd645a97c6d4f2f5b255dc7d12d36a1a9d10096 100644 (file)
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
-       <string>1.10</string>
+       <string>1.10.1</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
-       <string>1.10</string>
+       <string>1.10.1</string>
        <key>Builtin</key>
        <true/>
        <key>Requires</key>
        <key>Builtin</key>
        <true/>
        <key>Requires</key>
index 58acde2a0af53c1d3410c7e2fa4054998fce4da8..3af58570697d8a8879039546a07996ea465a811b 100644 (file)
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
-       <string>1.10</string>
+       <string>1.10.1</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
-       <string>1.10</string>
+       <string>1.10.1</string>
        <key>Requires</key>
        <array>
                <string>com.apple.SystemConfiguration.IPConfiguration</string>
        <key>Requires</key>
        <array>
                <string>com.apple.SystemConfiguration.IPConfiguration</string>
index 1fede74dc3a56748cc20cad77bb228e912536e33..c856a4de3f28815ad120a28197ec499d7389c9b0 100644 (file)
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
-       <string>1.10</string>
+       <string>1.10.1</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
-       <string>1.10</string>
+       <string>1.10.1</string>
 </dict>
 </plist>
 </dict>
 </plist>
index 9bc200b02f7934a72eed0cebfbfab8365a397f15..8c5c5949dffdb2fc0c395c43103c272035c8fd69 100644 (file)
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
-       <string>1.10</string>
+       <string>1.10.1</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
-       <string>1.10</string>
+       <string>1.10.1</string>
        <key>Requires</key>
        <array>
                <string>com.apple.SystemConfiguration.InterfaceNamer</string>
        <key>Requires</key>
        <array>
                <string>com.apple.SystemConfiguration.InterfaceNamer</string>
index 21cece0c83c51dcce0f03241c22d84a563710cdc..bdbd2be8e9e328e574a4e3d73eceeaa184acf703 100644 (file)
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
-       <string>1.10</string>
+       <string>1.10.1</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
-       <string>1.10</string>
+       <string>1.10.1</string>
        <key>Requires</key>
        <array>
                <string>com.apple.SystemConfiguration.ATconfig</string>
        <key>Requires</key>
        <array>
                <string>com.apple.SystemConfiguration.ATconfig</string>
index 3933e3ccaed17cdb4f764421b5be28bcf0bc3fe7..35c4f29f94d1511f39edb3b6b59d6cb857c7b10d 100644 (file)
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
-       <string>1.10</string>
+       <string>1.10.1</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
-       <string>1.10</string>
+       <string>1.10.1</string>
        <key>Requires</key>
        <array>
                <string>com.apple.SystemConfiguration.InterfaceNamer</string>
        <key>Requires</key>
        <array>
                <string>com.apple.SystemConfiguration.InterfaceNamer</string>
index 83f8d68e0f50ca27ee56a1ac94df391a402916e1..6187ec8b2d9df5fed270720ea7afe59bfcc5b2bb 100644 (file)
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
-       <string>1.10</string>
+       <string>1.10.1</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
-       <string>1.10</string>
+       <string>1.10.1</string>
        <key>Enabled</key>
        <false/>
        <key>Verbose</key>
        <key>Enabled</key>
        <false/>
        <key>Verbose</key>
index 78e6222069d439d08c7db0766104724651ad98e3..2c86bd5aa5fde68ad4134d3f8fa10f51ccae795b 100644 (file)
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
-       <string>1.10</string>
+       <string>1.10.1</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
-       <string>1.10</string>
+       <string>1.10.1</string>
        <key>Builtin</key>
        <true/>
 </dict>
        <key>Builtin</key>
        <true/>
 </dict>
index 722d01752b1c1d392783f73a069290a3a2a73758..20944c848fd1b7745c3e61b196a6014582d28df0 100644 (file)
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
-       <string>1.10</string>
+       <string>1.10.1</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
-       <string>1.10</string>
+       <string>1.10.1</string>
        <key>Builtin</key>
        <true/>
        <key>Requires</key>
        <key>Builtin</key>
        <true/>
        <key>Requires</key>
index ca396d1bd1b81cb9942935298a873d0ef82963a8..4e173babcf8363efe324a44a625c76b1defd9dc5 100644 (file)
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
        <key>CFBundlePackageType</key>
        <string>BNDL</string>
        <key>CFBundleShortVersionString</key>
-       <string>1.10</string>
+       <string>1.10.1</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
-       <string>1.10</string>
+       <string>1.10.1</string>
        <key>CFPlugInDynamicRegistration</key>
        <string>NO</string>
        <key>CFPlugInFactories</key>
        <key>CFPlugInDynamicRegistration</key>
        <string>NO</string>
        <key>CFPlugInFactories</key>
index 8714e9f28ad96b60b06e7856040848578e8ba7b9..c1ff9992d1044d7f7959b5535b0fb4e45bc1858c 100644 (file)
@@ -7,7 +7,7 @@
        <key>CFBundleExecutable</key>
        <string>SystemConfiguration</string>
        <key>CFBundleGetInfoString</key>
        <key>CFBundleExecutable</key>
        <string>SystemConfiguration</string>
        <key>CFBundleGetInfoString</key>
-       <string>1.10</string>
+       <string>1.10.1</string>
        <key>CFBundleIdentifier</key>
        <string>com.apple.SystemConfiguration</string>
        <key>CFBundleInfoDictionaryVersion</key>
        <key>CFBundleIdentifier</key>
        <string>com.apple.SystemConfiguration</string>
        <key>CFBundleInfoDictionaryVersion</key>
        <key>CFBundlePackageType</key>
        <string>FMWK</string>
        <key>CFBundleShortVersionString</key>
        <key>CFBundlePackageType</key>
        <string>FMWK</string>
        <key>CFBundleShortVersionString</key>
-       <string>1.10</string>
+       <string>1.10.1</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
-       <string>1.10</string>
+       <string>1.10.1</string>
 </dict>
 </plist>
 </dict>
 </plist>
index c0b8e2144d2fad499b1bdf4159a581fd238b7418..2ec298f0dce37124580e456868424879ffde9ba5 100644 (file)
@@ -475,8 +475,10 @@ SCNetworkConnectionCopyAvailableServices(SCNetworkSetRef set)
                SCPreferencesRef        prefs;
 
                prefs = SCPreferencesCreate(NULL, CFSTR("SCNetworkConnectionCopyAvailableServices"), NULL);
                SCPreferencesRef        prefs;
 
                prefs = SCPreferencesCreate(NULL, CFSTR("SCNetworkConnectionCopyAvailableServices"), NULL);
-               set   = SCNetworkSetCopyCurrent(prefs);
-               CFRelease(prefs);
+               if (prefs != NULL) {
+                       set = SCNetworkSetCopyCurrent(prefs);
+                       CFRelease(prefs);
+               }
                tempSet = TRUE;
        }
 
                tempSet = TRUE;
        }
 
@@ -498,6 +500,10 @@ SCNetworkConnectionCopyAvailableServices(SCNetworkSetRef set)
 
                                service       = CFArrayGetValueAtIndex(services, i);
                                interface     = SCNetworkServiceGetInterface(service);
 
                                service       = CFArrayGetValueAtIndex(services, i);
                                interface     = SCNetworkServiceGetInterface(service);
+                               if (interface == NULL) {
+                                       continue;
+                               }
+
                                interfaceType = SCNetworkInterfaceGetInterfaceType(interface);
                                if (CFEqual(interfaceType, kSCNetworkInterfaceTypePPP) ||
                                    CFEqual(interfaceType, kSCNetworkInterfaceTypeIPSec)) {
                                interfaceType = SCNetworkInterfaceGetInterfaceType(interface);
                                if (CFEqual(interfaceType, kSCNetworkInterfaceTypePPP) ||
                                    CFEqual(interfaceType, kSCNetworkInterfaceTypeIPSec)) {
index 4424aaa05e6132db43e07eb8c7be122884638004..3c687ba3033f2bf47ee74bc45cfe2e63b5c15927 100644 (file)
@@ -503,8 +503,19 @@ __SCNetworkInterfaceEqual(CFTypeRef cf1, CFTypeRef cf2)
                return FALSE; // if not the same device
        }
 
                return FALSE; // if not the same device
        }
 
-       if (!_SC_CFEqual(if1->entity_device_unique, if2->entity_device_unique)) {
-               return FALSE; // if not the same device unique identifier
+       if ((if1->entity_device_unique != NULL) && (if2->entity_device_unique != NULL)) {
+               if (!_SC_CFEqual(if1->entity_device_unique, if2->entity_device_unique)) {
+                       return FALSE; // if not the same device unique identifier
+               }
+       } else if ((if1->entity_device_unique != NULL) || (if2->entity_device_unique != NULL)) {
+               CFStringRef     name1;
+               CFStringRef     name2;
+
+               name1 = __SCNetworkInterfaceGetNonLocalizedDisplayName((SCNetworkInterfaceRef)if1);
+               name2 = __SCNetworkInterfaceGetNonLocalizedDisplayName((SCNetworkInterfaceRef)if2);
+               if ((name1 != NULL) && (name2 != NULL) && !_SC_CFEqual(name1, name2)) {
+                       return FALSE; // if same device but not the same display name
+               }
        }
 
 #if    !TARGET_OS_IPHONE
        }
 
 #if    !TARGET_OS_IPHONE
@@ -2755,9 +2766,10 @@ _SCNetworkInterfaceCreateWithEntity(CFAllocatorRef               allocator,
 {
        SCNetworkInterfacePrivateRef    interfacePrivate        = NULL;
        CFStringRef                     ifDevice;
 {
        SCNetworkInterfacePrivateRef    interfacePrivate        = NULL;
        CFStringRef                     ifDevice;
-       CFStringRef                     ifUnique;
+       CFStringRef                     ifName                  = NULL;
        CFStringRef                     ifSubType;
        CFStringRef                     ifType;
        CFStringRef                     ifSubType;
        CFStringRef                     ifType;
+       CFStringRef                     ifUnique;
        CFArrayRef                      matching_interfaces     = NULL;
 
        /* initialize runtime (and kSCNetworkInterfaceIPv4) */
        CFArrayRef                      matching_interfaces     = NULL;
 
        /* initialize runtime (and kSCNetworkInterfaceIPv4) */
@@ -2838,6 +2850,42 @@ _SCNetworkInterfaceCreateWithEntity(CFAllocatorRef               allocator,
                        // note: the "matching" dictionary will be consumed by the following
                        matching_interfaces = findMatchingInterfaces(matching, processSerialInterface);
 
                        // note: the "matching" dictionary will be consumed by the following
                        matching_interfaces = findMatchingInterfaces(matching, processSerialInterface);
 
+                       if (ifUnique == NULL) {
+                               CFIndex n;
+                               Boolean useDeviceName   = TRUE;
+
+                               n = (matching_interfaces != NULL) ? CFArrayGetCount(matching_interfaces) : 0;
+                               if (n > 0) {
+                                       CFIndex i;
+
+                                       for (i = 0; i < n; i++) {
+                                               SCNetworkInterfacePrivateRef    scanPrivate;
+
+                                               scanPrivate = (SCNetworkInterfacePrivateRef)CFArrayGetValueAtIndex(matching_interfaces, i);
+                                               if (scanPrivate->entity_device_unique != NULL) {
+                                                       useDeviceName = FALSE;
+                                                       break;
+                                               }
+                                       }
+                               }
+
+                               if (useDeviceName) {
+                                       if (matching_interfaces != NULL) {
+                                               CFRelease(matching_interfaces);
+                                       }
+
+                                       match_keys[1] = CFSTR(kIOTTYDeviceKey);
+                                       matching = CFDictionaryCreate(NULL,
+                                                                     (const void **)match_keys,
+                                                                     (const void **)match_vals,
+                                                                     sizeof(match_keys)/sizeof(match_keys[0]),
+                                                                     &kCFTypeDictionaryKeyCallBacks,
+                                                                     &kCFTypeDictionaryValueCallBacks);
+
+                                       // note: the "matching" dictionary will be consumed by the following
+                                       matching_interfaces = findMatchingInterfaces(matching, processSerialInterface);
+                               }
+                       }
                } else if (CFEqual(ifSubType, kSCValNetInterfaceSubTypeL2TP)) {
                        interfacePrivate = (SCNetworkInterfacePrivateRef)SCNetworkInterfaceCreateWithInterface(kSCNetworkInterfaceIPv4,
                                                                                                               kSCNetworkInterfaceTypeL2TP);
                } else if (CFEqual(ifSubType, kSCValNetInterfaceSubTypeL2TP)) {
                        interfacePrivate = (SCNetworkInterfacePrivateRef)SCNetworkInterfaceCreateWithInterface(kSCNetworkInterfaceIPv4,
                                                                                                               kSCNetworkInterfaceTypeL2TP);
@@ -2903,18 +2951,49 @@ _SCNetworkInterfaceCreateWithEntity(CFAllocatorRef              allocator,
                                if (ifUnique != NULL) {
                                        CFIndex i;
 
                                if (ifUnique != NULL) {
                                        CFIndex i;
 
+                                       // we are looking for an interface with a unique ID
+                                       // so let's try to focus our choices
                                        for (i = 0; i < n; i++) {
                                        for (i = 0; i < n; i++) {
-                                               SCNetworkInterfacePrivateRef    scan;
+                                               SCNetworkInterfacePrivateRef    scanPrivate;
 
 
-                                               scan = (SCNetworkInterfacePrivateRef)CFArrayGetValueAtIndex(matching_interfaces, i);
-                                               if (_SC_CFEqual(ifUnique, scan->entity_device_unique)) {
+                                               scanPrivate = (SCNetworkInterfacePrivateRef)CFArrayGetValueAtIndex(matching_interfaces, i);
+                                               if (_SC_CFEqual(ifUnique, scanPrivate->entity_device_unique)) {
                                                        if (interfacePrivate != NULL) {
                                                                // if we've matched more than one interface
                                                                interfacePrivate = NULL;
                                                                break;
                                                        }
                                                        if (interfacePrivate != NULL) {
                                                                // if we've matched more than one interface
                                                                interfacePrivate = NULL;
                                                                break;
                                                        }
-                                                       interfacePrivate = scan;
+                                                       interfacePrivate = scanPrivate;
+                                               }
+                                       }
+                               } else if (CFDictionaryGetValueIfPresent(interface_entity,
+                                                                       kSCPropUserDefinedName,
+                                                                       (const void **)&ifName)) {
+                                       CFIndex i;
+
+                                       // we don't have a unique ID but do have an interface
+                                       // name.  If the matching interfaces do have IDs than
+                                       // we can try to focus our choices using the name
+                                       for (i = 0; i < n; i++) {
+                                               SCNetworkInterfacePrivateRef    scanPrivate;
+
+                                               scanPrivate = (SCNetworkInterfacePrivateRef)CFArrayGetValueAtIndex(matching_interfaces, i);
+                                               if (scanPrivate->entity_device_unique != NULL) {
+                                                       SCNetworkInterfaceRef   scan    = (SCNetworkInterfaceRef)scanPrivate;
+                                                       CFStringRef             scanName;
+
+                                                       scanName = __SCNetworkInterfaceGetNonLocalizedDisplayName(scan);
+                                                       if ((scanName != NULL) && !_SC_CFEqual(ifName, scanName)) {
+                                                               continue; // if not the same display name
+                                                       }
+                                               }
+
+                                               if (interfacePrivate != NULL) {
+                                                       // if we've matched more than one interface
+                                                       interfacePrivate = NULL;
+                                                       break;
                                                }
                                                }
+                                               interfacePrivate = scanPrivate;
                                        }
                                }
                                if (interfacePrivate == NULL) {
                                        }
                                }
                                if (interfacePrivate == NULL) {
index 507ccff1f7f333210092cdc924e4d6e335725ba5..4b096a906fa84955be6c1e31321b874115413f43 100644 (file)
@@ -346,7 +346,9 @@ create_service(int argc, char **argv)
 
        if (net_interface != NULL) CFRelease(net_interface);
        net_interface = SCNetworkServiceGetInterface(net_service);
 
        if (net_interface != NULL) CFRelease(net_interface);
        net_interface = SCNetworkServiceGetInterface(net_service);
-       CFRetain(net_interface);
+       if (net_interface != NULL) {
+               CFRetain(net_interface);
+       }
 
        interfaceName = SCNetworkInterfaceGetLocalizedDisplayName(interface);
        if (interfaceName == NULL) {
 
        interfaceName = SCNetworkInterfaceGetLocalizedDisplayName(interface);
        if (interfaceName == NULL) {