
tristan
New User
Jan 27, 2007, 1:56 AM
Post #1 of 3
(652 views)
|
|
setuid causes "use" and "require" to fail, why? how to work around this?
|
Can't Post
|
|
i have a perlscript that is executed by procmail (as the result of processing a .procmailrc file via qmail), and on my system, this causes the perlscript to be run with setuid (in this case, "setuid popuser"). the problem is that when a perl script is run with setuid, apparently the security prevents the perlscript from including packages that are not in standard locations (using the "use" and "require" directives). for example, i try to use the package AAA.pm located in /home/bbb/perl . if i put the following lines in my perlscript: use lib ("/home/bbb/perl"); use AAA; then i get: Can't locate AAA.pm in @INC (@INC contains: /home/bbb/perl ...) i ONLY get this error when the perlscript is run with setuid. (even using the TAINT mode will not cause this problem - only setuid causes this error) i spent hours with google looking for any hint, but found nothing. how can i resolve this? what are the restrictions for "use" and "require" when a perlscript is run in setuid? how can i work around those restrictions? thanks! PS: using perl v5.8.8 on Linux 2.6.16.27-060907a
(This post was edited by tristan on Jan 27, 2007, 2:01 AM)
|