[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#501849: Please permit installation with an empty user password



Package: user-setup
Version: 1.23
Severity: wishlist
Tags: patch
User: ubuntu-devel@lists.ubuntu.com
Usertags: origin-ubuntu intrepid ubuntu-patch

When performing an install, the user cannot proceed without entering a
non-empty password.  This remains the case even when an empty password
has been specifically preseeded.

For most use cases, this is clearly entirely the correct behaviour.  In
those rare cases where someone really, really, wants to have an empty
password for an automatically created user, it would be nice if
user-setup would allow this directly, rather than requiring workarounds
such as reset with late_command.

The attached patch creates an additional internal-use-only preseed
boolean: passwd/allow-password-empty which when set to true allows the
use of an empty password, either interactively or through preseeding.
Users will still be asked for a password, but will not be forced to
enter one.

I've created the patch against revision 56349 in SVN, but would be happy
to update it to a newer revision with modifications if requested.

-- 
Emmet HIKORY
Index: debian/user-setup-udeb.templates
===================================================================
--- debian/user-setup-udeb.templates	(revision 56349)
+++ debian/user-setup-udeb.templates	(working copy)
@@ -22,6 +22,12 @@
 Default: audio cdrom dialout floppy video plugdev netdev powerdev
 Description: for internal use only
 
+# Allow preseeding whether to permit a blank password for created non-root user
+Template: passwd/allow-password-empty
+Type: boolean
+Default: false
+Description: for internal use only
+
 Template: passwd/root-login
 Type: boolean
 Default: true
Index: user-setup-ask
===================================================================
--- user-setup-ask	(revision 56349)
+++ user-setup-ask	(working copy)
@@ -169,7 +169,7 @@
 			db_get passwd/user-password-crypted || true
 			if ! test "$RET" ; then
 				# Compare the two passwords, loop with message if not
-				# identical, or if empty.
+				# identical
 				db_get passwd/user-password
 				USER_PW="$RET"
 				db_get passwd/user-password-again
@@ -183,7 +183,10 @@
 					STATE=6
 					continue
 				fi
-				if [ -z "$USER_PW" ]; then
+				# Loop if the password is empty, and it's not
+				# specifically allowed by preseeding
+				db_get passwd/allow-password-empty
+				if [ "$RET" = false ] && [ -z "$USER_PW" ]; then
 					db_set passwd/user-password ""
 					db_set passwd/user-password-again ""
 					db_fset user-setup/password-empty seen false

Reply to: