Closed Deuchnord closed 4 years ago
I generally use virtualenv to install packages, so I'm not familiar with everything that can go wrong when installing system-wide as root — was pip
the tool you used? If so, how did you invoke it? For the root user, what is the output of umask
? If you have the root account's umask set to something like 027
, then I have seen permission bits missing on installed files and binaries.
was
pip
the tool you used?
Yes, I'm using pip
version 19.3.
If so, how did you invoke it?
Since it's a dependency of my program, Skyfield is installed when I invoke this:
$ sudo pip install kosmorro
which makes it install Skyfield, just like I ran sudo pip install skyfield
.
Trying to install it user-wide instead (without sudo
and with the --user
argument) seems to work, though.
For the root user, what is the output of
umask
?
# umask
0022
Thanks for the additional info. If you look at the other packages installed, do you find data files that normal users cannot read? Or was Skyfield the only package that had some files unreadable?
I'm actually wondering if there's actually any sense to install a software/library on a system but not having access to its files as a regular user? I mean, the only situation when this happens is usually for security purpose, like storing SSH/GPG private keys… if a file does not contain anything that should be only accessible to someone having the super-administrator access to the system, I don't see any reason for it being inaccessible to regular users 😕
Welp. It's a bug in distutils!
https://github.com/kjd/idna/issues/66#issuecomment-398007302
Apparently the fact that I don't have public permissions set on my personal computer (because I use the same dotfiles on Linux machines that have other users besides me) means that everyone installing the wheel gets my private permission decisions imposed on them.
I wonder how I can fix this systematically, for all the Python packages I distribute? I assume that, for example, jplephem also — oh, but maybe it for some reason only happens to data files? Anyway, I'll probably switch to a more generous umask but then have a way to keep my home directory with a permission of o-x
so that no one can get it to my files to begin with.
Feels fragile, but otherwise I'd somehow have to either hijack every setup.py
file I run to change the umask, or else remember to always run a special script before doing distributions. I suspect that would be more prone to error.
Let's leave this open until I release Skyfield again (hopefully later this week), at which point we can verify whether the permissions issues are fixed.
Quite weird, but the issue completely disappeared on my computer tonight, so everything seems to work again without any other action than reinstalling Skyfield.
Computer science :man_shrugging:
I'm glad it's working again! I'm going to close this for now, but feel free to re-open if the problem reappears, or if you notice what made the difference between a working and not-working installation.
On a fresh install of the Skyfield library, the import the
timelib
module fails with the following stack trace:I checked the files in the
/usr/lib/python3.8/site-packages/skyfield-1.16-py3.8.egg/skyfield/data/nutation.npz
and found out that most of them (but not all) are missing the read permission, making it impossible to read them unless running as root:As a temporary fix, the missing permission to the others group can be added:
Running Python 3.8.1 on Arch Linux. The same issue happens whenever I install Skyfield through PyPI or the AUR.