pmbootstrap requires root sudo
It would be good to avoid requiring sudo
, as exposed in #2051 (closed), But, most importantly, I think we can get away without root at all. Requiring root is bad style as it can lead to fairly easy privilege escalations, can lower the user experience a bit (there is this icky sudo timer thing that tries to work around some of that). And root password prompt will from time to time scare newcomers. I've seen some say something like "That new thing I cloned needs root??" and one refused to run it without putting it in docker, where it couldn't work.
Places that use sudo (grep finds other places, but ):
-
helpers/envkernel.sh
(a shell script, can probably be worked around with theSUDO=${SUDO:=sudo}
trick) pmb/helpers/run.py
-
pmb/chroot/root.py
(contains the command to run something in the chroot as root) -
pmb/helpers/run_core.py
(uses sudo to kill processes. but if we never start processes as root, I guess we don't need that, and also contains that sudo timer thing) -
pmb/sideload/__init__.py
(for sideload, this may be the only needed use of root)
I think it would be quite possible not to depend on root at all for the chroot creation. I think unshare
or bwrap
could be a good way to do that.
Maybe I'll find time to work on that this summer. In the worst case the issue has been created.