Re: Changing PPP settings
Re: Changing PPP settings
- Subject: Re: Changing PPP settings
- From: "Alastair M. Rampell" <email@hidden>
- Date: Mon, 18 Feb 2002 16:28:58 -0500
Thanks for the quick response.
Let me illustrate the problem in a little more detail. A program
automatically changes the PPP settings to something we don't want. In one
instance, I can verify that this program did not have root access simply
because root access was not enabled at all. I'm not quite clear how it's
achieving this effect, but I do need to fix it.
It seems strange that these settings can be changes (via the GUI) without
root access, and yet in order to change them programmatically one needs root
access---especially since this one application seems to be getting around
all of that.
Do you have any ideas on this?
Thanks,
Alastair Rampell
>
From: Joe Kelly <email@hidden>
>
Date: Mon, 18 Feb 2002 12:33:21 -0800
>
To: "'Alastair M. Rampell'" <email@hidden>,
>
email@hidden
>
Subject: RE: Changing PPP settings
>
>
>
Alastair M. Rampell writes:
>
> First, is it possible to compile something that uses MoreSCF
>
> as a Carbon
>
> application? Or does it need to be built as a Mach
>
> executable?
>
>
Yes and yes. You can use MoreSCF in a Carbon application that's built as
>
mach-O. Unfortunately, since you seem intent on actually CHANGING some of
>
the SCF settings, you will also need to be running as root. See AuthTool
>
sample for Apple's recommended approach to running a root tool (it's
>
twisted).
>
>
>
> What I need
>
> to do should be relatively simple; I just need to change the
>
> PPP Options of
>
> the current location. Does configuration = location? I'm
>
> actually assuming
>
> it's a Port Configuration...
>
>
>
> In that case, what I need to do is find all the port
>
> configurations which
>
> use PPP, and then change the advanced PPP options. (Is there
>
> a call for
>
> just changing the PPP options? I see how to create, but in
>
> order to change
>
> do I need to make a copy and replace?
>
>
>
To get the current set (location): MoreSCCopyCurrentSet().
>
To get a list of services that location uses (service is roughly akin to
>
port): MoreSCCopyServiceIDs().
>
Iterate that list to find the service you are looking for ("PPP") -- I use
>
MoreSCCopyUserVisibleNameOfService() in conjunction with CFStringCompare().
>
Once you have the service ID, you could then make it active
>
(MoreSCSetServiceActive())
>
A service is composed of entities (these are the individual prefs you want
>
to change). To get the service's entities, you use MoreSCCopyEntityMutable()
>
which returns its data in a CFMutableDictionaryRef -- I think you'd want to
>
use the entity key kSCEntNetPPP. You can then grope this dictionary for the
>
keys you need (see SCSchemaDefinitions.h, in SC.framework, search on
>
"kSCEntNetPPP Entity Keys"), use CFDictionaryReplaceValue() to change a key,
>
and then MoreSCSetEntity() to commit the changes.
>
>
Hope that helps.
>
>
joe
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.