diff options
author | bapt <bapt@FreeBSD.org> | 2015-07-13 09:09:09 +0000 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2015-07-13 09:09:09 +0000 |
commit | 3137e99447b51b9b8ab79593323571af3895c2d2 (patch) | |
tree | 6a7eac2772ac21b87b4b8ccaf8577c94cabb9b8c /usr.sbin/pw | |
parent | bfc5fcd1dc859a83ea3fad156de142d98d774a25 (diff) | |
download | FreeBSD-src-3137e99447b51b9b8ab79593323571af3895c2d2.zip FreeBSD-src-3137e99447b51b9b8ab79593323571af3895c2d2.tar.gz |
Add regression tests to ensure we keep allowing creating users with uid0
Diffstat (limited to 'usr.sbin/pw')
-rwxr-xr-x | usr.sbin/pw/tests/pw_useradd.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/usr.sbin/pw/tests/pw_useradd.sh b/usr.sbin/pw/tests/pw_useradd.sh index 6c71af6..880dab5 100755 --- a/usr.sbin/pw/tests/pw_useradd.sh +++ b/usr.sbin/pw/tests/pw_useradd.sh @@ -279,6 +279,16 @@ user_add_skel_body() { atf_check -o file:${HOME}/skel/c/d/dot.c -s exit:0 cat ${HOME}/home/foo/c/d/.c } +atf_test_case user_add_uid0 +user_add_uid0_body() { + populate_etc_skel + atf_check -e inline:"pw: WARNING: new account \`foo' has a uid of 0 (superuser access!)\n" \ + -s exit:0 ${PW} useradd foo -u 0 -g 0 -d /root -s /bin/sh -c "Bourne-again Superuser" -o + atf_check \ + -o inline:"foo:*:0:0::0:0:Bourne-again Superuser:/root:/bin/sh\n" \ + -s exit:0 ${PW} usershow foo +} + atf_init_test_cases() { atf_add_test_case user_add atf_add_test_case user_add_noupdate @@ -302,4 +312,5 @@ atf_init_test_cases() { atf_add_test_case user_add_password_from_h atf_add_test_case user_add_R atf_add_test_case user_add_skel + atf_add_test_case user_add_uid0 } |