Bug 1170496 - YaST main menu doesn't work if run with "su", works fine only with "su -"
YaST main menu doesn't work if run with "su", works fine only with "su -"
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: YaST2
Other Other
: P5 - None : Normal (vote)
: ---
Assigned To: E-mail List
Jiri Srain
Depends on:
  Show dependency treegraph
Reported: 2020-04-24 23:17 UTC by Federico Mena Quintero
Modified: 2020-04-27 11:26 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---

Incorrect behavior when running with "su" (345.41 KB, image/png)
2020-04-24 23:17 UTC, Federico Mena Quintero
Correct behavior with "su -" (345.77 KB, image/png)
2020-04-24 23:17 UTC, Federico Mena Quintero

Note You need to log in before you can comment on or make changes to this bug.
Description Federico Mena Quintero 2020-04-24 23:17:17 UTC
Created attachment 836776 [details]
Incorrect behavior when running with "su"

See the attached screenshot.  The first one shows the incorrect behavior; after doing a plain "su", yast2 is run and the main menu shows up without icons, and with the highlight misaligned with respect to the text items.

The second one shows the correct behavior, under "su -".

This is yast2-4.2.82-1.1.x86_64 on the Tumbleweed snapshot from 20200422, a fresh install.
Comment 1 Federico Mena Quintero 2020-04-24 23:17:55 UTC
Created attachment 836777 [details]
Correct behavior with "su -"
Comment 2 Stefan Hundhammer 2020-04-27 10:31:23 UTC
This works fine in my environment (reasonably up-to-date TW).

Having said that, this is not the well-established way to do this anyway. 
Please use one of "sudo" (this will need "xhost +" before to enable accessing your X server, so it's a bit "dirty") or a wrapper that takes care of the X11 permissions like "kdesu", "gnomesu", "sux".
Comment 3 Stefan Hundhammer 2020-04-27 11:13:17 UTC
When I look at that screenshot, this appears to be a matter of your desktop not providing the icons in that setup; we have been using theme icons for YaST for quite a while now. Theme icons are provided by the desktop.

The difference between plain "su" and "su -" is setting up the shell environment.

man su:

       The optional argument - may be used to provide
       an environment similar to what the user would expect had the
       user logged in directly.
Comment 4 Stefan Hundhammer 2020-04-27 11:17:43 UTC
So please use either the menu (which in turn will use "gnomesu" in your GNOME desktop or "kdesu" in a KDE Plasma desktop) or "gnomesu" / "kdesu" directly or "sudo" or "su -".

Please notice that YaST modules started from the graphical YaST control center started with plain "su" may have similar problems (missing icons).
Comment 5 Stefan Hundhammer 2020-04-27 11:26:33 UTC
After a full "zypper dup" to TW 20200422 it still works fine for me on Xfce, even with only "su".

So if there is a difference, it must be in the desktop or in one of the startup files of your user.