After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 783965 - Allow running jhbuild as root
Allow running jhbuild as root
Status: RESOLVED FIXED
Product: jhbuild
Classification: Infrastructure
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Jhbuild maintainers
Jhbuild QA
Depends on:
Blocks:
 
 
Reported: 2017-06-19 14:59 UTC by Emmanuele Bassi (:ebassi)
Modified: 2017-06-27 14:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Allow running jhbuild as root (1.19 KB, patch)
2017-06-20 20:55 UTC, Emmanuele Bassi (:ebassi)
committed Details | Review
Document the JHBUILD_RUN_AS_ROOT envvar (1.43 KB, patch)
2017-06-23 15:39 UTC, Emmanuele Bassi (:ebassi)
committed Details | Review

Description Emmanuele Bassi (:ebassi) 2017-06-19 14:59:32 UTC
Running jhbuild as root immediately terminates the program, but some environments *do* need to run jhbuild as root in order to work properly — for instance, when running jhbuild inside a Docker image. You *can* run jhbuild as a non-privileged user, but then copying directories or files from outside the container will cause various permission errors.

We still don't want newcomers to run jhbuild as root, and destroy their OS installation, of course.

A simple solution would be to add an environment variable to allow running jhbuild as root, e.g. `export JHBUILD_USE_AS_ROOT=1` or, in a Dockerfile: `ENV JHBUILD_USE_AS_ROOT=1`.
Comment 1 Emmanuele Bassi (:ebassi) 2017-06-20 20:55:42 UTC
Created attachment 354126 [details] [review]
Allow running jhbuild as root

In some environments, like a Docker container, it's perfectly acceptable
to run Jhbuild as root; in some case, it's actually required in order to
work at all without hacking around the file permissions.

For this reason, we should modify the UID check performed at startup,
and if there is a specific variable in the environment, keep running
even as root.
Comment 2 Michael Catanzaro 2017-06-23 14:24:16 UTC
Can you add a note about this environment variable to the documentation somewhere, so it's not totally hidden?
Comment 3 Emmanuele Bassi (:ebassi) 2017-06-23 15:39:36 UTC
Created attachment 354319 [details] [review]
Document the JHBUILD_RUN_AS_ROOT envvar
Comment 4 Michael Catanzaro 2017-06-23 18:01:11 UTC
Review of attachment 354319 [details] [review]:

This looks like a good place to add it. Thanks.
Comment 5 Michael Catanzaro 2017-06-23 18:01:17 UTC
Review of attachment 354126 [details] [review]:

OK then
Comment 6 Emmanuele Bassi (:ebassi) 2017-06-27 14:15:23 UTC
Attachment 354126 [details] pushed as dc4e4e6 - Allow running jhbuild as root
Attachment 354319 [details] pushed as a212218 - Document the JHBUILD_RUN_AS_ROOT envvar