develooper Front page | perl.perl5.porters | Postings from September 2001

[ID 20010927.029] FindBin.pm fails for setuid script on solaris

Thread Next
From:
psfales
Date:
September 27, 2001 15:33
Subject:
[ID 20010927.029] FindBin.pm fails for setuid script on solaris
Message ID:
200109272154.QAA28913@ihgp6.ih.lucent.com

This is a bug report for perl from psfales@lucent.com,
generated with the help of perlbug 1.33 running under perl v5.6.1.


-----------------------------------------------------------------
When a perl script is marked setuid on recent versions of solaris, $0
is passed in as /dev/fd/3.  I understand that this is a feature of the
OS, but it breaks the FindBin.pm module.  Perhaps there is no way to
around this, but perhaps FindBin.pm could at least check for this case
and produce an error message that would help explain what is going on.
Here's the test program:

        #!/usr/bin/perl -w
        print "\$0 = $0\n";

        use FindBin qw($Bin);
        print "$Bin\n";


When this program is run, we get:
                                   
Cannot find current script '/dev/fd/3' at
/opt/exp/perl/lib/5.6.1/FindBin.pm line 166
BEGIN failed--compilation aborted at /opt/exp/perl/lib/5.6.1/FindBin.pm
line 16!
6.                                                                     
       
Compilation failed in require at /dev/fd/3 line 4.
BEGIN failed--compilation aborted at /dev/fd/3 line 4.


[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=library
    severity=medium
---
Site configuration information for perl v5.6.1:

Configured by expmake at Thu Sep 20 22:53:15 EDT 2001.

Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
  Platform:
    osname=solaris, osvers=2.5.1, archname=sun4-solaris
    uname='sunos orion 5.5.1 generic_103640-29 sun4u sparc '
    config_args='-d'
    hint=previous, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler:
    cc='cc', ccflags ='',
    optimize='-O',
    cppflags=''
    ccversion='', gccversion='', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/opt/exp/perl/lib -L/usr/ucblib -R/usr/ucblib'
    libpth=/opt/exp/perl/lib /lib /usr/lib /usr/ccs/lib /usr/ucblib
    libs=-lsocket -lnsl -ldbm -ldl -lm -lc -lcrypt -lsec -lucb
    perllibs=-lsocket -lnsl -ldl -lm -lc -lcrypt -lsec -lucb
    libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-KPIC', lddlflags='-G -L/opt/exp/perl/lib -L/usr/ucblib -R/usr/ucblib'

Locally applied patches:
    

---
@INC for perl v5.6.1:
    /opt/exp/perl/lib/5.6.1/sun4-solaris
    /opt/exp/perl/lib/5.6.1
    /opt/exp/perl/lib/site_perl/5.6.1/sun4-solaris
    /opt/exp/perl/lib/site_perl/5.6.1
    /opt/exp/perl/lib/site_perl
    .

---
Environment for perl v5.6.1:
    HOME=/home/psfales
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/psfales/bin:/home/psfales/bin:/opt/exptools/bin:/opt/dwb/bin:/usr/bin:/usr/sbin:/opt/bin:/opt/SUNWspro/bin:/usr/ccs/bin:/opt/ssh/bin:/opt/sudo/bin::/opt/unison/bin
    PERL_BADLANG (unset)
    SHELL=/bin/ksh93


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About