aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/pw/tests
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2017-08-19 00:19:23 +0000
committerEd Maste <emaste@FreeBSD.org>2017-08-19 00:19:23 +0000
commit3dc869c257b6379c2de689d254ada3cc4736cb20 (patch)
tree869f2685c3b53ffa9bb42a031c72a31117d307a4 /usr.sbin/pw/tests
parentbdab1e70249bef563199f6bb6308e3fdf240ae32 (diff)
downloadsrc-3dc869c257b6379c2de689d254ada3cc4736cb20.tar.gz
src-3dc869c257b6379c2de689d254ada3cc4736cb20.zip
pw usermod: Properly deal with empty secondary group lists (-G '')
"pw usermod someuser -G ''" is supposed make sure that someuser doesn't have any secondary group memberships. Previouly it was a nop because split_groups() only intitialised "groups" if at least one group was specified. As a result the existing secondary group memberships were kept. PR: 221417 Submitted by: Fabian Keil Obtained from: ElectroBSD MFC after: 1 week Relnotes: yes
Notes
Notes: svn path=/head/; revision=322677
Diffstat (limited to 'usr.sbin/pw/tests')
-rwxr-xr-xusr.sbin/pw/tests/pw_usermod_test.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/usr.sbin/pw/tests/pw_usermod_test.sh b/usr.sbin/pw/tests/pw_usermod_test.sh
index 6a1313025cd2..cf3622f3b222 100755
--- a/usr.sbin/pw/tests/pw_usermod_test.sh
+++ b/usr.sbin/pw/tests/pw_usermod_test.sh
@@ -128,6 +128,9 @@ user_mod_nogroups_body() {
atf_check -s exit:0 ${PW} usermod foo -G test3,test4
atf_check -s exit:0 -o inline:"test3\ntest4\n" \
awk -F\: '$4 == "foo" { print $1 }' ${HOME}/group
+ atf_check -s exit:0 ${PW} usermod foo -G ""
+ atf_check -s exit:0 -o empty \
+ awk -F\: '$4 == "foo" { print $1 }' ${HOME}/group
}
atf_test_case user_mod_rename