Patch #20589

Activate sudo mode after password based login

Added by Jens Krämer about 3 years ago. Updated about 3 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Accounts / authentication
Target version:3.2.0

Description

We found that users get confused / annoyed when they just logged in and sudo mode requires their password again if they wanted to perform some administrative action.

Therefore this patch activates the sudo mode for the configured time span if the user logged in using username/password.

enable_sudo_mode_after_pwd_based_login.diff Magnifier (481 Bytes) Jens Krämer, 2015-08-21 11:07

enable_sudo_mode_after_pwd_based_login_fixed.diff Magnifier - fixed patch (2.58 KB) Jens Krämer, 2015-10-01 07:33

Associated revisions

Revision 14635
Added by Jean-Philippe Lang about 3 years ago

Activate sudo mode after password based login (#20589).

Patch by Jens Krämer.

History

#1 Updated by Jan from Planio www.plan.io about 3 years ago

  • Target version set to Candidate for next minor release

#2 Updated by Toshi MARUYAMA about 3 years ago

  • Target version changed from Candidate for next minor release to 3.2.0

#3 Updated by Jean-Philippe Lang about 3 years ago

  • Subject changed from activate sudo mode after password based login to Activate sudo mode after password based login

Agreed, but the patch doesn't work for me. I guess that's because #successful_authentication resets the session just after. The call to #update_sudo_timestamp! should be moved just after, right?

This also breaks pretty much all the tests from SudoModeTest and we can not reset the session sudo timestamp from within integration tests, any solution?

#4 Updated by Jens Krämer about 3 years ago

You're right, it belongs after that.

Sorry for the sloppy patch. I attached a new one that also fixes the tests (by advancing the time using Rails' travel_to test helper) and adds a new test to check wether sudo mode is active after log in.

#5 Updated by Jean-Philippe Lang about 3 years ago

  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang

Brilliant, thanks. Committed in r14635.

Also available in: Atom PDF