GNOME Bugzilla – Bug 605137
way to suppress "(as superuser)" message
Last modified: 2020-11-07 12:35:54 UTC
I can see the usefulness of the new "(as superuser)" message to let users know that they should be taking extra care. However, there are a few cases where it isn't really appropriate. The Ubuntu installer runs as root (actually, it drops privileges for many of its UI operations in order to work better with a11y bits, but we're running in a special session so it doesn't matter all that much most of the time). It's quite confusing to see "Install (as superuser)", since it suggests the question of how one might Install not as the superuser. Would it be possible to get a flag whereby applications can suppress this message? I'm assuming that there isn't really a security concern here, since applications running as the superuser are all-powerful anyway. Thomas said on IRC: "I think a _NET_WM_* flag is probably overkill, but a _METACITY_* flag would probably be a sane workaround".
Created attachment 153372 [details] Test case
Created attachment 153373 [details] [review] Patch to Metacity to implement this behaviour I think this does what you want. Can you try it out and let me know? Thanks.
I think I'm just being stupid somehow, but can you walk me through testing this with PyGTK if you know how? I'm currently trying: $ sudo python >>> import gtk >>> w = gtk.Window() >>> w.show() >>> w.window.property_change('_METACITY_HIDE_USERNAME', 'CARDINAL', 8, gtk.gdk.PROP_MODE_REPLACE, '\001') >>> gtk.main() ... but no dice. xprop shows '_METACITY_HIDE_USERNAME(CARDINAL) = 1' as I would expect. (Incidentally, why the restriction to CARDINAL atoms given that metacity ignores the value? It seems as though META_PROP_TYPE_INVALID would be fine in that table.)
To match the C test case, I made this: >>> w.window.property_change('_METACITY_HIDE_USERNAME', 'CARDINAL', 32, gtk.gdk.PROP_MODE_REPLACE, [1]) No difference, though. Indeed the C test case fails for me too; running it as root, both windows have "(as superuser)" in their title bars.
The C test case is still working for me, but your Python test case fails; I'll look into it and find out why. Not sure why I made it CARDINAL, now I come to think of it. INVALID would presumably have been more sensible.
I am seeing the same behavior as Colin for both C and python test program. I have noticed that, if I restart metacity, the window running as root then no longer has "(as superuser)" in the title. It is as if metacity does not redraw the window title when it gets notification that disable_as_user flag of the MetaWindow has changed.
bugzilla.gnome.org is being replaced by gitlab.gnome.org. We are closing all old feature requests in Bugzilla which have not seen updates for many years. If you still use metacity and if you are still requesting this feature in a currently supported version of GNOME (currently that would be 3.38), then please feel free to report it at https://gitlab.gnome.org/GNOME/metacity/-/issues/ Thank you for reporting this issue and we are sorry it could not be implemented.