Mailing Lists: Apple Mailing Lists

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

Re: user authentication?



"Paul Popovich" <email@hidden> wrote:

>I have written a network installer in java that employs a number of
>JNIs to do system level configuration.
>Because of the system JNIs it only works under 'root' boot, and needs
>user authentication under any other login.
>I've looked but couldn't find any java libraries (apple custom
>libraries?) that would provide for an authentication box.
>There's a C Security framework that I could use but it has trouble
>launching a java file for some reason.

Depending on what those JNI libraries are actually doing, you might try
exec()'ing the 'authopen' command to manipulate root-only files. It's a
command-line way to hook into Authorization Services for a small number of
file-manipulation features. See 'man authopen'. The command is probably
not in your command path, but is at:
/usr/libexec/authopen

One caveat after playing with it a little. The '-m mode' option says
nothing about what forms the mode may take. If you give it a number, be
sure to use a leading 0 to signify "octal", otherwise it will be
interpreted in decimal. That is "644" will be interpreted as the decimal
number 644, not the octal number 644, resulting in very screwed-up modes.

Sadly, 'authopen' has no capability to move or rename a file, remove a
file, change modes, change owner, create a directory, or do any of
countless other useful things that one might hope for. It can only read,
overwrite, append to, or create a privileged file under Authorization
Services. But if that's all you need, it may work out for you.


By the way, the "policy database" that Authorization Services reads for
policies is the XML plist-format file found at:
/etc/authorization

I searched a long time to discover that little tidbit of information, which
is exasperatingly absent from the available Apple docs. The policy
database has comments in it that explain the default policies.

-- GG
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.



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.