miyagawa/cpanminus — pull request #136 by mstap (2011-12-02 19:48:41+00:00)
Title: Set umask to 022 to make --sudo work on NFS homes

When ~ is on an NFS export with root squashing, using sudo will be equivalent
to running as the user 'nobody'. If the umask is 027 when starting cpanm, the
created ~/.cpanm (and subdirectories) will not have the 'r' and 'x' bits set
for 'other'. When cpanm tries to use sudo make install, this will fail with the
error message 'Permission denied'.

Since the directory normally is o+rx (when umask is 022), this change does not
introduce new security problems. It just ensures the environment is as we
expect it :).