Bug 1780126

Summary: MakeMaker installs files with permission 0444
Product: Red Hat Enterprise Linux 8 Reporter: Andreas Schneider <asn>
Component: perl-ExtUtils-InstallAssignee: perl-maint-list
Status: CLOSED WONTFIX QA Contact: RHEL CS Apps Subsystem QE <rhel-cs-apps-subsystem-qe>
Severity: unspecified Docs Contact:
Priority: high    
Version: 8.2CC: asn, ppisar
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-06-05 07:30:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Andreas Schneider 2019-12-05 13:16:23 UTC
Description of problem:

The samba package contains a perl tool called pidl. To install it, a Makefile.PL is provided which uses MakeMaker.

When I call 'make install', files are installed with permission 0444 instead of 0644.

I don't see a way that I can influence this.

Comment 1 Andreas Schneider 2019-12-05 13:32:08 UTC
Actually it seems to be already the 'make' command which copies .pm files to blib/ directory.

Comment 2 Andreas Schneider 2019-12-05 13:57:35 UTC
Both, when copying the files to blib dir and on installing, it does a chmod 0444 according to strace.

Comment 3 Andreas Schneider 2019-12-05 14:02:03 UTC
Reproducer:

Get the Samba package and unzip the tarball:

cd pidl
perl Makefile.PL
make
make DESTDIR=/tmp/wurst install_vendor

Comment 4 Petr Pisar 2019-12-05 14:23:19 UTC
ExtUtils::Install (called by ExtUtils::MakeMaker) follows permissions of the source. From the manual:

        Copies each directory tree of %from_to to its corresponding value preserving
        timestamps and permissions.

If you have a source file without a write permission, the installed file will be stripped from that permission either. I guess that's your case. Although upstream has reported some inconsistencies in the behavior.

Could you tell me what exact samba source archive do you use?

Comment 5 Petr Pisar 2019-12-05 15:05:56 UTC
Ok. I can reproduce it:

$ ls -lR
.:
total 0
drwxrwxr-x. 2 test test 60 Dec  5 15:51 script

./script:
total 0
-rwxr-xr-x. 1 test test 0 Dec  5 15:51 pidl
$ perl -MExtUtils::Install -e 'install([ from_to => { q{script} => q{/tmp/b} } ])'
Installing /tmp/b/pidl
$ ls -l /tmp/b/pidl 
-r-xr-xr-x. 1 test test 0 Dec  5 15:51 /tmp/b/pidl

Comment 6 Andreas Schneider 2019-12-05 15:47:58 UTC
Thanks, I've worked around the bug by specifying %attr for each file in the spec file.

Comment 7 Petr Pisar 2019-12-06 09:22:32 UTC
ExtUtils::Install documentation does not match the behavior. The current behavior is asserted by ExtUtils::Install tests. It's quite possible the current behavior is desired. I raised a question to the upstream together with a patch that changes the behavior. Let's wait some time for upstream's opinion.

Comment 8 Andreas Schneider 2019-12-06 09:36:50 UTC
If the current behavior is desired, then there needs to be a option to change that.

Comment 11 RHEL Program Management 2021-06-05 07:30:30 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.