sudo with application that uses launchpadlib creates ~/.launchpadlib with root owner
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
launchpadlib |
In Progress
|
Undecided
|
Dan Streetman |
Bug Description
[impact]
and application that uses launchpadlib to login to LP, and is run as root (with sudo), will cause launchpadlib to also be run as root. It will then create the $HOME/.launchpadlib directory and cache files with root ownership, but in the non-root user's $HOME directory, since sudo does not do a full login and change the env.
The root-owned ~/.launchpadlib and/or root-owned files under that directory will then cause later failures with other applications that also use launchpadlib, but are not run as root, since launchpadlib will try to update the files, but can't since it is not root.
[test case]
ubuntu@test:~$ ls -lad .launchpadlib
ls: cannot access '.launchpadlib': No such file or directory
ubuntu@test:~$ sudo python3
Python 3.7.3 (default, Apr 3 2019, 05:39:12)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from launchpadlib.
>>> lp = Launchpad.
The authorization page:
(https:/
should be opening in your browser. Use your browser to authorize
this program to access Launchpad on your behalf.
Waiting to hear from Launchpad about your decision...
>>>
ubuntu@test:~$ ls -lad .launchpadlib
drwx------ 3 root root 4096 May 8 10:13 .launchpadlib
[regression potential]
TBD
[other info]
I am updating software-properties to use launchpadlib in bug 645404, and the primary use case there is the 'add-apt-
NOTE: I think this would be better fixed by bug 1556302, so depending on that bug, this could be marked as a duplicate (if it's fixed). If that bug is not fixed, this very likely will need some workaround, if/when add-apt-repository is updated to use launchpadlib, since add-apt-repository is always run as root.
Changed in launchpadlib: | |
assignee: | nobody → Dan Streetman (ddstreet) |
status: | New → In Progress |
description: | updated |