CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Sat, 19 Jul 2025 05:16:50 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20071105090913
location: https://web.archive.org/web/20071105090913/https://wiki.python.org/moin/MacPython/Authorization
server-timing: captures_list;dur=0.673156, exclusion.robots;dur=0.025164, exclusion.robots.policy;dur=0.011597, esindex;dur=0.013629, cdx.remote;dur=12.637028, LoadShardBlock;dur=118.941892, PetaboxLoader3.datanode;dur=92.825048
x-app-server: wwwb-app215
x-ts: 302
x-tr: 157
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: SERVER=wwwb-app215; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Sat, 19 Jul 2025 05:16:51 GMT
content-type: text/html;charset=utf-8
x-archive-orig-date: Mon, 05 Nov 2007 09:09:13 GMT
x-archive-orig-server: Apache/2.0.54 (Debian GNU/Linux) mod_fastcgi/2.4.2
x-archive-orig-connection: close
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Mon, 05 Nov 2007 09:09:13 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Mon, 05 Nov 2007 09:09:13 GMT", ; rel="memento"; datetime="Mon, 05 Nov 2007 09:09:13 GMT", ; rel="next memento"; datetime="Wed, 05 Dec 2007 17:37:54 GMT", ; rel="last memento"; datetime="Thu, 07 Jul 2022 06:44:21 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 51_0_20071105040037_crawl105-c/51_0_20071105090246_crawl107.arc.gz
server-timing: captures_list;dur=0.668965, exclusion.robots;dur=0.025010, exclusion.robots.policy;dur=0.011228, esindex;dur=0.012403, cdx.remote;dur=8.442085, LoadShardBlock;dur=180.128744, PetaboxLoader3.datanode;dur=132.734412, PetaboxLoader3.resolve;dur=160.308542, load_resource;dur=161.763063
x-app-server: wwwb-app215
x-ts: 200
x-tr: 411
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
MacPython/Authorization - PythonInfo Wiki
MacPython/Authorization
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
1 import os, sys, struct, tempfile
2 from Authorization import Authorization, kAuthorizationFlagDestroyRights
3
4 AUTHORIZEDTOOL = "#!%s\n%s" % (sys.executable,
5 r"""
6 import os
7 print os.getuid(), os.geteuid()
8 os.setuid(0)
9 print "I'm root!"
10 """)
11
12 def main():
13 auth = Authorization(destroyflags=(kAuthorizationFlagDestroyRights,))
14 fd, name = tempfile.mkstemp('.py')
15 os.write(fd, AUTHORIZEDTOOL)
16 os.close(fd)
17 os.chmod(name, 0700)
18 try:
19 pipe = auth.executeWithPrivileges(name)
20 sys.stdout.write(pipe.read())
21 pipe.close()
22 finally:
23 os.unlink(name)
24
25 if __name__=='__main__':
26 main()
homepage
EditText (last edited 2007-10-20 00:12:59 by DavidBoddie)
DeleteCache (cached 2007-10-28 22:07:45)- Login
- Navigation
- Actions
- Your recent pages