Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SCDynamicStoreSetValue and proxies



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:
http://lists.apple.com/mailman/options/macnetworkprog/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.