[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"sudo make install" permissions and umask

From: Antoine Amarilli
Subject: "sudo make install" permissions and umask
Date: Tue, 22 Jan 2019 18:50:57 +0100
User-agent: NeoMutt/20180716

Hi everyone,

I've been bitten several times by something that happens to be an old
discussion about the behavior of autotools. The issue is that, when
doing "sudo make install", files are installed with "install -m 755"
which ensures that they are world-readable, but directories are created
with "mkdir -p" which defines their permission according to the user
umask. For users like me with a umask of 077, this means that "sudo make
install" will silently install files that can only be read by root. This
is super annoying because the problem only manifests itself later and is
sometimes quite troublesome to debug.

This issue has been discussed previously
<> -- as far as I can
tell, this old discussion was closed because it was Cc'd to coreutils
about a side question about changing the behavior of "mkdir -p", which
was determined not to be fixable when following the POSIX spec. This
also appears to have closed the autotools discussion, but as far as I
can tell the underlying issue with autotools is still open and the
comment about POSIX didn't apply there.

So, summarizing the old discussion, it seemed that most people thought
the behavior should be fixed at the level of autotools, by making sure
that created directories are readable -- a patch had even been proposed
The only downside of this change seemed to be for the rare cases where
users relied on autotools following the user umask on *directories*,
e.g., to ensure that they had a permission of 777; noting again that for
*files* autotools does not have this behavior.

So after running into this problem with three unrelated codebases I
thought I'd revive the issue here. Wouldn't it be better to make
autotools consistent in how it handles permissions on files and
directories, and avoid installing world-unreadable files no matter the
user's umask?

Best regards,

Antoine Amarilli

Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]