SCDynamicStoreSetValue and proxies
SCDynamicStoreSetValue and proxies
- Subject: SCDynamicStoreSetValue and proxies
- From: Troy Dawson <email@hidden>
- Date: Fri, 22 Feb 2008 10:41:41 -0800
I am creating a helper tool for my uninstall app (which will be run
as root) to disable proxy changes where applicable.
Unfortunately, I cannot find docs on how to access the SC store to
change values within it; the following example is incorrect (since
SCDynamicStoreSetValue () works with plist values and not simple
values) but is what I want to do . . .
Can anybody help before I burn a support incident?
#import <Foundation/Foundation.h>
#import <SystemConfiguration/SystemConfiguration.h>
void perform_action(const char* argv[])
{
NSDictionary *sc_proxies = (NSDictionary*) SCDynamicStoreCopyProxies
(NULL);
if (!sc_proxies)
{
NSLog(@"no proxy settings");
return;
}
NSLog(@"HTTPS Enabled: %@", [sc_proxies objectForKey: (NSString*)
kSCPropNetProxiesHTTPSEnable]);
SCDynamicStoreRef store_ref = SCDynamicStoreCreate(NULL, CFSTR
("Proxy Uninstall"), NULL, NULL);
Boolean success = SCDynamicStoreSetValue(store_ref,
kSCPropNetProxiesHTTPSEnable, [NSNumber numberWithInt: 0]);
NSLog(@"Status was %d", success);
}
int main (int argc, const char * argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
perform_action(argv);
[pool release];
return 0;
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden