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

Bug#426452: user-setup: Should allow preseeding to avoid adding initial user into local device groups



[Frans Pop]
> Could you please provide the patch again, this time as an attachment and 
> with correct indentation [1]? Thanks.

Sure.  Here it is.  Did not find the [1] reference, but guessed you
ment using tabs and not spaces.
Index: user-setup-apply
===================================================================
--- user-setup-apply	(revision 47046)
+++ user-setup-apply	(working copy)
@@ -125,9 +125,16 @@
 	fi
 
 	if [ -n "$USER" ]; then
-		for group in audio cdrom dialout floppy video plugdev netdev powerdev; do
-			$log $chroot $ROOT adduser "$USER" $group >/dev/null 2>&1 || true
-		done
+		db_get passwd/use_pam_group
+		if [ "$RET" = false ] ; then
+			# Grant access to some local devices for
+			# initial user, unless pam_group and
+			# pam_forground is used to grant access to
+			# console users.
+			for group in audio cdrom dialout floppy video plugdev netdev powerdev; do
+				$log $chroot $ROOT adduser "$USER" $group >/dev/null 2>&1 || true
+			done
+		fi
 	fi
 
 	db_get passwd/root-login
Index: debian/user-setup-udeb.templates
===================================================================
--- debian/user-setup-udeb.templates	(revision 47046)
+++ debian/user-setup-udeb.templates	(working copy)
@@ -16,6 +16,13 @@
 Type: string
 Description: for internal use only
 
+# Allow preseeding away the group assignement for the initial user
+# when using pam_group and pam_forground to grant local device access
+Template: passwd/use_pam_group
+Type: boolean
+Default: false
+Description: for internal use only
+
 Template: passwd/root-login
 Type: boolean
 Default: true

Reply to: