! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Screen is not locked after resume from suspend and hibernate launched from xf...
Status:
CLOSED: WONTFIX
Severity:
enhancement
Product:
Xfce4-session
Component:
General

Comments

Description Jarno Suni 2009-01-14 15:55:29 CET
Screen should be locked or at least user should have that option. Locking works, if you start suspend/hibernate using tray icon set in gnome-power-preferences and if gnome-screensaver is used.
Comment 2 Brian J. Tarricone (not reading bugmail) 2009-01-14 17:56:00 CET
Yep, should have an option for this.
Comment 3 Jarno Suni 2009-01-18 12:49:51 CET
I suppose it is hard to make gnome-power-manager to run xflock4. I have not tested whether the locking works with xfce4-power-manager.
Comment 4 Bailey Kong 2009-02-15 04:06:22 CET
Not sure if it's already been considered, but can we also get this option for xscreensaver as well? Right now when I use my keyboard shortcuts to suspend, I run "xscreensaver -lock" before actually suspending.
Comment 5 Lionel Le Folgoc 2009-03-08 14:04:50 CET
For example, xfce4-power-manager calls this function right before suspending/hibernating:
======
void
xfpm_lock_screen(void)
{
    gboolean ret = g_spawn_command_line_async("xflock4",NULL);

    if ( !ret )
    {
        g_spawn_command_line_async("gnome-screensaver-command -l",NULL);
    }
        
    if ( !ret )
    {   
        /* this should be the default*/
        ret = g_spawn_command_line_async("xdg-screensaver lock",NULL);
    }

    if ( !ret )
    {
        ret = g_spawn_command_line_async("xscreensaver-command -lock",NULL);
    }

    if ( !ret )
    {
        g_critical("Connot lock screen\n");
    }
}
======
Something similar could be added to xfce4-session (this is probably too complicated though, it could only call "xflock4").
Comment 6 Brian J. Tarricone (not reading bugmail) 2009-07-15 04:50:20 CEST
*** Bug 5498 has been marked as a duplicate of this bug. ***
Comment 7 Brian J. Tarricone (not reading bugmail) 2009-07-16 07:24:09 CEST
I've changed my mind; I'm going to reject this.  xfce4-power-manager supports this already, and does a fine job.  It's silly to duplicate this in more than one place.  Conceptually, the session manager isn't the place for this anyway.

I'm planning on having xfce4-session's suspend/hibernate buttons (and possibly shutdown/reboot as well) send those actions to the power manager if present, so when that's done, the screen will lock appropriately.

(Don't worry, if the power manager isn't available, the SM will still be able to do those actions.)
Comment 8 Yves-Alexis Perez editbugs 2009-07-16 07:37:40 CEST
Yep, not duplicating code makes sense. I'm not that sure having a PM on a desktop box makes much sense, but it's not that painful either, so all in all I guess it's a good solution.

Though I'm not sure about your:

> (Don't worry, if the power manager isn't available, the SM will still be able
> to do those actions.)

Does this mean you intend to fallback to xfce4-session implementation if there's no running PM? Even for Hibernate and Suspend?
Comment 9 Brian J. Tarricone (not reading bugmail) 2009-07-16 10:09:32 CEST
(In reply to comment #8)
> 
> Does this mean you intend to fallback to xfce4-session implementation if
> there's no running PM? Even for Hibernate and Suspend?

Yes.
Comment 10 Yves-Alexis Perez editbugs 2009-07-16 11:15:13 CEST
Hmhm, but that means the code duplication will stay, but the behaviour won't be the same wether a PM is running or not?

If PM isn't running, all buttons are displayed but everything is managed by xfce4-session (so no way to have it locked at resume for example) but if a PM is running, then it's managed by the PM and one can tune the behaviourr if the PM enables it (and behaviors can be different depending on the PM)? Is my summary ok?

I'm a bit worried by the various behaviour, but I guess there's no way to avoid that, since even various PM can have various behaviours.
Comment 11 Brian J. Tarricone (not reading bugmail) 2009-07-16 17:28:45 CEST
(In reply to comment #10)
> Hmhm, but that means the code duplication will stay, but the behaviour won't be
> the same wether a PM is running or not?

To some extent.   xfce4-session will always know how to handle shutdown and reboot by itself (but will use xfpm if present) because we can't expect non-laptop users to run a power manager.

The HAL-based suspend/hibernate stuff will probably stay for now, but I don't plan on supporting DeviceKit-power.  xfpm can do that, and I'm perfectly happy saying "you need xfpm if you want suspend/hibernate to work."  After HAL dies completely (maybe in a few years), I'll probably remove support for it to clean up the code.

> If PM isn't running, all buttons are displayed but everything is managed by
> xfce4-session (so no way to have it locked at resume for example) but if a PM
> is running, then it's managed by the PM and one can tune the behaviourr if the
> PM enables it (and behaviors can be different depending on the PM)? Is my
> summary ok?

Yes.  In this case if people ask "I want my screen locked when I resume," I'll say "install xfpm."

> I'm a bit worried by the various behaviour, but I guess there's no way to avoid
> that, since even various PM can have various behaviours.

Yes, it's true.  I'd like to keep the behaviors as similar as possible to avoid confusion, but it's silly to duplicate the functionality of xfpm in xfce4-session for things like this.

(In fact, I just installed xfpm yesterday, and it works *very* well for all of these things.  I'm going to keep using it myself, and I'd recommend others do as well.)
Comment 12 Yves-Alexis Perez editbugs 2009-07-16 19:01:06 CEST
(In reply to comment #11)

> > I'm a bit worried by the various behaviour, but I guess there's no way to avoid
> > that, since even various PM can have various behaviours.
> 
> Yes, it's true.  I'd like to keep the behaviors as similar as possible to avoid
> confusion, but it's silly to duplicate the functionality of xfpm in
> xfce4-session for things like this.
> 
> (In fact, I just installed xfpm yesterday, and it works *very* well for all of
> these things.  I'm going to keep using it myself, and I'd recommend others do
> as well.)

TBH I even thought it was more consistent to drop any suspend/hibernate code from xfce4-session and ask people to install a PM if needed (whichever they like). But anyway as behaviors will vary with the PM, it might as well be different without any PM.

Thanks for clarification :)
Comment 13 Brian J. Tarricone (not reading bugmail) 2009-07-16 19:24:32 CEST
(In reply to comment #12)
> TBH I even thought it was more consistent to drop any suspend/hibernate code
> from xfce4-session and ask people to install a PM if needed

Yeah, I agree.  It's just people bitch when features get removed, and I don't feel like dealing with it.
Comment 14 Christoph 2009-08-20 07:44:06 CEST
Any progress on this?
I'm confused: The status says RESOLVED WONTFIX. But this can't be true, because 1) the bug is severe and 2) people are discussing details of a possible solution (comments 6-13).
Comment 15 Jarno Suni 2009-08-20 09:56:04 CEST
(In reply to comment #10)

> I'm a bit worried by the various behaviour, but I guess there's no way to avoid
> that, since even various PM can have various behaviours.

I got the impression that the only PM meant to be used by xfce4-session-logout is xfpm and it would use xflock4 to start the preferred screen locker. Well, there should be such a locker utility available in order that to work. 

I think it is not nice to let user get used to have password asked by the Suspend or the Hibernate button in one Xfce configuration, but have it not asked in another. There could be additional buttons, say "Suspend + Lock" and "Hibernate + lock", that require authorization in resume always. That way user would have decision whether he/she wants to lock computer every time he uses suspend or hibernate.
Comment 16 Yves-Alexis Perez editbugs 2009-08-20 10:37:07 CEST
(In reply to comment #15)
> (In reply to comment #10)
> 
> > I'm a bit worried by the various behaviour, but I guess there's no way to avoid
> > that, since even various PM can have various behaviours.
> 
> I got the impression that the only PM meant to be used by xfce4-session-logout
> is xfpm and it would use xflock4 to start the preferred screen locker. Well,
> there should be such a locker utility available in order that to work. 

No, as I understand it, xfce4-session would send a dbus message on the power management bus and whatever running PM would run the defined action. And it's the PM role to lock (or not) using appropriate (xdg-lock or something) command.
> 
> I think it is not nice to let user get used to have password asked by the
> Suspend or the Hibernate button in one Xfce configuration, but have it not
> asked in another. There could be additional buttons, say "Suspend + Lock" and
> "Hibernate + lock", that require authorization in resume always. That way user
> would have decision whether he/she wants to lock computer every time he uses
> suspend or hibernate.

Disagree, that would clutter the interface for no good reason.
Comment 17 Jarno Suni 2009-08-20 12:04:52 CEST
(In reply to comment #16)
 
> No, as I understand it, xfce4-session would send a dbus message on the power
> management bus and whatever running PM would run the defined action. And it's
> the PM role to lock (or not) using appropriate (xdg-lock or something) command.

I see.

> Disagree, that would clutter the interface for no good reason.

Well, it is arguable, whether saving user from typing password unnecessarily is a good reason. But if the interface can't tell you whether it locks screen in conjunction with suspend or hibernate, there is no point in such additional buttons.
Comment 18 Yves-Alexis Perez editbugs 2009-08-20 12:09:06 CEST
(In reply to comment #17)
> (In reply to comment #16)
> > Disagree, that would clutter the interface for no good reason.
> 
> Well, it is arguable, whether saving user from typing password unnecessarily is
> a good reason. But if the interface can't tell you whether it locks screen in
> conjunction with suspend or hibernate, there is no point in such additional
> buttons.

IMHO, xfce4-session doesn't lock screen. You hit the “quit” stuff, and there you have choice to logout/shutdown/restart/suspend/hibernate. That's all. How is those stuff done is not xfce4-session role. If you configured the PM for locking, then it'll lock, that's all.
Comment 19 Jarno Suni 2009-08-20 12:40:05 CEST
(In reply to comment #18)

> IMHO, xfce4-session doesn't lock screen. You hit the “quit” stuff, and there
> you have choice to logout/shutdown/restart/suspend/hibernate. That's all. How
> is those stuff done is not xfce4-session role. If you configured the PM for
> locking, then it'll lock, that's all.

Well, I want to lock computer many times in conjunction with suspend, many times I do not want to lock in conjunction with suspend. (Currently I do the former by gnome-power-manager's tray icon and the latter by the "quit" staff.) I don't want to change PM's preferences each time I have different needs. (Is that even possible for gnome-power-manager?)
Comment 20 Christoph 2009-08-20 13:41:25 CEST
> > IMHO, xfce4-session doesn't lock screen. You hit the “quit” stuff, and there
> > you have choice to logout/shutdown/restart/suspend/hibernate. That's all. How
> > is those stuff done is not xfce4-session role. If you configured the PM for
> > locking, then it'll lock, that's all.

I'm not sure I understand that. Are you saying this bug is indeed not going to be fixed because the user can set the desired setting somewhere (in a PM - power manager?) that I don't find? 

I expect my computer to behave like this: 
a) If, on installation, I tell it to log in automatically (i.e. without a password), then I obviously also want it to resume from suspend and hibernate without prompting for a password. 
b) If, on installation, I tell it to ask me for a password on start up (which is the case), it should assume I also want it to protect itself with a password on resume from suspend/hibernate. This does not work. It asks for a password on start up, but not after suspend/hibernate. 

Maybe I should understand that the Xfce Bugzilla is the wrong place to fix this? 

And could someone tell me how I can work around the problem by manually locking the screen before suspending/hibernating? I don't find such an option anywhere, especially not under Settings - Power Management. Once the screen is locked, I cannot suspend/hibernate any more. 

Thank you!
Comment 21 Yves-Alexis Perez editbugs 2009-08-20 13:48:40 CEST
(In reply to comment #20)
> > > IMHO, xfce4-session doesn't lock screen. You hit the “quit” stuff, and there
> > > you have choice to logout/shutdown/restart/suspend/hibernate. That's all. How
> > > is those stuff done is not xfce4-session role. If you configured the PM for
> > > locking, then it'll lock, that's all.
> 
> I'm not sure I understand that. Are you saying this bug is indeed not going to
> be fixed because the user can set the desired setting somewhere (in a PM -
> power manager?) that I don't find? 

Xfce4-session behavior will be modified, yes, as Brian explained it. But the configuration will be done in whatever PM you're using.
> 
> I expect my computer to behave like this: 
> a) If, on installation, I tell it to log in automatically (i.e. without a
> password), then I obviously also want it to resume from suspend and hibernate
> without prompting for a password. 

Then ask your PM not to lock the screen.

> b) If, on installation, I tell it to ask me for a password on start up (which
> is the case), it should assume I also want it to protect itself with a password
> on resume from suspend/hibernate. This does not work. It asks for a password on
> start up, but not after suspend/hibernate.

The ask your PM to lock the screen.
> 
> Maybe I should understand that the Xfce Bugzilla is the wrong place to fix
> this?

Yes.
> 
> And could someone tell me how I can work around the problem by manually locking
> the screen before suspending/hibernating? I don't find such an option anywhere,
> especially not under Settings - Power Management. Once the screen is locked, I
> cannot suspend/hibernate any more.

If you use Xfce Power Manager, it's in “Extended” options.
Comment 22 Christoph 2009-08-20 21:53:36 CEST
Yves-Alexis, thank you for the quick answers. 

(In reply to comment #21)
(...)
> > b) If, on installation, I tell it to ask me for a password on start up (which
> > is the case), it should assume I also want it to protect itself with a password
> > on resume from suspend/hibernate. This does not work. It asks for a password on
> > start up, but not after suspend/hibernate.
> 
> The ask your PM to lock the screen.

Well, neither gnome-power-manager nor xfce4-power-manager have such an option in their GUIs. Maybe there's something hidden in a preferences file, but nothing visible to me. 

> > And could someone tell me how I can work around the problem by manually locking
> > the screen before suspending/hibernating? I don't find such an option anywhere,
> > especially not under Settings - Power Management. Once the screen is locked, I
> > cannot suspend/hibernate any more.
> 
> If you use Xfce Power Manager, it's in “Extended” options.

I had to install xfce4-power-manager and uninstall the gnome version first (don't ask me why Xubuntu ships with the gnome-power-manager instead of the xfce one...), and now I get a locked screen if I suspend/hibernate from the context menu of xfce4-power-manager (but not from the action buttons on the panel or from the menu). Seems strange to me: If it's the power manager that deals with the locked screen, and not xfce4-session, why does that power manager behave differently depending on the way it's invoked? 

But after all I can suspend /and/ protect my data at the same time. So thank you :-)
Comment 23 Brian J. Tarricone (not reading bugmail) 2009-08-20 22:24:21 CEST
Guys, this is not the place to discuss this.

My original assertion still stands: xfce4-session WILL NOT support locking the screen after suspend.  I've already explained why and I don't intend to rehash this.

Christoph, xfce4-power-manager does indeed have an option to lock the screen in the preferences dialog; your inability to find it does not make it not so.  The reason the panel sleep button doesn't cause the screen to get locked is because the panel sleep button doesn't talk to the power manager, I guess.  Feel free to file a feature request with the panel button plugin, or whatever it is.
Comment 24 Christoph 2009-08-21 05:34:37 CEST
(In reply to comment #23)
> Christoph, xfce4-power-manager does indeed have an option to lock the screen in
> the preferences dialog; your inability to find it does not make it not so.  
If I have offended you, I apologise; I did certainly not intend to do so. If not, I would like to insist that at least in my copy of that preferences dialog (xfce power manager 0.6.2) there is no option that lets me choose if I want a locked screen after suspend/resume or not (CPU settings, Battery settings, Shortcuts, Monitor settings: No mention of locking the screen). I attach a screenshot so you don't think I'm just dumb. 

> The
> reason the panel sleep button doesn't cause the screen to get locked is because
> the panel sleep button doesn't talk to the power manager, I guess.  Feel free
> to file a feature request with the panel button plugin, or whatever it is.
I'll try that. Thank you for the hint.
Comment 25 Christoph 2009-08-21 05:35:36 CEST
Created attachment 2512 
Screenshot of the xfce4-power-manager preferences dialog without option to lock the screen
Comment 26 Jarno Suni 2009-08-21 09:09:53 CEST
(In reply to comment #25)
> Screenshot of the xfce4-power-manager preferences dialog without option to lock
> the screen

I suppose the option is present in a newer version of xfce4-power-manager.
http://goodies.xfce.org/projects/applications/xfce4-power-manager

As for comment #23, I don't know where Brian J. Tarricone picked the panel sleep button from; Christoph was talking about the Action Buttons, more specifically the Log out dialog (=xfce4-session-logout) launched by the Quit button. The suspend/hibernate button there does not use a power manager at least in the older versions of the dialog as explained earlier.

As for comment #22, gnome-power-manager gnome-screensaver combination works fine in Xubuntu. Please mail me directly, if you want to discuss more about it.
Comment 27 Jarno Suni 2009-10-10 15:02:25 CEST
(In reply to comment #13)
> (In reply to comment #12)
> > TBH I even thought it was more consistent to drop any suspend/hibernate code
> > from xfce4-session and ask people to install a PM if needed
> 
> Yeah, I agree.  It's just people bitch when features get removed, and I don't
> feel like dealing with it.

If the dialog is titled "Log out <username>", having suspend and hibernate buttons there is inconsistent. And it is bad, if user does not know/remember whether screen is locked in conjunction with them.

To have better control to suspend/hibernate and to lock in conjunction with them, I filed bug 5853.
Comment 28 Christoph Wickert editbugs 2010-09-12 11:27:08 CEST
Meanwhile someone requested a CVE for this:
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-4996

References:
* https://bugzilla.redhat.com/show_bug.cgi?id=632978
* http://security-tracker.debian.org/tracker/CVE-2009-4996 (no idea why Debian claims to be not affected)

Bug #4805

Reported by:
Jarno Suni
Reported on: 2009-01-14
Last modified on: 2010-09-12
Duplicates (1):
  • 5498 Support for “lock screen” option when resuming

People

Assignee:
Brian J. Tarricone (not reading bugmail)
CC List:
5 users

Version

Version:
4.5.91 (4.6 beta 1)

Attachments

Additional information