Last change
on this file since 297 was 229, checked in by rchin, 19 years ago |
Created DSCL framework from DSCL open source code (distributed as a part of Darwin from Apple). This is for programmatically testing and adding entries to directory services, so that I can add the user to the procmod group. The modified DSCL code is in a zip file available for people to use (had to add some methods to provide better read functionality). Also has a binary that does the adding to procmod group with escalated privileges when the user authenticates via the authorization services security framework. Updated the readme to reflect this additional step for building.
|
File size:
803 bytes
|
Line | |
---|
1 | /*
|
---|
2 | * main.c
|
---|
3 | * F-Script Anywhere
|
---|
4 | *
|
---|
5 | * Created by Robert Chin on 5/19/06.
|
---|
6 | * Copyright 2006 __MyCompanyName__. All rights reserved.
|
---|
7 | *
|
---|
8 | */
|
---|
9 |
|
---|
10 | #import <DSCL/PathManager.h>
|
---|
11 | #import <CoreFoundation/CoreFoundation.h>
|
---|
12 | #import <ApplicationServices/ApplicationServices.h>
|
---|
13 | #import <Foundation/Foundation.h>
|
---|
14 |
|
---|
15 | int main(int argc, char **argv)
|
---|
16 | {
|
---|
17 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
---|
18 | PathManager *engine = [[PathManager alloc] initWithLocalNode];
|
---|
19 | [engine backupStack];
|
---|
20 | [engine cd:@"/Groups/procmod"];
|
---|
21 | tDirStatus status = [engine appendToRecord:nil
|
---|
22 | key:@"GroupMembership"
|
---|
23 | values:[NSArray arrayWithObject:[NSString stringWithUTF8String:argv[1]]]];
|
---|
24 | [engine restoreStack];
|
---|
25 | [engine release];
|
---|
26 | printf("%d", status);
|
---|
27 | [pool release];
|
---|
28 | return 0;
|
---|
29 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.