Bug 729305 - "Lock screen" does not work under root
Summary: "Lock screen" does not work under root
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: xscreensaver
Version: 15
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Mamoru TASAKA
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-08-09 13:05 UTC by Denys Vlasenko
Modified: 2011-09-29 21:53 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-09-29 21:53:49 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Denys Vlasenko 2011-08-09 13:05:53 UTC
I can't lock screen if I logged in as root.
To be exact:
Starting with standard XFCE configuration, right-click on Logout panel button. Choose "Properties". Change second button setting from "disabled" to "Lock screen". Close properties dialog. The panel button changes, now it has two small buttons, green one for logout and brownish one for screen locking.

Under non-root, screen locking works: a password window appears.
Under root, screen locking button does nothing.

Comment 1 Christoph Wickert 2011-08-09 13:26:49 UTC
I am not sure if graphical logins as root are supported, there are numerous reasons we disable it in the different login managers.

Can you please check
1. if xscreeensaver is running when you are logged in as root
2. if 'xscreensaver-command -lock' works or if there is an error message on the terminal

Comment 2 Kevin Fenzi 2011-08-09 14:35:41 UTC
See also: 

http://www.jwz.org/xscreensaver/faq.html#root-lock

So, either just set it to save the screen, but not lock, or just don't login as root.

Comment 3 Denys Vlasenko 2011-09-29 16:24:12 UTC
# /usr/bin/xscreensaver
No protocol specified
xscreensaver: 18:14:05: Can't open display: :0.0
xscreensaver: 18:14:05: initial effective uid/gid was root/root (0/0)
xscreensaver: 18:14:05: running as nobody/nobody (99/99)

xscreensaver: 18:14:05: This is probably because you're logging in as root.  You
              shouldn't log in as root: you should log in as a normal user,
              and then `su' as needed.  If you insist on logging in as
              root, you will have to turn off X's security features before
              xscreensaver will work.

              Please read the manual and FAQ for more information:

              http://www.jwz.org/xscreensaver/faq.html
              http://www.jwz.org/xscreensaver/man.html


I read the links provided, and I see that the reason is, as expected, that someone (in this case, xscreensaver developer) is trying to shove his paranoid ideas about security down other people's throats.

It's not up to programs to make policy decisions.

"Don't run X as root" is a policy decision.

It's *my* computer, and *my* data. It's up to *me* to decide whether to run X under root, and take the risk of someone hacking my computer through X vulnerabilities.

IOW: xscreensaver should not do any "if uid==0, then switch to nobody" tricks.
If they do feel strongly about it, by all means, emit a warning to stderr or syslog, but don't intentionally handicap your program.

Reopening.

Comment 4 Kevin Fenzi 2011-09-29 20:04:42 UTC
Moving to xscreensaver, since this really has nothing to do with xfce4-panel. 

Upstream has a strong opinion on this matter. I suppose you're welcome to fork xscreensaver and make your own project that doesn't impose this requirement.

Comment 5 Mamoru TASAKA 2011-09-29 21:53:49 UTC
Software design. Closing.
If you want to make screensaver (not only xscreensaver but also gnome-screensaver [1] ) lock screen, please contact the upstream directly. I won't
change the current behavior without upstream's decision.

[1]  http://live.gnome.org/GnomeScreensaver/FrequentlyAskedQuestions#Why_doesn.27t_my_screen_lock_when_I.27m_logged_in_as_root.3F


Note You need to log in before you can comment on or make changes to this bug.