-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Nov 20, 2003, at 22:31, Michael G Schwern wrote:
Ok, now we're getitng somewhere. What those two tests have in common
is they both involve being root and then dropping privledges by switching to
user "nobody". I hard coded in uid -2 which is what nobody is on my
machine, but it could be wrong for you. Could you check /etc/passwd
and see what uid nobody has? Also unknown.

nobody is traditionally UID -2 on almost all UNIX systems, and will almost
certainly be -2 on all Mac OS X machines. I don't think we should worry about
that. OTOH, You're doing something funny with local and the UID/EUID. Once
you've set both the UID and EUID to nonzero, you can't (theoretically) set them
back. AFAIK, all you need to do is set the EUID ($<) to nonzero and all
filesystem accesses would be done as that user. Also, if the test is run via
su, then only the EUID is set to root. At the beginning of the test suite,
($<,$>) = (0,0) if $< == 0 or $> == 0;


Then or each test that needs to drop root privs, do:
        skip "You must be root", 2 unless $< == 0;
        local $> = -2;

Also, for the test on lines 143-158, you chmod the file 0400, so the later
"(stat 'foo')[9]" that you do should fail, because AFAIK you cannot stat a
file that you do not have access to.


Cheers,
Kyle Moffett

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (Darwin)

iD8DBQE/vk4eag7LSGnFq10RApn5AJ96URMjhJeXhJHZnypYblQqJevvVACg3w0d
CpoGQB79nisVbu6Mw71CkzI=
=UmpL
-----END PGP SIGNATURE-----



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Fink-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/fink-devel

Reply via email to