Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perltest lib/file/copy not correct; #13724

Open
p5pRT opened this issue Apr 9, 2014 · 7 comments
Open

perltest lib/file/copy not correct; #13724

p5pRT opened this issue Apr 9, 2014 · 7 comments

Comments

@p5pRT
Copy link

p5pRT commented Apr 9, 2014

Migrated from rt.perl.org#121612 (status was 'open')

Searchable as RT121612$

@p5pRT
Copy link
Author

p5pRT commented Apr 9, 2014

From perl-diddler@tlinx.org

Created by perl-diddler@tlinx.org

--- in runing the perl tests, ran into this​:

lib/File/Copy ................................................. # Failed test 'Permission bits set correctly'
# at ../lib/File/Copy.t line 359.
# got​: 'rw-rw-r--'
# expected​: 'rw-rw-rw-'
FAILED at test 73
---

The test doesn't take into account default the default
permission ACL on the parent directory

I'm not sure where the parent directory is, but the parent directory
of all the perl source trees has a default acl on it -- which
would get propagated to all subdirs by default unless disabled.

A similar bug that I suggested an easy fix for is described
here​:

https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6994

Perl Info

Flags:
    category=core
    severity=medium

Site configuration information for perl 5.16.3:

Configured by law at Wed Jan 22 12:58:58 PST 2014.

Summary of my perl5 (revision 5 version 16 subversion 3) configuration:
   
  Platform:
    osname=linux, osvers=3.12.0-isht-van, archname=x86_64-linux-thread-multi-ld
    uname='linux ishtar 3.12.0-isht-van #1 smp preempt wed nov 13 16:50:51 pst 2013 x86_64 x86_64 x86_64 gnulinux '
    config_args=''
    hint=previous, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=define
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-g -O2',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
    ccversion='', gccversion='4.8.1 20130909 [gcc-4_8-branch revision 202388]', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='long double', nvsize=16, Off_t='off_t', lseeksize=8
    alignbytes=16, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags ='-g -fstack-protector -fPIC'
    libpth=/usr/lib64 /lib64
    libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
    libc=/lib/libc-2.18.so, so=so, useshrplib=true, libperl=libperl-5.16.3.so
    gnulibc_version='2.18'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/home/perl/perl-5.16.3/lib/x86_64-linux-thread-multi-ld/CORE'
    cccdlflags='-fPIC', lddlflags='-shared -g -O2 -fstack-protector -fPIC'

Locally applied patches:
    


@INC for perl 5.16.3:
    /home/law/bin/lib
    /home/perl/perl-5.16.3/lib/site/x86_64-linux-thread-multi-ld
    /home/perl/perl-5.16.3/lib/site
    /home/perl/perl-5.16.3/lib/x86_64-linux-thread-multi-ld
    /home/perl/perl-5.16.3/lib
    .


Environment for perl 5.16.3:
    HOME=/home/law
    LANG=en_US.utf8
    LANGUAGE (unset)
    LC_COLLATE=C
    LC_CTYPE=en_US.utf8
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/law/bin/lib:/sbin:/home/law/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:.:/usr/lib/qt3/bin:/opt/dell/srvadmin/bin:/usr/sbin:/etc/local/func_lib:/home/law/lib
    PERL5OPT=-Mutf8 -CSA -I/home/law/bin/lib
    PERL_BADLANG (unset)
    SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Apr 10, 2014

From @tonycoz

On Wed Apr 09 06​:15​:07 2014, LAWalsh wrote​:

--- in runing the perl tests, ran into this​:

lib/File/Copy ................................................. #
Failed test 'Permission bits set correctly'
# at ../lib/File/Copy.t line 359.
# got​: 'rw-rw-r--'
# expected​: 'rw-rw-rw-'
FAILED at test 73
---

The test doesn't take into account default the default
permission ACL on the parent directory

I'm not sure where the parent directory is, but the parent directory
of all the perl source trees has a default acl on it -- which
would get propagated to all subdirs by default unless disabled.

A similar bug that I suggested an easy fix for is described
here​:

https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6994

That fix would need to be limited to Linux and FreeBSD.

I checked the following​:

Darwin (12.5.0) - no chacl or setfacl, a google turned up setfacl but that doesn't appear to be present. The system does however support ACLs.

Solaris (5.11) - setfacl exists but doesn't support a -b switch

FreeBSD (9.1) - setfacl is present and supports -b

Cygwin (1.7.28(0.271/5/3)) - setfacl exists but doesn't support -b.

OpenBSD (5.4) - no chacl or setfacl.

Windows (7.0) - no chacl or setfacl (does have cacls and icacls)

Tony

@p5pRT
Copy link
Author

p5pRT commented Apr 10, 2014

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

@p5pRT
Copy link
Author

p5pRT commented Apr 10, 2014

From perl@profvince.com

That fix would need to be limited to Linux and FreeBSD.

I checked the following​:

Darwin (12.5.0) - no chacl or setfacl, a google turned up setfacl but that doesn't appear to be present. The system does however support ACLs.

On darwin 13.1.0 (Mac OS X 10.9.2), it looks like ACLs can be
read/written with chmod.

Vincent

@p5pRT
Copy link
Author

p5pRT commented Apr 10, 2014

From perl-diddler@tlinx.org

On Wed Apr 09 18​:42​:29 2014, tonyc wrote​:

That fix would need to be limited to Linux and FreeBSD.


  That's better than no patch. I don't have experience or
access to the other systems -- I can only write for what I
have.

  I would suspect that you don't do the same file
test on the other system.

  Specifically, the other systems copy routines (windows,
and darwin at least) copy the complete file -- Acl's, extended-addrs
and such.

  only the *nix tests don't copy the entire file.

  I have filed a bug against the linux version of File​::Copy
for not copying extended attr's and ACL's, but was told
that level of compatibility wasn't needed (ref​: Ricardo,
#116451 -- go read for exact wording). So I guess I'm
a bit curious as to why you'd even raise the issue.

  As I stated in the SA bug, if those utils fail, then
the worst case is that you get the same behavior as today,
but on linux and freeBSD, at least the test will do the
right thing.

@p5pRT
Copy link
Author

p5pRT commented Apr 10, 2014

From @Tux

On Wed, 9 Apr 2014 18​:42​:29 -0700, "Tony Cook via RT"
<perlbug-followup@​perl.org> wrote​:

On Wed Apr 09 06​:15​:07 2014, LAWalsh wrote​:

--- in runing the perl tests, ran into this​:

lib/File/Copy ................................................. #
Failed test 'Permission bits set correctly'
# at ../lib/File/Copy.t line 359.
# got​: 'rw-rw-r--'
# expected​: 'rw-rw-rw-'
FAILED at test 73
---

The test doesn't take into account default the default
permission ACL on the parent directory

I'm not sure where the parent directory is, but the parent directory
of all the perl source trees has a default acl on it -- which
would get propagated to all subdirs by default unless disabled.

A similar bug that I suggested an easy fix for is described
here​:

https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6994

That fix would need to be limited to Linux and FreeBSD.

I checked the following​:

Darwin (12.5.0) - no chacl or setfacl, a google turned up setfacl but that doesn't appear to be present. The system does however support ACLs.

Solaris (5.11) - setfacl exists but doesn't support a -b switch

FreeBSD (9.1) - setfacl is present and supports -b

Cygwin (1.7.28(0.271/5/3)) - setfacl exists but doesn't support -b.

OpenBSD (5.4) - no chacl or setfacl.

Windows (7.0) - no chacl or setfacl (does have cacls and icacls)

You *do* have an HP-UX account :)

--
H.Merijn Brand http​://tux.nl Perl Monger http​://amsterdam.pm.org/
using perl5.00307 .. 5.19 porting perl5 on HP-UX, AIX, and openSUSE
http​://mirrors.develooper.com/hpux/ http​://www.test-smoke.org/
http​://qa.perl.org http​://www.goldmark.org/jeff/stupid-disclaimers/

@p5pRT
Copy link
Author

p5pRT commented Oct 8, 2017

From perl-diddler@tlinx.org

FWIW, in a "meta" type way, this could be thought of as related to​:

#116451​: File​::Copy​::syscopy doesn't preserve attrs as intended on Linux

Meaning, that if 116451 was fixed by using code from coreutils "cp" program, it would *probably* (can't say with 100% certainty) fix this bug as well.

In this bug, a directory-default ACL is overriding local file permissions. In 116451, the file-copy for linux is least likely correctly copy the file's meta information (apparently other implementations use the equivalent of 'cp'...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants