Skip to content

switch_user_permanently: skip switchback check if switched to root#319

Closed
cgzones wants to merge 4 commits intologrotate:masterfrom
cgzones:su_fix
Closed

switch_user_permanently: skip switchback check if switched to root#319
cgzones wants to merge 4 commits intologrotate:masterfrom
cgzones:su_fix

Conversation

@cgzones
Copy link
Member

@cgzones cgzones commented Apr 8, 2020

  • switch_user_permanently: skip switchback check if switched to root
    Allow switching only the real group (not the user) with a configuration
    like su root somegroup.
    E.g. mailman uses su root list, which currently fails with:
    error: failed to switch user permanently, able to switch back
    error: failed to compress log /var/log/mailman/qrunner.1

  • switch_user_permanently: add sanity check that effective ids match configuration specified ones

  • switch_user*: improve debug logging
    Print pid to distinguish processes.
    Print previous effective ids.

  • rotateLogSet: call switch_user_back on early return

cgzones added 4 commits April 8, 2020 16:38
Allow switching only the real group (not the user) with a configuration
like `su root somegroup`.
E.g. mailman uses `su root list`, which currently fails with:
    error: failed to switch user permanently, able to switch back
    error: failed to compress log /var/log/mailman/qrunner.1

Fixes: a0b05e4 ("switch_user_permanently: check if switchback is possible")
Print pid to distinguish processes.
Print previous effective ids.
@kdudka
Copy link
Member

kdudka commented Apr 8, 2020

Merging, thanks!

@kdudka kdudka closed this in 1edc0fc Apr 8, 2020
kdudka pushed a commit that referenced this pull request Apr 8, 2020
kdudka pushed a commit that referenced this pull request Apr 8, 2020
Print pid to distinguish processes.
Print previous effective ids.

Closes: #319
kdudka pushed a commit that referenced this pull request Apr 8, 2020
@cgzones cgzones deleted the su_fix branch April 9, 2020 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants