• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
SCDynamicStoreSetValue and proxies
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Can I Make a Web Server in 15 Minutes?
  • Next by Date: Create new PPP service
  • Previous by thread: SSLGetBufferedReadSize problem
  • Next by thread: Create new PPP service
  • Index(es):
    • Date
    • Thread