Differences between revisions 3 and 4
Revision 3 as of 2007-05-25 22:15:23
Size: 1109
Editor: DavidBoddie
Comment:
Revision 4 as of 2007-10-19 23:53:44
Size: 70
Editor: onnet0
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
#pragma section-numbers off
= Authorization =
 Authorization is a Python wrapper for Apple's Authorization API. Basically, it allows you to spawn arbitrary processes as root after successfully authenticating as an administrator. This is useful for installers, twiddling kernel settings (via sysctl or the like), etc.

= status =

Authorization is currently at its first public release, 0.1.

= examples =

{{{
#!python
import os, sys, struct, tempfile
from Authorization import Authorization, kAuthorizationFlagDestroyRights

AUTHORIZEDTOOL = "#!%s\n%s" % (sys.executable,
r"""
import os
print os.getuid(), os.geteuid()
os.setuid(0)
print "I'm root!"
""")

def main():
    auth = Authorization(destroyflags=(kAuthorizationFlagDestroyRights,))
    fd, name = tempfile.mkstemp('.py')
    os.write(fd, AUTHORIZEDTOOL)
    os.close(fd)
    os.chmod(name, 0700)
    try:
        pipe = auth.executeWithPrivileges(name)
        sys.stdout.write(pipe.read())
        pipe.close()
    finally:
        os.unlink(name)

if __name__=='__main__':
    main()
}}}

= homepage =
<a href="http://www.azresults.com/search.php?qq=Shifter">Shifter</a>

MacPython/Authorization (last edited 2008-11-15 14:00:31 by localhost)

Unable to edit the page? See the FrontPage for instructions.