Bug #7591
closed[Deployment] httplib2 backport package includes files with 0640 perms on trusty, jessie
Description
Bug¶
On Ubuntu 14.04 and Debian 8, the .deb that fpm generates for httplib2 includes files that have 0640 permissions. This is true regardless of umask, and you can reproduce it without using any of our build code:
brinstar % docker run --rm -ti arvados/build:ubuntu1404 /bin/bash root@ed6e37a48ab0:/# . /etc/profile.d/rvm.sh root@ed6e37a48ab0:/# cd tmp root@ed6e37a48ab0:/tmp# fpm -s python -t deb httplib2 Debian packaging tools generally labels all files in /etc as config files, as mandated by policy, so fpm defaults to this behavior for deb packages. You can disable this default behavior with --deb-no-default-config-files flag {:level=>:warn} Created package {:path=>"python-httplib2_0.9.2_all.deb"} root@ed6e37a48ab0:/tmp# dpkg-deb -c python-httplib2_0.9.2_all.deb drwx------ 0/0 0 2015-10-16 14:58 ./ drwxr-xr-x 0/0 0 2015-10-16 14:58 ./usr/ drwxr-xr-x 0/0 0 2015-10-16 14:58 ./usr/local/ drwxr-xr-x 0/0 0 2015-10-16 14:58 ./usr/local/lib/ drwxr-xr-x 0/0 0 2015-10-16 14:58 ./usr/local/lib/python2.7/ drwxr-xr-x 0/0 0 2015-10-16 14:58 ./usr/local/lib/python2.7/dist-packages/ drwxr-xr-x 0/0 0 2015-10-16 14:58 ./usr/local/lib/python2.7/dist-packages/httplib2-0.9.2.egg-info/ -rw-r----- 0/0 1 2015-10-16 14:58 ./usr/local/lib/python2.7/dist-packages/httplib2-0.9.2.egg-info/dependency_links.txt -rw-r----- 0/0 9 2015-10-16 14:58 ./usr/local/lib/python2.7/dist-packages/httplib2-0.9.2.egg-info/top_level.txt -rw-r----- 0/0 2272 2015-10-16 14:58 ./usr/local/lib/python2.7/dist-packages/httplib2-0.9.2.egg-info/PKG-INFO -rw-r----- 0/0 790 2015-10-16 14:58 ./usr/local/lib/python2.7/dist-packages/httplib2-0.9.2.egg-info/SOURCES.txt drwxr-xr-x 0/0 0 2015-10-16 14:58 ./usr/local/lib/python2.7/dist-packages/httplib2/ -rw-r----- 0/0 134862 2015-10-16 14:58 ./usr/local/lib/python2.7/dist-packages/httplib2/cacerts.txt -rw-r--r-- 0/0 17255 2015-10-16 14:58 ./usr/local/lib/python2.7/dist-packages/httplib2/socks.pyc -rw-r--r-- 0/0 71120 2015-10-16 14:58 ./usr/local/lib/python2.7/dist-packages/httplib2/__init__.py -rw-r--r-- 0/0 18459 2015-10-16 14:58 ./usr/local/lib/python2.7/dist-packages/httplib2/socks.py -rw-r--r-- 0/0 3822 2015-10-16 14:58 ./usr/local/lib/python2.7/dist-packages/httplib2/iri2uri.pyc -rw-r--r-- 0/0 58381 2015-10-16 14:58 ./usr/local/lib/python2.7/dist-packages/httplib2/__init__.pyc -rw-r--r-- 0/0 3828 2015-10-16 14:58 ./usr/local/lib/python2.7/dist-packages/httplib2/iri2uri.py drwxr-xr-x 0/0 0 2015-10-16 14:58 ./usr/share/ drwxr-xr-x 0/0 0 2015-10-16 14:58 ./usr/share/doc/ drwxr-xr-x 0/0 0 2015-10-16 14:58 ./usr/share/doc/python-httplib2/ -rw-r--r-- 0/0 142 2015-10-16 14:58 ./usr/share/doc/python-httplib2/changelog.Debian.gz root@ed6e37a48ab0:/tmp# umask 0022
The fact that cacerts.txt and the .egg-info files aren't world-readable is a problem. It means that wherever this package is installed, non-root users can't use httplib2 (read: the Python Arvados API client).
If you build the package with umask 077, all the other files respect that (they have no permissions for group or world), but cacerts.txt and the .egg-info files are still 0640 exactly. Their permissions are being set explicitly.
These files have correct permissions on Ubuntu 12.04 and Debian 7.
Fix¶
- Add pip to all of the arvados/build packages.
- Teach run-build-packages to download httplib2 from pip (with install --download), make the permissions change on the fly, then build the .deb/.rpm from the downloaded+fixed source.
Updated by Brett Smith about 9 years ago
- Subject changed from [Deployment] httplib2 backport package includes files with 0640 perms to [Deployment] httplib2 backport package includes files with 0640 perms on trusty, jessie
- Description updated (diff)
Updated by Tom Clegg about 9 years ago
It looks like this is an httplib2 bug. The FreeBSD ports collection added a workaround for it 2 years ago:
http://svnweb.freebsd.org/ports/head/www/py-httplib2/Makefile?r1=332074&r2=332073&pathrev=332074
Updated by Brett Smith about 9 years ago
Updated by Brett Smith about 9 years ago
- Story points set to 0.5
Implementation:
- Add pip to all of the arvados/build packages.
- Teach run-build-packages to download httplib2 from pip (with install --download), make the permissions change on the fly, then build the .deb/.rpm from the downloaded+fixed source.
Updated by Brett Smith about 9 years ago
- Description updated (diff)
- Assigned To set to Brett Smith
- Target version changed from Arvados Future Sprints to 2015-11-11 sprint
Updated by Brett Smith about 9 years ago
7591-httplib2-perms-fix-wip is up for review. Note that it uses a subshell to make a lot of temporary changes to the shell state (-e option, current working directory). No matter how the subshell ends up exiting, none of that will change the state of the main shell.
Adding pip to the Docker image wasn't necessary because it's already there.
If this looks good to you, Nico, feel free to rebase/merge/push it yourself, since I might be scarce the next few days.
Updated by Nico César about 9 years ago
check a5bf97676451900886f6dda7521ca7db27cdd452
LGTM ...
per Brett I'll merge this, update ci.curoverse.com and run a the jenkins job
Updated by Nico César about 9 years ago
https://ci.curoverse.com/job/build-packages/1550/console has the new version.
if it runs successfully this ticket can be closed
Updated by Nico César about 9 years ago
- Status changed from In Progress to Resolved