develooper Front page | perl.perl5.porters | Postings from November 2003

[perl #24521] make test breaks permissions on /dev/tty

Thread Next
November 18, 2003 19:56
[perl #24521] make test breaks permissions on /dev/tty
Message ID:
# New Ticket Created by 
# Please include the string:  [perl #24521]
# in the subject line of all future correspondence about this issue. 
# <URL: >

This is a bug report for perl from,
generated with the help of perlbug 1.34 running under perl v5.8.2.

[Please enter your report here]

When running "make test" from the perl source tree, the permissions
of /dev/tty get changed from 0666 to 2775.  This obviously breaks
a unix system pretty badly.

I've traced the problem to one of the tests performed in

The specific test that is breaking things is Perl_nextargv.

When this program gets called with a file redirected into it
(the Makefile runs "./perl TEST </dev/tty", and I think the
/dev/tty is passed through the testing procedure), it changes
that file's permissions from 0666 to 2775 (if run as root) or to
2755 (if run as a user).

I'm a complete novice, so hopefully this is enough for you to
understand the problem.  If not, maybe this code segment (taken
from the doio test procedure) will be easier to understand:

$^W = 0 ;
my $filename = "./temp.dir" ;
mkdir $filename, 0777
  or die "Cannot create directory $filename: $!\n" ;
system("chmod 666 blah");
print("permissions reset to:\n");
system("ls -l blah");
    local (@ARGV) = ($filename) ;
    local ($^I) = "" ;
    my $x = <> ;
system("ls -l blah");
system("chmod 666 blah");
print("permissions reset to:\n");
system("ls -l blah");
    local (@ARGV) = ($filename) ;
    local ($^I) = "" ;
    my $x = <> ;
system("ls -l blah");
rmdir $filename ;

Save that as and do:
$ touch blah
$ ./ <blah

It will hopefully then be evident what the problem is.

We have seen this on three machines (RH7.3 and RH9).  I've also
confirmed that this test program changes permissions with perl-5.6.1
under IRIX 6.5.21m.  So perhaps the program is working as intended,
and it's just the "make test" script that's broken?

I'm marking it critical since it has the potential to break a Unix
machine in a very bad (and hard to track down!) way.

Damian Menscher
-=#| Physics Grad Student & SysAdmin @ U Illinois Urbana-Champaign |#=-
-=#| 488 LLP, 1110 W. Green St, Urbana, IL 61801 Ofc:(217)333-0038 |#=-
-=#| 4602 Beckman, VMIL/MS, Imaging Technology Group:(217)244-3074 |#=-
-=#| <> Fax:(217)333-9819 |#=-

[Please do not change anything below this line]
Site configuration information for perl v5.8.2:

Configured by weber at Mon Nov 17 17:52:19 CST 2003.

Summary of my perl5 (revision 5.0 version 8 subversion 2) configuration:
    osname=linux, osvers=2.4.20-20.7smp, archname=i686-linux-thread-multi
    uname='linux 2.4.20-20.7smp #1 smp mon aug 18 14:46:14 edt 2003 i686 unknown '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
    cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -I/usr/local/include -I/usr/include/gdbm'
    ccversion='', gccversion='2.96 20000731 (Red Hat Linux 7.3 2.96-113)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -lgdbm -ldl -lm -lcrypt -lutil -lpthread -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
    libc=/lib/, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:

@INC for perl v5.8.2:

Environment for perl v5.8.2:
    LANGUAGE (unset)
    LOGDIR (unset)
    PERL_BADLANG (unset)

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About