diff options
author | Phil Davis <phil.davis@inf.org> | 2015-03-18 17:48:36 +0545 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2015-03-18 10:58:58 -0300 |
commit | 5372d26d9d25d751d16865ed9d46869d3b0ec5e1 (patch) | |
tree | e00cf869ec9aa947ba9d77bc17598a5a7fdea273 /etc/skel | |
parent | b13f7a8c58f573441568fe717f68b7e3989218c1 (diff) | |
download | pfsense-5372d26d9d25d751d16865ed9d46869d3b0ec5e1.zip pfsense-5372d26d9d25d751d16865ed9d46869d3b0ec5e1.tar.gz |
Cleanup code path when adding a new user
1) Only attempt to delete the oldusername if it actually was non-empty - at the moment errors are logged in the system log when adding a new user, because the code was trying to delete the user name "".
2) Call local_user_set() first to create (change, whatever) the user record. This makes the user record exist for a new user. Then call local_user_set_groups() to sort out what groups the user should be in or not in. The existing code would fail to add a new user to the specified group/s because local_user_set_groups() was called too early, before the user actually existed.
Typical system log errors from the old code:
Mar 18 17:10:31 php-fpm[9542]: /system_usermanager.php: Tried to remove user but got user pw instead. Bailing.
Mar 18 17:10:31 php-fpm[9542]: /system_usermanager.php: The command '/usr/sbin/pw groupmod admins -g 1999 -M '0,2003,2006,2008' 2>&1' returned exit code '67', the output was 'pw: user `2008' does not exist'
From looking at the code history, I think this has been this way for a long time, not a new bug at all.
Discussed in forum: https://forum.pfsense.org/index.php?topic=90700.msg501766#msg501766
Diffstat (limited to 'etc/skel')
0 files changed, 0 insertions, 0 deletions