[Pkg-shadow-devel] [Git][debian/adduser][wip/new-shadow] Give chpasswd test values that it will accept

Marc Haber (@zugschlus) gitlab at salsa.debian.org
Sat Jan 10 20:29:31 GMT 2026



Marc Haber pushed to branch wip/new-shadow at Debian / adduser


Commits:
80dacc4a by Marc Haber at 2026-01-10T21:26:27+01:00
Give chpasswd test values that it will accept

This is to work around the more picky chpasswd in new src:shadow

- - - - -


1 changed file:

- debian/tests/f/adduser_system.t


Changes:

=====================================
debian/tests/f/adduser_system.t
=====================================
@@ -204,8 +204,23 @@ assert_command_success(
 assert_user_exists('aust');
 assert_user_is_system('aust');
 
-system('echo "aust:!foobar" | chpasswd --encrypted');
-# with #1099734 fixed, this should fail
+# #1124835
+# system('echo "aust:!" | chpasswd --encrypted');
+# ok(1, "set passwd to !");
+# assert_command_success(
+#     '/usr/sbin/adduser',
+#     '--stdoutmsglevel=error', '--stderrmsglevel=error',
+#     '--system',
+#     '--disabled-login',
+#     'aust'
+# );
+# assert_user_exists('aust');
+# assert_user_is_system('aust');
+
+# $ mkpasswd --hash=yescrypt foobar
+# $y$j9T$dDqPXxXOCZL14/3jiuscW.$P8VGTWHqO1.qLOJs5Mas7Vzj3Ni9Es3QhACrVa0Z5Z3
+system(qq{echo 'aust:!\$y\$j9T\$dDqPXxXOCZL14/3jiuscW.\$P8VGTWHqO1.qLOJs5Mas7Vzj3Ni9Es3QhACrVa0Z5Z3' | chpasswd --encrypted});
+ok(1, "set passwd to !foobar");
 assert_command_result_silent(RET_WRONG_OBJECT_PROPERTIES,
     '/usr/sbin/adduser',
     '--stdoutmsglevel=error', '--stderrmsglevel=error',
@@ -216,23 +231,28 @@ assert_command_result_silent(RET_WRONG_OBJECT_PROPERTIES,
 assert_user_exists('aust');
 assert_user_is_system('aust');
 
-system('echo "aust:*foobar" | chpasswd --encrypted');
-ok(1, "set passwd to *foobar");
-assert_command_success(
-    '/usr/sbin/adduser',
-    '--stdoutmsglevel=error', '--stderrmsglevel=error',
-    '--system',
-    '--disabled-login',
-    'aust'
-);
-assert_user_exists('aust');
-assert_user_is_system('aust');
+# #1124835
+# $ mkpasswd --hash=yescrypt foobar
+# $y$j9T$dDqPXxXOCZL14/3jiuscW.$P8VGTWHqO1.qLOJs5Mas7Vzj3Ni9Es3QhACrVa0Z5Z3
+#system(qq{echo 'aust:*\$y\$j9T\$dDqPXxXOCZL14/3jiuscW.\$P8VGTWHqO1.qLOJs5Mas7Vzj3Ni9Es3QhACrVa0Z5Z3' | chpasswd --encrypted});
+#ok(1, "set passwd to *foobar");
+#assert_command_result_silent(RET_WRONG_OBJECT_PROPERTIES,
+#    '/usr/sbin/adduser',
+#    '--stdoutmsglevel=error', '--stderrmsglevel=error',
+#    '--system',
+#    '--disabled-login',
+#    'aust'
+#);
+#assert_user_exists('aust');
+#assert_user_is_system('aust');
+
 assert_command_success(
     '/usr/sbin/deluser',
     '--stdoutmsglevel=error', '--stderrmsglevel=error',
     '--system',
     'aust'
 );
+assert_user_does_not_exist('aust');
 
 # ref #100032
 # test --home



View it on GitLab: https://salsa.debian.org/debian/adduser/-/commit/80dacc4aed71c31aa7a49b201647cda1a4d1fe8b

-- 
View it on GitLab: https://salsa.debian.org/debian/adduser/-/commit/80dacc4aed71c31aa7a49b201647cda1a4d1fe8b
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-shadow-devel/attachments/20260110/b64d742f/attachment-0001.htm>


More information about the Pkg-shadow-devel mailing list