Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.98k stars 560 forks source link

abs_path in Cwd 3.01 fails for any path when . is unreadable. #7591

Closed p5pRT closed 19 years ago

p5pRT commented 20 years ago

Migrated from rt.perl.org#32406 (status was 'resolved')

Searchable as RT32406$

p5pRT commented 20 years ago

From che@chrekh.se

Created by chrekh@rsv.se

Cwd​::abs_path from Cwd 3.01 returns undef even for valid readable paths when . is not readable.

Steps to reproduce​:

1) as root\, make a test-directory readable for root only. 2) cd to that dir 3) run the following test-script with 'su user -c script'

---------------------------------------------------------- use strict; use warnings;

use Cwd qw/ &abs_path /;

print $Cwd​::VERSION\,"\n";

my $some_dir = abs_path('/var/spool');

print "$some_dir\n"; ----------------------------------------------------------

The result I get is​:

# mkdir /tmp/foo # cd /tmp/foo # chmod og-r . # ls -ld . drwx--x--x 2 root bin 96 nov 11 10​:44 ./ # ~chrekh/tmp/test.pl 3.01 /var/spool # su chrekh -c ~chrekh/tmp/test.pl 3.01 Use of uninitialized value in concatenation (.) or string at /home/u30003/chrekh/tmp/test.pl line 12.

Perl Info ``` Flags: category=core severity=low Site configuration information for perl v5.8.5: Configured by chrekh at Tue Sep 21 12:23:56 METDST 2004. Summary of my perl5 (revision 5 version 8 subversion 5) configuration: Platform: osname=hpux, osvers=11.00, archname=PA-RISC2.0 uname='hp-ux u30090 b.11.00 a 9000800 582000562 two-user license ' config_args='-Dprefix=/opt/rsv/pd -Ubincompat5005 -Uusemymalloc -Uinstallusrbinperl -Duselargefiles' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags =' -Ae +DAportable -D_HPUX_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 ', optimize='-O +Onolimit', cppflags='-Aa -D__STDC_EXT__ +DAportable -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_HPUX_SOURCE -Ae +DAportable -D_HPUX_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' ccversion='A.11.01.00', 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=8 alignbytes=8, prototype=define Linker and Libraries: ld='/usr/bin/ld', ldflags ='' libpth=/lib /usr/lib /usr/ccs/lib libs=-lcl -lpthread -lnsl -lnm -lndbm -lmalloc -lm -lcrypt -lsec -lc perllibs=-lcl -lpthread -lnsl -lnm -lmalloc -lm -lcrypt -lsec -lc libc=/lib/libc.sl, so=sl, useshrplib=false, libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-B,deferred ' cccdlflags='+Z', lddlflags='-b' Locally applied patches: @INC for perl v5.8.5: /opt/rsv/pd/lib/perl5/5.8.5/PA-RISC2.0 /opt/rsv/pd/lib/perl5/5.8.5 /opt/rsv/pd/lib/perl5/site_perl/5.8.5/PA-RISC2.0 /opt/rsv/pd/lib/perl5/site_perl/5.8.5 /opt/rsv/pd/lib/perl5/site_perl /opt/rsv/lib/perl . Environment for perl v5.8.5: HOME=/home/u30003/chrekh LANG=sv_SE.iso88591 LANGUAGE (unset) LC_MESSAGES=C LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/home/u30003/chrekh/bin:/home/u30003/chrekh/perl:/opt/rsv/bin:/opt/rsv/sbin:/opt/rsv/lbin:/usr/site/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/ccs/bin:/opt/ansic/bin:/opt/langtools/bin:/opt/imake/bin:/opt/aCC/bin:/opt/perf/bin:/opt/tusc/bin:/opt/atria/bin:/opt/rsv/pd/bin:/usr/bin/X11:/usr/contrib/bin/X11:/usr/site/pd/bin:/usr/contrib/bin PERL_BADLANG (unset) SHELL=/opt/rsv/pd/bin/bash Complete configuration data for perl v5.8.5: Author='' CONFIG='true' Date='$Date' Header='' Id='$Id' Locker='' Log='$Log' Mcc='Mcc' PATCHLEVEL='8' PERL_API_REVISION='5' PERL_API_SUBVERSION='0' PERL_API_VERSION='8' PERL_CONFIG_SH='true' PERL_REVISION='5' PERL_SUBVERSION='5' PERL_VERSION='8' RCSfile='$RCSfile' Revision='$Revision' SUBVERSION='5' Source='' State='' _a='.a' _exe='' _o='.o' afs='false' afsroot='/afs' alignbytes='8' ansi2knr='' aphostname='/bin/hostname' api_revision='5' api_subversion='0' api_version='8' api_versionstring='5.8.0' ar='ar' archlib='/opt/rsv/pd/lib/perl5/5.8.5/PA-RISC2.0' archlibexp='/opt/rsv/pd/lib/perl5/5.8.5/PA-RISC2.0' archname='PA-RISC2.0' archname64='LP64' archobjs='' asctime_r_proto='0' awk='awk' baserev='5.0' bash='' bin='/opt/rsv/pd/bin' binexp='/opt/rsv/pd/bin' bison='bison' byacc='byacc' byteorder='4321' c='\c' castflags='0' cat='cat' cc='cc' cccdlflags='+Z' ccdlflags='-Wl,-E -Wl,-B,deferred ' ccflags=' -Ae +DAportable -D_HPUX_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 ' ccflags_uselargefiles='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' ccname='cc' ccsymbols='_HPUX_SOURCE=1 _PA_RISC1_1=1 __STDC_EXT__=1' ccversion='A.11.01.00' cf_by='chrekh' cf_email='chrekh@u30090.rsv.rsv.se' cf_time='Tue Sep 21 12:23:56 METDST 2004' charsize='1' chgrp='' chmod='chmod' chown='' clocktype='clock_t' comm='comm' compress='' config_arg0='Configure' config_arg1='-Dprefix=/opt/rsv/pd' config_arg2='-Ubincompat5005' config_arg3='-Uusemymalloc' config_arg4='-Uinstallusrbinperl' config_arg5='-Duselargefiles' config_argc='5' config_args='-Dprefix=/opt/rsv/pd -Ubincompat5005 -Uusemymalloc -Uinstallusrbinperl -Duselargefiles' contains='grep' cp='cp' cpio='' cpp='cpp' cpp_stuff='42' cppccsymbols='__hp9000s800=1 __hppa=1 __hpux=1 __unix=1' cppflags='-Aa -D__STDC_EXT__ +DAportable -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_HPUX_SOURCE -Ae +DAportable -D_HPUX_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' cpplast='-' cppminus='-' cpprun='cc -E -Aa -D__STDC_EXT__' cppstdin='cc -E -Aa -D__STDC_EXT__' cppsymbols='_FILE_OFFSET_BITS=64 _HPUX_SOURCE=1 _LARGEFILE_SOURCE=1 _LFS64_LARGEFILE=1 _LFS_LARGEFILE=1 _PA_RISC1_1=1 _PROTOTYPES=1 __STDC__=1 __STDC_EXT__=1 _XPG4=1 _XPG4_EXTENDED=1' crypt_r_proto='0' cryptlib='' csh='csh' ctermid_r_proto='0' ctime_r_proto='0' d_Gconvert='gcvt((x),(n),(b))' d_PRIEUldbl='define' d_PRIFUldbl='define' d_PRIGUldbl='define' d_PRIXU64='define' d_PRId64='define' d_PRIeldbl='define' d_PRIfldbl='define' d_PRIgldbl='define' d_PRIi64='define' d_PRIo64='define' d_PRIu64='define' d_PRIx64='define' d_SCNfldbl='define' d__fwalk='' d_access='define' d_accessx='' d_aintl='' d_alarm='define' d_archlib='define' d_asctime_r='' d_atolf='' d_atoll='' d_attribut='' d_bcmp='define' d_bcopy='define' d_bsd='define' d_bsdgetpgrp='' d_bsdsetpgrp='' d_bzero='define' d_casti32='define' d_castneg='define' d_charvspr='' d_chown='define' d_chroot='define' d_chsize='' d_class='' d_closedir='define' d_cmsghdr_s='' d_const='define' d_copysignl='' d_crypt='define' d_crypt_r='' d_csh='define' d_ctermid_r='' d_ctime_r='' d_cuserid='define' d_dbl_dig='define' d_dbminitproto='' d_difftime='define' d_dirfd='define' d_dirnamlen='define' d_dlerror='define' d_dlopen='define' d_dlsymun='' d_dosuid='' d_drand48_r='' d_drand48proto='define' d_dup2='define' d_eaccess='' d_endgrent='define' d_endgrent_r='' d_endhent='define' d_endhostent_r='' d_endnent='define' d_endnetent_r='' d_endpent='define' d_endprotoent_r='' d_endpwent='define' d_endpwent_r='' d_endsent='define' d_endservent_r='' d_eofnblk='define' d_eunice='' d_faststdio='define' d_fchdir='define' d_fchmod='define' d_fchown='define' d_fcntl='define' d_fcntl_can_lock='define' d_fd_macros='define' d_fd_set='define' d_fds_bits='define' d_fgetpos='define' d_finite='' d_finitel='' d_flexfnam='define' d_flock='' d_flockproto='' d_fork='define' d_fp_class='' d_fpathconf='define' d_fpclass='' d_fpclassify='define' d_fpclassl='' d_fpos64_t='define' d_frexpl='' d_fs_data_s='' d_fseeko='define' d_fsetpos='define' d_fstatfs='define' d_fstatvfs='define' d_fsync='define' d_ftello='define' d_ftime='' d_getcwd='define' d_getespwnam='' d_getfsstat='' d_getgrent='define' d_getgrent_r='' d_getgrgid_r='' d_getgrnam_r='' d_getgrps='define' d_gethbyaddr='define' d_gethbyname='define' d_gethent='define' d_gethname='define' d_gethostbyaddr_r='' d_gethostbyname_r='' d_gethostent_r='' d_gethostprotos='define' d_getitimer='define' d_getlogin='define' d_getlogin_r='' d_getmnt='' d_getmntent='define' d_getnbyaddr='define' d_getnbyname='define' d_getnent='define' d_getnetbyaddr_r='' d_getnetbyname_r='' d_getnetent_r='' d_getnetprotos='define' d_getpagsz='define' d_getpbyname='define' d_getpbynumber='define' d_getpent='define' d_getpgid='define' d_getpgrp='define' d_getpgrp2='define' d_getppid='define' d_getprior='define' d_getprotobyname_r='' d_getprotobynumber_r='' d_getprotoent_r='' d_getprotoprotos='define' d_getprpwnam='define' d_getpwent='define' d_getpwent_r='' d_getpwnam_r='' d_getpwuid_r='' d_getsbyname='define' d_getsbyport='define' d_getsent='define' d_getservbyname_r='' d_getservbyport_r='' d_getservent_r='' d_getservprotos='define' d_getspnam='define' d_getspnam_r='' d_gettimeod='define' d_gmtime_r='' d_gnulibc='' d_grpasswd='define' d_hasmntopt='define' d_htonl='define' d_ilogbl='' d_index='' d_inetaton='define' d_int64_t='define' d_isascii='define' d_isfinite='define' d_isinf='define' d_isnan='define' d_isnanl='' d_killpg='define' d_lchown='define' d_ldbl_dig='define' d_link='define' d_localtime_r='' d_locconv='define' d_lockf='define' d_longdbl='define' d_longlong='define' d_lseekproto='define' d_lstat='define' d_madvise='define' d_mblen='define' d_mbstowcs='define' d_mbtowc='define' d_memchr='define' d_memcmp='define' d_memcpy='define' d_memmove='define' d_memset='define' d_mkdir='define' d_mkdtemp='' d_mkfifo='define' d_mkstemp='define' d_mkstemps='' d_mktime='define' d_mmap='define' d_modfl='' d_modfl_pow32_bug='' d_modflproto='' d_mprotect='define' d_msg='define' d_msg_ctrunc='' d_msg_dontroute='define' d_msg_oob='define' d_msg_peek='define' d_msg_proxy='' d_msgctl='define' d_msgget='define' d_msghdr_s='define' d_msgrcv='define' d_msgsnd='define' d_msync='define' d_munmap='define' d_mymalloc='' d_nice='define' d_nl_langinfo='define' d_nv_preserves_uv='define' d_off64_t='define' d_old_pthread_create_joinable='' d_oldpthreads='' d_oldsock='' d_open3='define' d_pathconf='define' d_pause='define' d_perl_otherlibdirs='define' d_phostname='' d_pipe='define' d_poll='define' d_portable='define' d_procselfexe='' d_pthread_atfork='define' d_pthread_attr_setscope='define' d_pthread_yield='' d_pwage='define' d_pwchange='' d_pwclass='' d_pwcomment='define' d_pwexpire='' d_pwgecos='define' d_pwpasswd='define' d_pwquota='' d_qgcvt='' d_quad='define' d_random_r='' d_readdir='define' d_readdir64_r='' d_readdir_r='' d_readlink='define' d_readv='define' d_recvmsg='define' d_rename='define' d_rewinddir='define' d_rmdir='define' d_safebcpy='' d_safemcpy='' d_sanemcmp='define' d_sbrkproto='define' d_scalbnl='' d_sched_yield='define' d_scm_rights='' d_seekdir='define' d_select='define' d_sem='define' d_semctl='define' d_semctl_semid_ds='define' d_semctl_semun='define' d_semget='define' d_semop='define' d_sendmsg='define' d_setegid='' d_seteuid='' d_setgrent='define' d_setgrent_r='' d_setgrps='define' d_sethent='define' d_sethostent_r='' d_setitimer='define' d_setlinebuf='' d_setlocale='define' d_setlocale_r='' d_setnent='define' d_setnetent_r='' d_setpent='define' d_setpgid='define' d_setpgrp='define' d_setpgrp2='define' d_setprior='define' d_setproctitle='' d_setprotoent_r='' d_setpwent='define' d_setpwent_r='' d_setregid='define' d_setresgid='define' d_setresuid='define' d_setreuid='define' d_setrgid='' d_setruid='' d_setsent='define' d_setservent_r='' d_setsid='define' d_setvbuf='define' d_sfio='' d_shm='define' d_shmat='define' d_shmatprototype='define' d_shmctl='define' d_shmdt='define' d_shmget='define' d_sigaction='define' d_sigprocmask='define' d_sigsetjmp='define' d_sockatmark='' d_sockatmarkproto='' d_socket='define' d_socklen_t='define' d_sockpair='define' d_socks5_init='' d_sqrtl='' d_srand48_r='' d_srandom_r='' d_sresgproto='define' d_sresuproto='define' d_statblks='define' d_statfs_f_flags='' d_statfs_s='define' d_statvfs='define' d_stdio_cnt_lval='define' d_stdio_ptr_lval='define' d_stdio_ptr_lval_nochange_cnt='define' d_stdio_ptr_lval_sets_cnt='' d_stdio_stream_array='define' d_stdiobase='define' d_stdstdio='define' d_strchr='define' d_strcoll='define' d_strctcpy='define' d_strerrm='strerror(e)' d_strerror='define' d_strerror_r='' d_strftime='define' d_strtod='define' d_strtol='define' d_strtold='define' d_strtoll='' d_strtoq='' d_strtoul='define' d_strtoull='' d_strtouq='' d_strxfrm='define' d_suidsafe='' d_symlink='define' d_syscall='define' d_syscallproto='' d_sysconf='define' d_sysernlst='' d_syserrlst='define' d_system='define' d_tcgetpgrp='define' d_tcsetpgrp='define' d_telldir='define' d_telldirproto='define' d_time='define' d_times='define' d_tm_tm_gmtoff='' d_tm_tm_zone='' d_tmpnam_r='' d_truncate='define' d_ttyname_r='' d_tzname='define' d_u32align='define' d_ualarm='define' d_umask='define' d_uname='define' d_union_semun='' d_unordered='define' d_usleep='define' d_usleepproto='define' d_ustat='define' d_vendorarch='' d_vendorbin='' d_vendorlib='' d_vendorscript='' d_vfork='' d_void_closedir='' d_voidsig='define' d_voidtty='' d_volatile='define' d_vprintf='define' d_wait4='' d_waitpid='define' d_wcstombs='define' d_wctomb='define' d_writev='define' d_xenix='' date='date' db_hashtype='u_int32_t' db_prefixtype='size_t' db_version_major='' db_version_minor='' db_version_patch='' defvoidused='15' direntrytype='struct dirent' dlext='sl' dlsrc='dl_hpux.xs' doop_cflags='' doublesize='8' drand01='drand48()' drand48_r_proto='0' dynamic_ext='attrs B ByteLoader Cwd Data/Dumper Devel/DProf Devel/Peek Devel/PPPort Digest/MD5 Encode Fcntl File/Glob Filter/Util/Call I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 NDBM_File ODBM_File Opcode PerlIO/encoding PerlIO/scalar PerlIO/via POSIX re SDBM_File Socket Storable Sys/Hostname Sys/Syslog threads Time/HiRes Unicode/Normalize XS/APItest XS/Typemap threads/shared' eagain='EAGAIN' ebcdic='' echo='echo' egrep='egrep' emacs='' endgrent_r_proto='0' endhostent_r_proto='0' endnetent_r_proto='0' endprotoent_r_proto='0' endpwent_r_proto='0' endservent_r_proto='0' eunicefix=':' exe_ext='' expr='expr' extensions='attrs B ByteLoader Cwd Data/Dumper Devel/DProf Devel/Peek Devel/PPPort Digest/MD5 Encode Fcntl File/Glob Filter/Util/Call I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 NDBM_File ODBM_File Opcode PerlIO/encoding PerlIO/scalar PerlIO/via POSIX re SDBM_File Socket Storable Sys/Hostname Sys/Syslog threads Time/HiRes Unicode/Normalize XS/APItest XS/Typemap threads/shared Errno' extras='' fflushNULL='' fflushall='' find='' firstmakefile='makefile' flex='' fpossize='8' fpostype='fpos_t' freetype='void' from=':' full_ar='/usr/bin/ar' full_csh='/bin/csh' full_sed='/bin/sed' gccansipedantic='' gccosandvers='' gccversion='' getgrent_r_proto='0' getgrgid_r_proto='0' getgrnam_r_proto='0' gethostbyaddr_r_proto='0' gethostbyname_r_proto='0' gethostent_r_proto='0' getlogin_r_proto='0' getnetbyaddr_r_proto='0' getnetbyname_r_proto='0' getnetent_r_proto='0' getprotobyname_r_proto='0' getprotobynumber_r_proto='0' getprotoent_r_proto='0' getpwent_r_proto='0' getpwnam_r_proto='0' getpwuid_r_proto='0' getservbyname_r_proto='0' getservbyport_r_proto='0' getservent_r_proto='0' getspnam_r_proto='0' gidformat='"ld"' gidsign='-1' gidsize='4' gidtype='gid_t' glibpth='/usr/shlib /lib /usr/lib /usr/lib/386 /lib/386 /usr/ccs/lib /usr/ucblib /usr/local/lib ' gmake='gmake' gmtime_r_proto='0' gnulibc_version='' grep='grep' groupcat='cat /etc/group' groupstype='gid_t' gzip='gzip' h_fcntl='false' h_sysfile='true' hint='recommended' hostcat='cat /etc/hosts' html1dir=' ' html1direxp='' html3dir=' ' html3direxp='' i16size='2' i16type='short' i32size='4' i32type='long' i64size='8' i64type='long long' i8size='1' i8type='char' i_arpainet='define' i_bsdioctl='' i_crypt='define' i_db='' i_dbm='define' i_dirent='define' i_dld='' i_dlfcn='define' i_fcntl='' i_float='define' i_fp='' i_fp_class='' i_gdbm='' i_grp='define' i_ieeefp='' i_inttypes='define' i_langinfo='define' i_libutil='' i_limits='define' i_locale='define' i_machcthr='' i_malloc='define' i_math='define' i_memory='' i_mntent='define' i_ndbm='define' i_netdb='define' i_neterrno='' i_netinettcp='define' i_niin='define' i_poll='define' i_prot='define' i_pthread='define' i_pwd='define' i_rpcsvcdbm='' i_sfio='' i_sgtty='' i_shadow='define' i_socks='' i_stdarg='define' i_stddef='define' i_stdlib='define' i_string='define' i_sunmath='' i_sysaccess='' i_sysdir='define' i_sysfile='define' i_sysfilio='' i_sysin='' i_sysioctl='define' i_syslog='define' i_sysmman='define' i_sysmode='' i_sysmount='define' i_sysndir='' i_sysparam='define' i_sysresrc='define' i_syssecrt='' i_sysselct='' i_syssockio='' i_sysstat='define' i_sysstatfs='' i_sysstatvfs='define' i_systime='define' i_systimek='' i_systimes='define' i_systypes='define' i_sysuio='define' i_sysun='define' i_sysutsname='define' i_sysvfs='define' i_syswait='define' i_termio='' i_termios='define' i_time='' i_unistd='define' i_ustat='define' i_utime='define' i_values='define' i_varargs='' i_varhdr='stdarg.h' i_vfork='' ignore_versioned_solibs='' inc_version_list=' ' inc_version_list_init='0' incpath='' inews='' installarchlib='/opt/rsv/pd/lib/perl5/5.8.5/PA-RISC2.0' installbin='/opt/rsv/pd/bin' installhtml1dir='' installhtml3dir='' installman1dir='/opt/rsv/pd/man/man1' installman3dir='/opt/rsv/pd/man/man3' installprefix='/opt/rsv/pd' installprefixexp='/opt/rsv/pd' installprivlib='/opt/rsv/pd/lib/perl5/5.8.5' installscript='/opt/rsv/pd/bin' installsitearch='/opt/rsv/pd/lib/perl5/site_perl/5.8.5/PA-RISC2.0' installsitebin='/opt/rsv/pd/bin' installsitehtml1dir='' installsitehtml3dir='' installsitelib='/opt/rsv/pd/lib/perl5/site_perl/5.8.5' installsiteman1dir='/opt/rsv/pd/man/man1' installsiteman3dir='/opt/rsv/pd/man/man3' installsitescript='/opt/rsv/pd/bin' installstyle='lib/perl5' installusrbinperl='' installvendorarch='' installvendorbin='' installvendorhtml1dir='' installvendorhtml3dir='' installvendorlib='' installvendorman1dir='' installvendorman3dir='' installvendorscript='' intsize='4' issymlink='test -h' ivdformat='"ld"' ivsize='4' ivtype='long' known_extensions='attrs B ByteLoader Cwd Data/Dumper DB_File Devel/DProf Devel/Peek Devel/PPPort Digest/MD5 Encode Fcntl File/Glob Filter/Util/Call GDBM_File I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 NDBM_File ODBM_File Opcode PerlIO/encoding PerlIO/scalar PerlIO/via POSIX re SDBM_File Socket Storable Sys/Hostname Sys/Syslog Thread threads Time/HiRes Unicode/Normalize XS/APItest XS/Typemap threads/shared' ksh='' ld='/usr/bin/ld' lddlflags='-b' ldflags='' ldflags_uselargefiles='' ldlibpthname='LD_LIBRARY_PATH' less='less' lib_ext='.a' libc='/lib/libc.sl' libperl='libperl.a' libpth='/lib /usr/lib /usr/ccs/lib' libs='-lcl -lpthread -lnsl -lnm -lndbm -lmalloc -lm -lcrypt -lsec -lc' libsdirs=' /lib' libsfiles=' libcl.sl libpthread.sl libnsl.sl libnm.sl libndbm.sl libmalloc.a libm.sl libcrypt.a libsec.sl libc.sl' libsfound=' /lib/libcl.sl /lib/libpthread.sl /lib/libnsl.sl /lib/libnm.sl /lib/libndbm.sl /lib/libmalloc.a /lib/libm.sl /lib/libcrypt.a /lib/libsec.sl /lib/libc.sl' libspath=' /lib /usr/lib /usr/ccs/lib' libswanted='cl pthread nsl nm ndbm malloc m crypt sec c' libswanted_uselargefiles='' line='' lint='' lkflags='' ln='ln' lns='/bin/ln -s' localtime_r_proto='0' locincpth='/usr/local/include /opt/local/include /usr/gnu/include /opt/gnu/include /usr/GNU/include /opt/GNU/include' loclibpth='/usr/local/lib /opt/local/lib /usr/gnu/lib /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib' longdblsize='16' longlongsize='8' longsize='4' lp='' lpr='' ls='ls' lseeksize='8' lseektype='off_t' mail='' mailx='' make='make' make_set_make='#' mallocobj='' mallocsrc='' malloctype='void *' man1dir='/opt/rsv/pd/man/man1' man1direxp='/opt/rsv/pd/man/man1' man1ext='1' man3dir='/opt/rsv/pd/man/man3' man3direxp='/opt/rsv/pd/man/man3' man3ext='3' mips_type='' mistrustnm='' mkdir='mkdir' mmaptype='void *' modetype='mode_t' more='more' multiarch='' mv='' myarchname='9000/800-hpux' mydomain='.rsv.rsv.se' myhostname='u30090' myuname='hp-ux u30090 b.11.00 a 9000800 582000562 two-user license ' n='' need_va_copy='' netdb_hlen_type='int' netdb_host_type='const char *' netdb_name_type='const char *' netdb_net_type='int' nm='nm' nm_opt='-p' nm_so_opt='' nonxs_ext='Errno' nroff='nroff' nvEUformat='"E"' nvFUformat='"F"' nvGUformat='"G"' nv_preserves_uv_bits='32' nveformat='"e"' nvfformat='"f"' nvgformat='"g"' nvsize='8' nvtype='double' o_nonblock='O_NONBLOCK' obj_ext='.o' old_pthread_create_joinable='' optimize='-O +Onolimit' orderlib='false' osname='hpux' osvers='11.00' otherlibdirs='/opt/rsv/lib/perl' package='perl5' pager='/opt/rsv/pd/bin/less' passcat='cat /etc/passwd' patchlevel='8' path_sep=':' perl='' perl5='/opt/rsv/pd/bin/perl' perl_patchlevel='' perladmin='perl@rsv.se' perllibs='-lcl -lpthread -lnsl -lnm -lmalloc -lm -lcrypt -lsec -lc' perlpath='/opt/rsv/pd/bin/perl' pg='pg' phostname='hostname' pidtype='pid_t' plibpth='' pmake='' pr='' prefix='/opt/rsv/pd' prefixexp='/opt/rsv/pd' privlib='/opt/rsv/pd/lib/perl5/5.8.5' privlibexp='/opt/rsv/pd/lib/perl5/5.8.5' procselfexe='' prototype='define' pthread_h_first='' ptrsize='4' quadkind='3' quadtype='long long' randbits='48' randfunc='drand48' random_r_proto='0' randseedtype='long' ranlib=':' rd_nodata='-1' readdir64_r_proto='0' readdir_r_proto='0' regexec_cflags='' revision='5' rm='rm' rmail='' run='' runnm='true' sPRIEUldbl='"LE"' sPRIFUldbl='"LF"' sPRIGUldbl='"LG"' sPRIXU64='"llX"' sPRId64='"lld"' sPRIeldbl='"Le"' sPRIfldbl='"Lf"' sPRIgldbl='"Lg"' sPRIi64='"lli"' sPRIo64='"llo"' sPRIu64='"llu"' sPRIx64='"llx"' sSCNfldbl='"Lf"' sched_yield='sched_yield()' scriptdir='/opt/rsv/pd/bin' scriptdirexp='/opt/rsv/pd/bin' sed='sed' seedfunc='srand48' selectminbits='32' selecttype='fd_set *' sendmail='' setgrent_r_proto='0' sethostent_r_proto='0' setlocale_r_proto='0' setnetent_r_proto='0' setprotoent_r_proto='0' setpwent_r_proto='0' setservent_r_proto='0' sh='/bin/sh' shar='' sharpbang='#!' shmattype='void *' shortsize='2' shrpenv='' shsharp='true' sig_count='45' sig_name='ZERO HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM USR1 USR2 CHLD PWR VTALRM PROF IO WINCH STOP TSTP CONT TTIN TTOU URG LOST NUM31 DIL XCPU XFSZ CANCEL GFAULT RTMIN NUM38 NUM39 NUM40 NUM41 NUM42 NUM43 RTMAX IOT CLD POLL WINDOW ' sig_name_init='"ZERO", "HUP", "INT", "QUIT", "ILL", "TRAP", "ABRT", "EMT", "FPE", "KILL", "BUS", "SEGV", "SYS", "PIPE", "ALRM", "TERM", "USR1", "USR2", "CHLD", "PWR", "VTALRM", "PROF", "IO", "WINCH", "STOP", "TSTP", "CONT", "TTIN", "TTOU", "URG", "LOST", "NUM31", "DIL", "XCPU", "XFSZ", "CANCEL", "GFAULT", "RTMIN", "NUM38", "NUM39", "NUM40", "NUM41", "NUM42", "NUM43", "RTMAX", "IOT", "CLD", "POLL", "WINDOW", 0' sig_num='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 6 18 22 23 ' sig_num_init='0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 6, 18, 22, 23, 0' sig_size='49' signal_t='void' sitearch='/opt/rsv/pd/lib/perl5/site_perl/5.8.5/PA-RISC2.0' sitearchexp='/opt/rsv/pd/lib/perl5/site_perl/5.8.5/PA-RISC2.0' sitebin='/opt/rsv/pd/bin' sitebinexp='/opt/rsv/pd/bin' sitehtml1dir='' sitehtml1direxp='' sitehtml3dir='' sitehtml3direxp='' sitelib='/opt/rsv/pd/lib/perl5/site_perl/5.8.5' sitelib_stem='/opt/rsv/pd/lib/perl5/site_perl' sitelibexp='/opt/rsv/pd/lib/perl5/site_perl/5.8.5' siteman1dir='/opt/rsv/pd/man/man1' siteman1direxp='/opt/rsv/pd/man/man1' siteman3dir='/opt/rsv/pd/man/man3' siteman3direxp='/opt/rsv/pd/man/man3' siteprefix='/opt/rsv/pd' siteprefixexp='/opt/rsv/pd' sitescript='/opt/rsv/pd/bin' sitescriptexp='/opt/rsv/pd/bin' sizesize='4' sizetype='size_t' sleep='' smail='' so='sl' sockethdr='' socketlib='' socksizetype='int' sort='sort' spackage='Perl5' spitshell='cat' srand48_r_proto='0' srandom_r_proto='0' src='.' ssizetype='ssize_t' startperl='#!/opt/rsv/pd/bin/perl' startsh='#!/bin/sh' static_ext=' ' stdchar='char' stdio_base='((fp)->_base)' stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)' stdio_cnt='((fp)->_cnt)' stdio_filbuf='' stdio_ptr='((fp)->_ptr)' stdio_stream_array='_iob' strerror_r_proto='0' strings='/usr/include/string.h' submit='' subversion='5' sysman='/usr/share/man/man1' tail='' tar='' targetarch='' tbl='' tee='' test='test' timeincl='/usr/include/sys/time.h ' timetype='time_t' tmpnam_r_proto='0' to=':' toke_cflags='ccflags="$ccflags -DARG_ZERO_IS_SCRIPT"' touch='touch' tr='tr' trnl='\n' troff='' ttyname_r_proto='0' u16size='2' u16type='unsigned short' u32size='4' u32type='unsigned long' u64size='8' u64type='unsigned long long' u8size='1' u8type='unsigned char' uidformat='"ld"' uidsign='-1' uidsize='4' uidtype='uid_t' uname='uname' uniq='uniq' uquadtype='unsigned long long' use5005threads='' use64bitall='' use64bitint='' usecrosscompile='' usedl='define' usefaststdio='define' useithreads='' uselargefiles='define' uselongdouble='' usemallocwrap='' usemorebits='' usemultiplicity='' usemymalloc='n' usenm='true' useopcode='true' useperlio='define' useposix='true' usereentrant='' usesfio='false' useshrplib='false' usesocks='' usethreads='' usevendorprefix='' usevfork='false' usrinc='/usr/include' uuname='' uvXUformat='"lX"' uvoformat='"lo"' uvsize='4' uvtype='unsigned long' uvuformat='"lu"' uvxformat='"lx"' vendorarch='' vendorarchexp='' vendorbin='' vendorbinexp='' vendorhtml1dir=' ' vendorhtml1direxp='' vendorhtml3dir=' ' vendorhtml3direxp='' vendorlib='' vendorlib_stem='' vendorlibexp='' vendorman1dir=' ' vendorman1direxp='' vendorman3dir=' ' vendorman3direxp='' vendorprefix='' vendorprefixexp='' vendorscript='' vendorscriptexp='' version='5.8.5' version_patchlevel_string='version 8 subversion 5' versiononly='' vi='' voidflags='15' xlibpth='/usr/lib/386 /lib/386' yacc='yacc' yaccflags='' zcat='' zip='zip' ```
p5pRT commented 19 years ago

From @smpeters

[chrekh.rsv - Thu Nov 11 02​:02​:35 2004]​:

This is a bug report for perl from chrekh@​rsv.se\, generated with the help of perlbug 1.35 running under perl v5.8.5.

----------------------------------------------------------------- [Please enter your report here]

Cwd​::abs_path from Cwd 3.01 returns undef even for valid readable paths when . is not readable.

Steps to reproduce​:

1) as root\, make a test-directory readable for root only. 2) cd to that dir 3) run the following test-script with 'su user -c script'

---------------------------------------------------------- use strict; use warnings;

use Cwd qw/ &abs_path /;

print $Cwd​::VERSION\,"\n";

my $some_dir = abs_path('/var/spool');

print "$some_dir\n"; ----------------------------------------------------------

The result I get is​:

# mkdir /tmp/foo # cd /tmp/foo # chmod og-r . # ls -ld . drwx--x--x 2 root bin 96 nov 11 10​:44 ./ # ~chrekh/tmp/test.pl 3.01 /var/spool # su chrekh -c ~chrekh/tmp/test.pl 3.01 Use of uninitialized value in concatenation (.) or string at /home/u30003/chrekh/tmp/test.pl line 12.

I am able to replicate this bug with Cwd 3.11.

root@​kirk​:/tmp/foo # su steve -c perl ../foo.pl 3.11 Use of uninitialized value in concatenation (.) or string at ../foo.pl line 10.

p5pRT commented 19 years ago

The RT System itself - Status changed from 'new' to 'open'

p5pRT commented 19 years ago

@rgs - Status changed from 'open' to 'resolved'