Hi All, In my project , I added an executable and created AuthorizationRef successfully.The AuthorizationCopyRights also worked without error.But when AuthorizationExecuteWithPrivileges , it shows the invalid flags error.
Kindly help me. Thanks In Advance, Sheen OSStatus status;AuthorizationRef auth; AuthorizationExternalForm extAuth; if (geteuid() != 0) { setuid(0); } if (fread(&extAuth, sizeof(extAuth), 1, stdin) != 1) exit(-1); if (AuthorizationCreateFromExternalForm(&extAuth, &auth)) exit(-1); AuthorizationItem right = { RIGHT, 0, NULL, 0 }; AuthorizationRights rights = { 1, &right }; AuthorizationFlags flags = kAuthorizationFlagDefaults | kAuthorizationFlagExtendRights; if (status = AuthorizationCopyRights(auth, &rights, kAuthorizationEmptyEnvironment, flags, NULL)) { exit(-1); } char* args[3]; OSStatus err = 0; FILE* iopipe; args[0] = "-w"; args[1]="net.inet.ip.forwarding=1"; args[2]=NULL; err = AuthorizationExecuteWithPrivileges(auth, "/usr/sbin/sysctl", flags, args, &iopipe); if(err!=errAuthorizationSuccess) fprintf(stderr,"failed\n"); _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]