site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Works for me... (TM). (Note the euid...) _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... On Dec 13, 2004, at 9:24 PM, Justin Walker wrote: On Dec 13, 2004, at 21:11, James Berry wrote: Java won't do this for you automatically. Ultimately you've got to get it running at superuser privilege. Common techniques include using a script to run it with su privileges by setting the ownership to root, and setting the suid bit. FWIW, I don't think this will work on most recent unices. It definitely doesn't on Mac OS X, 10.3.6: $ cat foo.sh id $ ls -l foo.sh -r-sr-xr-x 1 root staff 3 13 Dec 21:22 foo.sh $ foo.sh uid=10180(justin) gid=20(staff) groups=20(staff), 79(appserverusr), 80(admin), 81(appserveradm) Most systems will not permit shell scripts to execute 'setuid'. caddy:jberry ~/bin % cat > test #!/bin/sh id caddy:jberry ~/bin % sudo chown root test caddy:jberry ~/bin % sudo chmod +xs test caddy:jberry ~/bin % ls -l test -rwsr-sr-x 1 root jberry 14 13 Dec 21:41 test caddy:jberry ~/bin % ./test uid=501(jberry) euid=0(root) gid=501(jberry) groups=501(jberry), 79(appserverusr), 80(admin), 81(appserveradm), 505(svn) caddy:jberry ~/bin % uname -v Darwin Kernel Version 7.6.0: Sun Oct 10 12:05:27 PDT 2004; root:xnu/xnu-517.9.4.obj~1/RELEASE_PPC This email sent to site_archiver@lists.apple.com