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

ExtUtils::Install resets umask after writing .packlist #907

Closed
p5pRT opened this issue Dec 1, 1999 · 5 comments
Closed

ExtUtils::Install resets umask after writing .packlist #907

p5pRT opened this issue Dec 1, 1999 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented Dec 1, 1999

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

Searchable as RT1842$

@p5pRT
Copy link
Author

p5pRT commented Dec 1, 1999

From goevert@amaunet.cs.uni-dortmund.de

ExtUtils​::Install​::install resets umask after writing .packlist.
The effect is that .packlist is writeable for world. Patch below.

[goevert@​gamgee] gdiff -u /app/unido-i06-src/lang/perl/5.005_62/perl5.005_62/lib/ExtUtils/Install.pm /app/unido-i06/sun4_56/lang/perl/5.005_62/lib/ExtUtils/Install.pm

Inline Patch
--- /app/unido-i06-src/lang/perl/5.005_62/perl5.005_62/lib/ExtUtils/Install.pm Sat Sep  4 22:01:50 1999
+++ /app/unido-i06/sun4_56/lang/perl/5.005_62/lib/ExtUtils/Install.pm   Wed Dec  1 18:36:55 1999
@@ -134,13 +134,13 @@
        }, ".");
        chdir($cwd) or Carp::croak("Couldn't chdir to $cwd: $!");
     }
+    umask $umask unless $Is_VMS;
     if ($pack{'write'}) {
        $dir = dirname($pack{'write'});
        mkpath($dir,0,0755);
        print "Writing $pack{'write'}\n";
        $packlist->write($pack{'write'});
     }
-    umask $umask unless $Is_VMS;
 }
 
 sub directory_not_empty ($) {
Perl Info


Site configuration information for perl 5.00562:

Configured by goevert at Tue Nov 23 17:57:00 MET 1999.

Summary of my perl5 (revision 5.0 version 5 subversion 62) configuration:
  Platform:
    osname=solaris, osvers=2.6, archname=sun4-solaris
    uname='sunos marcy 5.6 generic_105181-17 sun4u sparc sunw,ultra-1 '
    config_args='-der -Dcc=gcc -Doptimize=-O3 -Dprefix=/app/unido-i06/sun4_56/lang/perl/5.005_62 -Dloclibpth=/app/unido-inf/sun4_56/gdbm/1.7.3/lib     /app/unido-i06/sun4_56/db/db/new/lib     /app/unido-i06/sun4_56/db/wais/new/lib /app/unido-i06/sun4_56/util/zlib/new/lib -Dlocincpth=/app/unido-inf/sun4_56/gdbm/1.7.3/include /app/unido-i06/sun4_56/db/db/new/include /app/unido-i06/sun4_56/db/wais/new/lib /app/unido-i06/sun4_56/util/zlib/new/include -Darchlib=/app/unido-i06/sun4_56/lang/perl/5.005_62/lib -Dprivlib=/app/unido-i06/sun4_56/lang/perl/5.005_62/lib -Dsitelib=/app/unido-i06/sun4_56/lang/perl/5.005_62/lib/site-perl -Dsitearch=/app/unido-i06/sun4_56/lang/perl/5.005_62/lib/site-perl -Dmydomain=.cs.uni-dortmund.de -Dcf_email=goevert@ls6.cs.uni-dortmund.de -Dperladmin=goevert@ls6.cs.uni-dortmund.de'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
    use64bits=undef usemultiplicity=undef
  Compiler:
    cc='gcc', optimize='-O3', gccversion=2.95.1 19990816 (release)
    cppflags='-fno-strict-aliasing -I/app/unido-inf/sun4_56/gdbm/1.7.3/include -I/app/unido-i06/sun4_56/db/db/new/include -I/app/unido-i06/sun4_56/db/wais/new/lib -I/app/unido-i06/sun4_56/util/zlib/new/include'
    ccflags ='-fno-strict-aliasing -I/app/unido-inf/sun4_56/gdbm/1.7.3/include -I/app/unido-i06/sun4_56/db/db/new/include -I/app/unido-i06/sun4_56/db/wais/new/lib -I/app/unido-i06/sun4_56/util/zlib/new/include'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/app/unido-inf/sun4_56/gdbm/1.7.3/lib -L/app/unido-i06/sun4_56/db/db/new/lib -L/app/unido-i06/sun4_56/db/wais/new/lib -L/app/unido-i06/sun4_56/util/zlib/new/lib'
    libpth=/app/unido-inf/sun4_56/gdbm/1.7.3/lib /app/unido-i06/sun4_56/db/db/new/lib /app/unido-i06/sun4_56/db/wais/new/lib /app/unido-i06/sun4_56/util/zlib/new/lib /lib /usr/lib /usr/ccs/lib /usr/local/lib
    libs=-lsocket -lnsl -lgdbm -ldb -ldl -lm -lc -lcrypt -lsec
    libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fPIC', lddlflags='-G -L/app/unido-inf/sun4_56/gdbm/1.7.3/lib -L/app/unido-i06/sun4_56/db/db/new/lib -L/app/unido-i06/sun4_56/db/wais/new/lib -L/app/unido-i06/sun4_56/util/zlib/new/lib'

Locally applied patches:
    


@INC for perl 5.00562:
    /app/unido-inf/sun4_55/acroread/3/lib/titrax
    /app/unido-i06/sun4_56/lang/perl/5.005_62/lib
    /app/unido-i06/sun4_56/lang/perl/5.005_62/lib/site-perl
    /app/unido-i06/sun4_56/lang/perl/5.005_62/lib/site_perl
    .


Environment for perl 5.00562:
    HOME=/home-local/goevert
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH=/app/unido-inf/sun4_55/libxpm/3.4h/lib:/app/unido-i06/sun4_56/devel/omniORB/default/lib:/app/unido-inf/sun4_55/realplayer/5.0:/app/unido-inf/sun4_55/tkdesk/1.0b3/Import/lib-tcl:/app/unido-inf/sun4_55/tkdesk/1.0b3/Import/lib-tk
    LOGDIR (unset)
    PATH=/app/unido-i06/sun4_56/text/sgml/default/bin:/app/unido-inf/sun4_55/jdk/1.1.6/bin:/home-local/goevert/bin:/home-local/goevert/bin/sun4-solaris:/app/unido-i06/sun4_56/gui/xtea/1.3/bin:/app/unido-i06/sun4_56/text/gv/3.5.8/bin:/app/unido-i06/sun4_56/gui/xmultibiff/2.2/bin:/app/unido-i06/sun4_56/lang/perl/5.005_54/bin:/app/unido-i06/sun4_56/edit/emacs/20.4/bin:/app/unido-i06/sun4_56/util/fileutils/4.0/bin:/app/unido-i06/sun4_56/adm/script/1.0/bin:/app/unido-i06/sun4_56/stdenv/default/bin:/app/unido-inf/sun4_55/psutils/1.17/bin:/app/unido-inf/sun4_56/gcc/2.95.1gnu/bin:/app/unido-inf/sun4_55/gnuplot/3.7/bin:/app/unido-inf/sun4_56/acroread/4.0_990624/bin:/app/unido-inf/sun4_55/acrobat/3.0/bin:/app/unido-inf/sun4_56/cvs/1.10/bin:/app/unido-inf/sun4_55/prcs/1.2.3/bin:/app/unido-inf/sun4_55/netscape/4.6/bin:/app/unido-inf/sun4_55/aktex/1999_04_16/bin:/app/unido-inf/sun4_55/patch/2.5/bin:/app/unido-inf/sun4_56/plusenv/1999_09_01/bin:/app/unido-inf/sun4_55/tkdesk/1.0b3/bin:/usr/d!
t/bin:/usr/openwin/bin:/usr/ccs/bin:/bin:/usr/bin:/usr/sbin:/usr/openwin/demo:/opt/local/bin:.
    PERLLIB=/app/unido-inf/sun4_55/acroread/3/lib/titrax
    PERL_BADLANG (unset)
    SHELL=/opt/local/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Dec 1, 1999

From [Unknown Contact. See original ticket]

I got a better idea​: Why not simply remove all uses of umask from all
the code in any Makefiles, install scripts, etc. Why should these things
be enforcing policy I could set myself by setting the umask before I
do the install?

I know I'm constantly irritated by the need to go through the install
directory and chmod everything back the way I intended it to be because
the install scripts "helpfully" fixed my umask for me.
--
Tom.Horsley@​mail.ccur.com \\\\ Will no one rid me of
Concurrent Computers, Ft. Lauderdale, FL \\\\ this troublesome
Me​: http​://home.att.net/~Tom.Horsley/ \\\\ autoconf?
Project Vote Smart​: http​://www.vote-smart.org \\\\ !!!!!

@p5pRT
Copy link
Author

p5pRT commented Dec 1, 1999

From @doughera88

On Wed, 1 Dec 1999, Tom Horsley wrote​:

I got a better idea​: Why not simply remove all uses of umask from all
the code in any Makefiles, install scripts, etc. Why should these things
be enforcing policy I could set myself by setting the umask before I
do the install?

I'd tend to agree with that. There are undoubtedly some cases where
chmod is required (HP/UX shared libraries need the +x bits set, for
example), but most of the time, I have my umask set how I want it.

Specific counter-examples welcome.

  Andy Dougherty doughera@​lafayette.edu
  Dept. of Physics
  Lafayette College, Easton PA 18042

@p5pRT
Copy link
Author

p5pRT commented Dec 1, 1999

From [Unknown Contact. See original ticket]

Andy Dougherty <doughera@​lafayette.edu> writes​:

On Wed, 1 Dec 1999, Tom Horsley wrote​:

I got a better idea​: Why not simply remove all uses of umask from all
the code in any Makefiles, install scripts, etc. Why should these things
be enforcing policy I could set myself by setting the umask before I
do the install?

I'd tend to agree with that. There are undoubtedly some cases where
chmod is required (HP/UX shared libraries need the +x bits set, for
example), but most of the time, I have my umask set how I want it.

Specific counter-examples welcome.

I seem to remember from a long time ago that there were a lot of clueless
installers, and we got a stream of complaints that permissions were wrong.
Those of us that know what we are doing can easily enough fix it up afterwards.

That said I see no reason why Configure could not ask​:

"Should I honour your umask (currently 060) during installs?"

--
Nick Ing-Simmons

@p5pRT
Copy link
Author

p5pRT commented Dec 4, 1999

From @gsar

On Wed, 01 Dec 1999 20​:58​:02 GMT, Nick Ing-Simmons wrote​:

Andy Dougherty <doughera@​lafayette.edu> writes​:

On Wed, 1 Dec 1999, Tom Horsley wrote​:

I got a better idea​: Why not simply remove all uses of umask from all
the code in any Makefiles, install scripts, etc. Why should these things
be enforcing policy I could set myself by setting the umask before I
do the install?

I'd tend to agree with that. There are undoubtedly some cases where
chmod is required (HP/UX shared libraries need the +x bits set, for
example), but most of the time, I have my umask set how I want it.

Specific counter-examples welcome.

I seem to remember from a long time ago that there were a lot of clueless
installers, and we got a stream of complaints that permissions were wrong.
Those of us that know what we are doing can easily enough fix it up afterwards
.

That said I see no reason why Configure could not ask​:

"Should I honour your umask (currently 060) during installs?"

Here's what I've done about this.

I'd agree that users should get a warning on suspect umask values,
but heavy-handedly forcing the umask to a particular value doesn't
seem quite the right approach to me. A patch that adds warnings
in appropriate places (probably just the Makefiles) would be welcome.

Sarathy
gsar@​ActiveState.com

Inline Patch
-----------------------------------8<-----------------------------------
Change 4632 by gsar@auger on 1999/12/03 07:42:23

	don't mess with the umask()

Affected files ...

... //depot/perl/installhtml#13 edit
... //depot/perl/installman#15 edit
... //depot/perl/installperl#45 edit
... //depot/perl/lib/ExtUtils/Install.pm#17 edit
... //depot/perl/lib/ExtUtils/Manifest.pm#10 edit

Differences ...

==== //depot/perl/installhtml#13 (xtext) ====
Index: perl/installhtml
--- perl/installhtml.~1~	Thu Dec  2 23:42:26 1999
+++ perl/installhtml	Thu Dec  2 23:42:26 1999
@@ -9,8 +9,6 @@
 use Cwd;
 use Pod::Html;
 
-umask 022;
-
 =head1 NAME
 
 installhtml - converts a collection of POD pages to HTML format.

==== //depot/perl/installman#15 (xtext) ====
Index: perl/installman
--- perl/installman.~1~	Thu Dec  2 23:42:26 1999
+++ perl/installman	Thu Dec  2 23:42:26 1999
@@ -10,7 +10,6 @@
 use vars qw($packlist);
 require Cwd;
 
-umask 022;
 $ENV{SHELL} = 'sh' if $^O eq 'os2';
 
 $ver = $];

==== //depot/perl/installperl#45 (xtext) ====
Index: perl/installperl
--- perl/installperl.~1~	Thu Dec  2 23:42:26 1999
+++ perl/installperl	Thu Dec  2 23:42:26 1999
@@ -54,8 +54,6 @@
     shift;
 }
 
-umask 022 unless $Is_VMS;
-
 my @scripts = qw(utils/c2ph utils/h2ph utils/h2xs utils/perlbug utils/perldoc
 		utils/pl2pm utils/splain utils/perlcc utils/dprofpp
 		x2p/s2p x2p/find2perl 

==== //depot/perl/lib/ExtUtils/Install.pm#17 (text) ====
Index: perl/lib/ExtUtils/Install.pm
--- perl/lib/ExtUtils/Install.pm.~1~	Thu Dec  2 23:42:26 1999
+++ perl/lib/ExtUtils/Install.pm	Thu Dec  2 23:42:26 1999
@@ -67,7 +67,6 @@
     }
     $packlist->read($pack{"read"}) if (-f $pack{"read"});
     my $cwd = cwd();
-    my $umask = umask 0 unless $Is_VMS;
 
     my($source);
     MOD_INSTALL: foreach $source (sort keys %hash) {
@@ -140,7 +139,6 @@
 	print "Writing $pack{'write'}\n";
 	$packlist->write($pack{'write'});
     }
-    umask $umask unless $Is_VMS;
 }
 
 sub directory_not_empty ($) {
@@ -259,7 +257,6 @@
       close(FROMTO);
      }
 
-    my $umask = umask 0022 unless $Is_VMS;
     mkpath($autodir,0,0755);
     foreach (keys %$fromto) {
 	next if -f $fromto->{$_} && -M $fromto->{$_} < -M $_;
@@ -280,7 +277,6 @@
 	next unless /\.pm$/;
 	autosplit($fromto->{$_},$autodir);
     }
-    umask $umask unless $Is_VMS;
 }
 
 package ExtUtils::Install::Warn;

==== //depot/perl/lib/ExtUtils/Manifest.pm#10 (text) ====
Index: perl/lib/ExtUtils/Manifest.pm
--- perl/lib/ExtUtils/Manifest.pm.~1~	Thu Dec  2 23:42:26 1999
+++ perl/lib/ExtUtils/Manifest.pm	Thu Dec  2 23:42:26 1999
@@ -187,7 +187,6 @@
     require File::Basename;
     my(%dirs,$file);
     $target = VMS::Filespec::unixify($target) if $Is_VMS;
-    umask 0 unless $Is_VMS;
     File::Path::mkpath([ $target ],1,$Is_VMS ? undef : 0755);
     foreach $file (keys %$read){
 	$file = VMS::Filespec::unixify($file) if $Is_VMS;
End of Patch.

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

1 participant