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 727799 - Fix su/sudo execution detection
Fix su/sudo execution detection
Status: RESOLVED FIXED
Product: gnome-terminal
Classification: Core
Component: general
unspecified
Other FreeBSD
: Normal normal
: ---
Assigned To: GNOME Terminal Maintainers
GNOME Terminal Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-04-08 08:02 UTC by Gustau Pérez i Querol
Modified: 2014-04-08 17:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
git formated patch that tries to fix the su/sudo detection (1.39 KB, patch)
2014-04-08 08:04 UTC, Gustau Pérez i Querol
accepted-commit_now Details | Review

Description Gustau Pérez i Querol 2014-04-08 08:02:18 UTC
Commit 1244dbb6f0381ced states that gnome-terminal doesn't
work under sudo. To detect this that checks whether the uid or gid have
changed or that the e[uid|gid] are 0.

If the user already belongs to the group wheel or was root without doing any su or sudo, gnome-terminal will exit. This, according to the commit 1244dbb6 is not the intended behavior. 

What we need to check is whether e[uid|gid] have changed (because the user was
root already or because the user belongs to the wheel/root group) and
check if the e[uid|gid] are 0. In that case the gnome-terminal is run under
su/sudo and gnome-terminal should bail out.
Comment 1 Gustau Pérez i Querol 2014-04-08 08:04:53 UTC
Created attachment 273766 [details] [review]
git formated patch that tries to fix the su/sudo detection
Comment 2 Christian Persch 2014-04-08 08:34:08 UTC
Comment on attachment 273766 [details] [review]
git formated patch that tries to fix the su/sudo detection

(In reply to comment #0)
> If the user [...] was root without doing any su
> or sudo, gnome-terminal will exit. This, according to the commit 1244dbb6 is
> not the intended behavior. 

I was under the impression that gdm refused to log in as root?

Anyway, please commit to master and gnome-3-12.
Comment 3 Gustau Pérez i Querol 2014-04-08 16:47:56 UTC
I don't have commit access there. Could anyone with permission commit this?
Comment 4 Antoine Jacoutot 2014-04-08 17:18:27 UTC
Gustau asked me privately if I could commit it, so here: ef5b45c

Christian I only committed to head, feel free to cherry-pick it into the stable branches, I prefer to leave that decision to a gnome-terminal developer.
Comment 5 Gustau Pérez i Querol 2014-04-08 17:19:52 UTC
Mark the report as fixed.