-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
configd: T6504: send sudo_user on session init and set env variable #3701
Conversation
👍 |
The fix unfortunately does not work.
See environment of vyos-configd below
|
Move to draft to revise ... |
37fe150
to
322c9c3
Compare
The environment variable SUDO_USER is checked by system_login.py so as to prevent deleting the current user. Provide from config session and set within configd environment.
322c9c3
to
7016f84
Compare
@c-po revised with proper solution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests work as exepcted, thanks!
[email protected]# delete system login user cpo
[edit]
[email protected]# commit
Attempting to delete current user: cpo
[[system login]] failed
Commit failed
This should be considered a backport to |
Without vyos-configd$ /usr/libexec/vyos/tests/smoke/cli/test_system_login.py
test_add_linux_system_user (__main__.TestSystemLogin.test_add_linux_system_user) ... ok
test_delete_current_user (__main__.TestSystemLogin.test_delete_current_user) ... ok
test_radius_kernel_features (__main__.TestSystemLogin.test_radius_kernel_features) ... ok
test_system_login_max_login_session (__main__.TestSystemLogin.test_system_login_max_login_session) ... ok
test_system_login_otp (__main__.TestSystemLogin.test_system_login_otp) ... ok
test_system_login_radius_ipv4 (__main__.TestSystemLogin.test_system_login_radius_ipv4) ... ok
test_system_login_radius_ipv6 (__main__.TestSystemLogin.test_system_login_radius_ipv6) ... ok
test_system_login_tacacs (__main__.TestSystemLogin.test_system_login_tacacs) ... ok
test_system_login_user (__main__.TestSystemLogin.test_system_login_user) ... ok
test_system_user_ssh_key (__main__.TestSystemLogin.test_system_user_ssh_key) ... ok
----------------------------------------------------------------------
Ran 10 tests in 176.126s
OK With vyos-configd$ /usr/libexec/vyos/tests/smoke/cli/test_system_login.py
test_add_linux_system_user (__main__.TestSystemLogin.test_add_linux_system_user) ...
User "backup" can not be created, conflict with local system account!
ok
test_delete_current_user (__main__.TestSystemLogin.test_delete_current_user) ...
Attempting to delete current user: cpo
ok
test_radius_kernel_features (__main__.TestSystemLogin.test_radius_kernel_features) ... ok
test_system_login_max_login_session (__main__.TestSystemLogin.test_system_login_max_login_session) ...
"login timeout" must be configured!
ok
test_system_login_otp (__main__.TestSystemLogin.test_system_login_otp) ... ok
test_system_login_radius_ipv4 (__main__.TestSystemLogin.test_system_login_radius_ipv4) ...
Only one IPv4 source-address can be set!
ok
test_system_login_radius_ipv6 (__main__.TestSystemLogin.test_system_login_radius_ipv6) ...
Only one IPv6 source-address can be set!
ok
test_system_login_tacacs (__main__.TestSystemLogin.test_system_login_tacacs) ... ok
test_system_login_user (__main__.TestSystemLogin.test_system_login_user) ... ok
test_system_user_ssh_key (__main__.TestSystemLogin.test_system_user_ssh_key) ...
Missing type for public-key "[email protected]"!
ok
----------------------------------------------------------------------
Ran 10 tests in 171.783s
OK |
@Mergifyio backport circinus |
✅ Backports have been created
|
Change Summary
The environment variable SUDO_USER is checked by system_login.py so as to prevent deleting the current user. Provide from config session and set within configd environment.
Types of changes
Related Task(s)
Related PR(s)
Component(s) name
Proposed changes
How to test
Smoketest result
Checklist: