bizarre REQUIRE behavior 
Author Message
 bizarre REQUIRE behavior

I've checked the old usenet msgs, webpages, and perlport archives to no avail.
So I'll try to tap the collective wisdom of the good people on this news
group.  

Quote:
>From a C program, I am making a system call to invoke another C program

whose only job is to execute a PERL script.  The second C program is
a C wrapper to allow setuid execution.  The PERL script uses
REQUIRE to bring in the date_math.pl library.  

If this program is invoke by another user, he fails to find that library
although his environment has the correct path in PERL5LIB.
It works fine for me.
Even more mysteriously, I change the wrapper to invoke perl5 in debug mode.
In that case, the other user can run the exact same script with no problem -
He FINDS that library!!

If he runs the script directly, it also works fine in terms of finding the
library.

Any one got any ideas for this?  I'm stumped.
I'm running v5.000 on a HP-UX 9.01.  The C wrapper is using execv to call
the perl script.

Thanks in advance.

A. Chu

-------------------------
All opinions are my own.  No one else, including my employer is responsible
for them in any way.  

--



Tue, 03 Mar 1998 03:00:00 GMT  
 bizarre REQUIRE behavior
:
: I've checked the old usenet msgs, webpages, and perlport archives to no avail.
: So I'll try to tap the collective wisdom of the good people on this news
: group.  
:
: >From a C program, I am making a system call to invoke another C program
: whose only job is to execute a PERL script.  The second C program is
: a C wrapper to allow setuid execution.  The PERL script uses
: REQUIRE to bring in the date_math.pl library.  
:
: If this program is invoke by another user, he fails to find that library
: although his environment has the correct path in PERL5LIB.
: It works fine for me.
: Even more mysteriously, I change the wrapper to invoke perl5 in debug mode.
: In that case, the other user can run the exact same script with no problem -
: He FINDS that library!!
:
: If he runs the script directly, it also works fine in terms of finding the
: library.
:
: Any one got any ideas for this?  I'm stumped.

Perl specifically ignores environment variables like PERL5LIB when running
setuid, since all environment variables are considered tainted.  The script
must instead do something like


Larry



Fri, 13 Mar 1998 03:00:00 GMT  
 bizarre REQUIRE behavior

Quote:

> Perl specifically ignores environment variables like PERL5LIB when running
> setuid, since all environment variables are considered tainted.  The script
> must instead do something like


> Larry

Or, since lib.pm was included in Perl5.001m you can now just say:

        use lib '/my/special/lib';

Tim.



Sat, 14 Mar 1998 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. What causes this bizarre hash behavior?

2. Bizarre mod_perl behavior

3. bizarre PERL/CGI behavior question

4. Truly bizarre do FILE behavior

5. bizarre $var->method behavior

6. Bizarre regexp behavior (bug?)

7. questionable behavior of require

8. Strange behavior with require

9. Strange use/require behavior

10. Bizarre intermittent behavior in Tk::Pod - this one is deep.

11. Bizarre behavior w/pipe-fork-exec("shell script")

12. Bizarre intermittent behavior in Tk::Pod - this one is deep.

 

 
Powered by phpBB® Forum Software