diff --git a/Debug.xcodeproj/project.pbxproj b/Debug.xcodeproj/project.pbxproj index 4f52880..bee13b7 100644 --- a/Debug.xcodeproj/project.pbxproj +++ b/Debug.xcodeproj/project.pbxproj @@ -9,72 +9,37 @@ /* Begin PBXBuildFile section */ 766FFC0010A4F57400B541E1 /* debug.perl in Resources */ = {isa = PBXBuildFile; fileRef = 766FFBFF10A4F57400B541E1 /* debug.perl */; }; 766FFC0810A51ADD00B541E1 /* com.twocanoes.debug.plist in Resources */ = {isa = PBXBuildFile; fileRef = 766FFC0710A51ADD00B541E1 /* com.twocanoes.debug.plist */; }; - 766FFC5110A53FC600B541E1 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 766FFC5010A53FC600B541E1 /* Security.framework */; }; 768334DF10A780C8006EC9C6 /* DebugPref.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 768334DE10A780C8006EC9C6 /* DebugPref.tiff */; }; 768334E110A780D2006EC9C6 /* bug.icns in Resources */ = {isa = PBXBuildFile; fileRef = 768334E010A780D2006EC9C6 /* bug.icns */; }; - 8D202CEA0486D31800D8A456 /* Debug_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = 32DBCFA20370C41700C91783 /* Debug_Prefix.pch */; }; 8D202CEB0486D31800D8A456 /* DebugPref.h in Headers */ = {isa = PBXBuildFile; fileRef = F506C03C013D9D7901CA16C8 /* DebugPref.h */; }; - 8D202CED0486D31800D8A456 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C167DFE841241C02AAC07 /* InfoPlist.strings */; }; 8D202CEF0486D31800D8A456 /* DebugPref.xib in Resources */ = {isa = PBXBuildFile; fileRef = F506C042013D9D8C01CA16C8 /* DebugPref.xib */; }; 8D202CF10486D31800D8A456 /* DebugPref.m in Sources */ = {isa = PBXBuildFile; fileRef = F506C03D013D9D7901CA16C8 /* DebugPref.m */; }; - 8D202CF30486D31800D8A456 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; }; - 8D202CF40486D31800D8A456 /* PreferencePanes.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F506C035013D953901CA16C8 /* PreferencePanes.framework */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 089C1672FE841209C02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; - 089C167EFE841241C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; - 089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; - 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; - 32DBCFA20370C41700C91783 /* Debug_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Debug_Prefix.pch; sourceTree = ""; }; 766FFBFF10A4F57400B541E1 /* debug.perl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = debug.perl; sourceTree = ""; }; 766FFC0710A51ADD00B541E1 /* com.twocanoes.debug.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = com.twocanoes.debug.plist; sourceTree = ""; }; - 766FFC5010A53FC600B541E1 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = ""; }; 768334DE10A780C8006EC9C6 /* DebugPref.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = DebugPref.tiff; sourceTree = ""; }; 768334E010A780D2006EC9C6 /* bug.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = bug.icns; sourceTree = ""; }; 8D202CF70486D31800D8A456 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; 8D202CF80486D31800D8A456 /* Debug.prefPane */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Debug.prefPane; sourceTree = BUILT_PRODUCTS_DIR; }; - F506C035013D953901CA16C8 /* PreferencePanes.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PreferencePanes.framework; path = /System/Library/Frameworks/PreferencePanes.framework; sourceTree = ""; }; F506C03C013D9D7901CA16C8 /* DebugPref.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebugPref.h; sourceTree = ""; }; F506C03D013D9D7901CA16C8 /* DebugPref.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DebugPref.m; sourceTree = ""; }; F506C043013D9D8C01CA16C8 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/DebugPref.xib; sourceTree = ""; }; /* End PBXFileReference section */ -/* Begin PBXFrameworksBuildPhase section */ - 8D202CF20486D31800D8A456 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 8D202CF30486D31800D8A456 /* Cocoa.framework in Frameworks */, - 8D202CF40486D31800D8A456 /* PreferencePanes.framework in Frameworks */, - 766FFC5110A53FC600B541E1 /* Security.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - /* Begin PBXGroup section */ 089C166AFE841209C02AAC07 /* Debug */ = { isa = PBXGroup; children = ( - 08FB77AFFE84173DC02AAC07 /* Classes */, - 32DBCFA10370C40200C91783 /* Other Sources */, + F506C03C013D9D7901CA16C8 /* DebugPref.h */, + F506C03D013D9D7901CA16C8 /* DebugPref.m */, 089C167CFE841241C02AAC07 /* Resources */, - 089C1671FE841209C02AAC07 /* Frameworks and Libraries */, 19C28FB8FE9D52D311CA2CBB /* Products */, ); name = Debug; sourceTree = ""; }; - 089C1671FE841209C02AAC07 /* Frameworks and Libraries */ = { - isa = PBXGroup; - children = ( - 1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */, - 1058C7AEFEA557BF11CA2CBB /* Other Frameworks */, - ); - name = "Frameworks and Libraries"; - sourceTree = ""; - }; 089C167CFE841241C02AAC07 /* Resources */ = { isa = PBXGroup; children = ( @@ -83,40 +48,11 @@ 766FFC0710A51ADD00B541E1 /* com.twocanoes.debug.plist */, 766FFBFF10A4F57400B541E1 /* debug.perl */, 8D202CF70486D31800D8A456 /* Info.plist */, - 089C167DFE841241C02AAC07 /* InfoPlist.strings */, F506C042013D9D8C01CA16C8 /* DebugPref.xib */, ); name = Resources; sourceTree = ""; }; - 08FB77AFFE84173DC02AAC07 /* Classes */ = { - isa = PBXGroup; - children = ( - F506C03C013D9D7901CA16C8 /* DebugPref.h */, - F506C03D013D9D7901CA16C8 /* DebugPref.m */, - ); - name = Classes; - sourceTree = ""; - }; - 1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */ = { - isa = PBXGroup; - children = ( - 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */, - F506C035013D953901CA16C8 /* PreferencePanes.framework */, - 766FFC5010A53FC600B541E1 /* Security.framework */, - ); - name = "Linked Frameworks"; - sourceTree = ""; - }; - 1058C7AEFEA557BF11CA2CBB /* Other Frameworks */ = { - isa = PBXGroup; - children = ( - 089C1672FE841209C02AAC07 /* Foundation.framework */, - 089C167FFE841241C02AAC07 /* AppKit.framework */, - ); - name = "Other Frameworks"; - sourceTree = ""; - }; 19C28FB8FE9D52D311CA2CBB /* Products */ = { isa = PBXGroup; children = ( @@ -125,14 +61,6 @@ name = Products; sourceTree = ""; }; - 32DBCFA10370C40200C91783 /* Other Sources */ = { - isa = PBXGroup; - children = ( - 32DBCFA20370C41700C91783 /* Debug_Prefix.pch */, - ); - name = "Other Sources"; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -140,7 +68,6 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 8D202CEA0486D31800D8A456 /* Debug_Prefix.pch in Headers */, 8D202CEB0486D31800D8A456 /* DebugPref.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -155,8 +82,6 @@ 8D202CE90486D31800D8A456 /* Headers */, 8D202CEC0486D31800D8A456 /* Resources */, 8D202CF00486D31800D8A456 /* Sources */, - 8D202CF20486D31800D8A456 /* Frameworks */, - 8D202CF50486D31800D8A456 /* Rez */, ); buildRules = ( ); @@ -173,6 +98,8 @@ /* Begin PBXProject section */ 089C1669FE841209C02AAC07 /* Project object */ = { isa = PBXProject; + attributes = { + }; buildConfigurationList = 1DBD214C08BA80EA00186707 /* Build configuration list for PBXProject "Debug" */; compatibilityVersion = "Xcode 3.1"; developmentRegion = English; @@ -194,7 +121,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 8D202CED0486D31800D8A456 /* InfoPlist.strings in Resources */, 8D202CEF0486D31800D8A456 /* DebugPref.xib in Resources */, 766FFC0010A4F57400B541E1 /* debug.perl in Resources */, 766FFC0810A51ADD00B541E1 /* com.twocanoes.debug.plist in Resources */, @@ -205,16 +131,6 @@ }; /* End PBXResourcesBuildPhase section */ -/* Begin PBXRezBuildPhase section */ - 8D202CF50486D31800D8A456 /* Rez */ = { - isa = PBXRezBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXRezBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ 8D202CF00486D31800D8A456 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -227,14 +143,6 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ - 089C167DFE841241C02AAC07 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 089C167EFE841241C02AAC07 /* English */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; F506C042013D9D8C01CA16C8 /* DebugPref.xib */ = { isa = PBXVariantGroup; children = ( @@ -249,16 +157,29 @@ 1DBD214908BA80EA00186707 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + CLANG_ENABLE_OBJC_ARC = YES; COPY_PHASE_STRIP = NO; + DEPLOYMENT_LOCATION = YES; + DEPLOYMENT_POSTPROCESSING = YES; + DSTROOT = "$(HOME)"; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; GCC_MODEL_TUNING = G5; GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = Debug_Prefix.pch; + GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Library/PreferencePanes"; + INSTALL_PATH = /Library/PreferencePanes; + OTHER_LDFLAGS = ( + "-framework", + AppKit, + "-framework", + Cocoa, + "-framework", + Security, + "-framework", + PreferencePanes, + ); PRODUCT_NAME = Debug; SDKROOT = macosx; WRAPPER_EXTENSION = prefPane; @@ -269,13 +190,26 @@ 1DBD214A08BA80EA00186707 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + CLANG_ENABLE_OBJC_ARC = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEPLOYMENT_LOCATION = YES; + DEPLOYMENT_POSTPROCESSING = YES; + DSTROOT = "$(HOME)"; GCC_MODEL_TUNING = G5; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = Debug_Prefix.pch; + GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Library/PreferencePanes"; + INSTALL_PATH = /Library/PreferencePanes; + OTHER_LDFLAGS = ( + "-framework", + AppKit, + "-framework", + Cocoa, + "-framework", + Security, + "-framework", + PreferencePanes, + ); PRODUCT_NAME = Debug; SDKROOT = macosx; WRAPPER_EXTENSION = prefPane; @@ -287,7 +221,6 @@ buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_ENABLE_OBJC_GC = supported; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; ONLY_ACTIVE_ARCH = YES; @@ -302,7 +235,6 @@ buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_ENABLE_OBJC_GC = supported; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; PREBINDING = NO; diff --git a/DebugPref.h b/DebugPref.h index 4cd7380..43407f8 100644 --- a/DebugPref.h +++ b/DebugPref.h @@ -1,30 +1,25 @@ -// -// DebugPref.h -// Debug -// -// Created by Timothy Perfitt on 11/6/09. -// Copyright (c) 2013 twocanoes. All rights reserved. -// +/* DebugPref.h * Debug + Created by Timothy Perfitt on 11/6/09. Cpyright (c) 2013 twocanoes. All rights reserved. */ + +#import #import #import #include -@interface DebugPref : NSPreferencePane -{ - AuthorizationRef authorization; - IBOutlet SFAuthorizationView *lockView; - BOOL isEnabled,isDSDebugging,isLoggingDNS,isDoingNetworkTrace,isTracingDNS, - isTracingKerberos,isTracingLDAP,isSyslogDebug,hasUnappledChanges; -} -@property BOOL isEnabled,isDSDebugging,isLoggingDNS,isDoingNetworkTrace,isTracingDNS,isTracingKerberos, - isTracingLDAP,isSyslogDebug,hasUnappledChanges; --(IBAction)apply:(id)sender; -- (void) mainViewDidLoad; +@interface DebugPref : NSPreferencePane + +@property IBOutlet SFAuthorizationView * lockView; +@property AuthorizationRef authorization; + +@property BOOL hasUnappledChanges, isTracingKerberos, isDoingNetworkTrace, isDSDebugging, + isTracingLDAP, isEnabled, isLoggingDNS, isTracingDNS, isSyslogDebug; --(void)save; --(IBAction)optionChanged:(id)sender; --(void)setDefaults; --(IBAction)revert:(id)sender; --(IBAction)compressAndSendToDesktop:(id)sender; +- (IBAction) apply:(id)x; +- (IBAction) optionChanged:(id)x; +- (IBAction) revert:(id)x; +- (IBAction) compressAndSendToDesktop:(id)x; +- (void) mainViewDidLoad; +- (void) save; +- (void) setDefaults; @end diff --git a/DebugPref.m b/DebugPref.m index 346309f..1cbe31b 100644 --- a/DebugPref.m +++ b/DebugPref.m @@ -1,180 +1,117 @@ -// -// DebugPref.m -// Debug -// -// Created by Timothy Perfitt on 11/6/09. -// Copyright (c) 2013 twocanoes. All rights reserved. -// + +/* DebugPref.m * Debug + Created by Timothy Perfitt on 11/6/09. Cpyright (c) 2013 twocanoes. All rights reserved. */ #import "DebugPref.h" +#define fm [NSFileManager defaultManager] @implementation DebugPref -@synthesize isEnabled,isDSDebugging,isLoggingDNS,isDoingNetworkTrace,isTracingDNS, - isTracingKerberos,isTracingLDAP,isSyslogDebug,hasUnappledChanges; - - --(IBAction)compressAndSendToDesktop:(id)sender{ - - NSTask *task=[[NSTask alloc] init]; - [task setLaunchPath:@"/usr/bin/zip"]; - NSString *desktopFile=@"~/Desktop/debug.zip"; - [task setArguments:[NSArray arrayWithObjects:@"-r",[desktopFile stringByExpandingTildeInPath], - @"/Library/Logs",@"/var/log",nil]]; - - [task launch]; - [task waitUntilExit]; -} --(NSString *)interface{ - - return [[NSUserDefaults standardUserDefaults] valueForKey:@"interface"]; + +@synthesize hasUnappledChanges, isTracingKerberos, isDoingNetworkTrace, isDSDebugging, + isTracingLDAP, isEnabled, isLoggingDNS, isTracingDNS, isSyslogDebug; + +- (IBAction) compressAndSendToDesktop:(id)sender { NSTask *task = NSTask.new; + + [task setLaunchPath:@"/usr/bin/zip"]; + [task setArguments:@[@"-r",@"~/Desktop/debug.zip".stringByExpandingTildeInPath, @"/Library/Logs",@"/var/log"]]; + [task launch]; + [task waitUntilExit]; } --(void)setDefaults{ - NSFileManager *fm=[NSFileManager defaultManager]; - // [self setInterface:@"en0"]; - [self setHasUnappledChanges:NO]; - - if ([fm fileExistsAtPath:@"/Library/LaunchDaemons/com.twocanoes.debug.plist"]) [self setIsEnabled:YES]; - else [self setIsEnabled:NO]; - - - if ([fm fileExistsAtPath:@"/Library/Preferences/DirectoryService/.DSLogDebugAtStart"]) [self setIsDSDebugging:YES]; - else [self setIsDSDebugging:NO]; - - if ([fm fileExistsAtPath:@"/tmp/.dnsdebugging"]) [self setIsLoggingDNS:YES]; - else [self setIsLoggingDNS:NO]; - - if ([fm fileExistsAtPath:@"/tmp/.syslogverbose"]) [self setIsSyslogDebug:YES]; - else [self setIsSyslogDebug:NO]; - - if ([fm fileExistsAtPath:@"/tmp/.tcpdumprunning"]) [self setIsDoingNetworkTrace:YES]; - else [self setIsDoingNetworkTrace:NO]; - - if ([fm fileExistsAtPath:@"/tmp/.tracedns"]) [self setIsTracingDNS:YES]; - else [self setIsTracingDNS:NO]; - - if ([fm fileExistsAtPath:@"/tmp/.tracekerberos"]) [self setIsTracingKerberos:YES]; - else [self setIsTracingKerberos:NO]; - - - if ([fm fileExistsAtPath:@"/tmp/.traceldap"]) [self setIsTracingLDAP:YES]; - else [self setIsTracingLDAP:NO]; - - + +- (NSString*) interface{ return [NSUserDefaults.standardUserDefaults valueForKey:@"interface"]; } + +- (void) setDefaults { // [self setInterface:@"en0"]; + + [self setHasUnappledChanges:NO]; + [self setIsEnabled: [fm fileExistsAtPath:@"/Library/LaunchDaemons/com.twocanoes.debug.plist"]]; + [self setIsDSDebugging: [fm fileExistsAtPath:@"/Library/Preferences/DirectoryService/.DSLogDebugAtStart"]]; + [self setIsLoggingDNS: [fm fileExistsAtPath:@"/tmp/.dnsdebugging"]]; + [self setIsSyslogDebug: [fm fileExistsAtPath:@"/tmp/.syslogverbose"]]; + [self setIsDoingNetworkTrace: [fm fileExistsAtPath:@"/tmp/.tcpdumprunning"]]; + [self setIsTracingDNS: [fm fileExistsAtPath:@"/tmp/.tracedns"]]; + [self setIsTracingKerberos: [fm fileExistsAtPath:@"/tmp/.tracekerberos"]]; + [self setIsTracingLDAP: [fm fileExistsAtPath:@"/tmp/.traceldap"]]; } -- (void) mainViewDidLoad -{ - - [lockView setDelegate:self]; - [lockView setString:"system.privilege.admin"]; - [lockView setAutoupdate:YES]; - [lockView updateStatus:self]; - authorization=nil; - - [self setDefaults]; - - + +- (void) mainViewDidLoad { + + [_lockView setDelegate:self]; + [_lockView setString:"system.privilege.admin"]; + [_lockView setAutoupdate:YES]; + [_lockView updateStatus:self]; + _authorization = nil; + [self setDefaults]; } --(IBAction)apply:(id)sender{ - [self save]; - } --(void)save{ - - - NSFileManager *fm=[NSFileManager defaultManager]; - authorization=[[lockView authorization] authorizationRef]; - NSString *scriptPath; - NSBundle *thisBundle = [NSBundle bundleForClass:[self class]]; - scriptPath = [thisBundle pathForResource:@"debug" ofType:@"perl"]; - - - const char *pathToTool=[scriptPath UTF8String]; - AuthorizationFlags flags = kAuthorizationFlagDefaults | - kAuthorizationFlagInteractionAllowed | - kAuthorizationFlagPreAuthorize | - kAuthorizationFlagExtendRights; - - - int curArg=2; - char **arguments = calloc(10 , sizeof(char *)); - - if ([self isEnabled]==YES) { - - if ([self isDSDebugging]==YES) { - NSLog(@"adding ds at %i",curArg); - arguments[curArg++]="-ds"; - } - if ([self isDoingNetworkTrace]==YES) { - NSMutableArray *ports=[NSMutableArray arrayWithCapacity:4]; - arguments[curArg++]="-tcpdump"; - arguments[curArg++]=(char *)[[self interface] UTF8String]; - [fm createFileAtPath:@"/tmp/.tracedns" contents:nil attributes:nil]; - [ports addObject:@"port 53"]; - [ports addObject:@"port 5353"]; - [ports addObject:@"port 464"]; - [ports addObject:@"port 88"]; - [ports addObject:@"port 389"]; - [ports addObject:@"port 636"]; - - - if ([ports count]>0) { - arguments[curArg++]="-ports"; - NSString *optionsObject=[ports componentsJoinedByString:@" or "]; - char *options=calloc([optionsObject length]+1, sizeof (char)); - strncpy(options,(char *)[optionsObject UTF8String],sizeof(char)*([optionsObject length]+1)); - arguments[curArg++]=options; - } - - } - if ([self isLoggingDNS]==YES) { - arguments[curArg++]="-dns"; - } - if ([self isSyslogDebug]==YES) { - arguments[curArg++]="-syslog"; - } - } +- (IBAction) apply:(id)sender{ [self save]; } +- (void) save { + + _authorization = _lockView.authorization.authorizationRef; - - if (curArg==2) { - arguments[curArg++]="-disable"; + NSString * scriptPath = [[NSBundle bundleForClass:self.class] pathForResource:@"debug" ofType:@"perl"]; + const char * pathToTool = scriptPath.UTF8String; + AuthorizationFlags flags = kAuthorizationFlagDefaults | kAuthorizationFlagInteractionAllowed | + kAuthorizationFlagPreAuthorize | kAuthorizationFlagExtendRights; + int curArg = 2; + char **arguments = calloc(10 , sizeof(char*)); + + if (self.isEnabled) { + + if (self.isDSDebugging) { + NSLog(@"adding ds at %i",curArg); + arguments[curArg++] = "-ds"; } - // either disabled or nothing selected - AuthorizationItem right = {kAuthorizationRightExecute, 0, NULL, 0}; - AuthorizationRights rights = {1, &right}; - - OSStatus status; - // Call AuthorizationCopyRights to determine or extend the allowable rights. - status = AuthorizationCopyRights(authorization, &rights, NULL, flags, NULL); - if (status != errAuthorizationSuccess) - NSLog(@"Copy Rights Unsuccessful: %d", status); - - NSLog(@"path is %s",pathToTool); - arguments[0]=(char *)pathToTool; - arguments[1]="-install"; - int i; - for (i=0;i - #import -#endif diff --git a/English.lproj/InfoPlist.strings b/English.lproj/InfoPlist.strings deleted file mode 100644 index 699a7b7..0000000 Binary files a/English.lproj/InfoPlist.strings and /dev/null differ