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

Bug#543268: user-setup: Please provide preseedable passwd/user-extra-groups, to allow preseeding without overriding defaults



Control: tag -1 patch

Josh Triplett <josh@joshtriplett.org> (2009-08-23):
> Package: user-setup
> Severity: wishlist
> 
> user-setup provides a preseedable passwd/user-default-groups, which
> overrides the default groups a user will normally get added to.  I'd
> like to have a second preseedable item passwd/user-extra-groups, empty
> by default, which I can preseed to add additional groups without
> overriding those supplied by default.

So Joey sent a patch[1] a while ago, here's the user-setup part,
refreshed against current master (for the changelog part).

 1. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=543268#8

Tagging this bug report with patch. Of course if the patch gets pushed,
the manual wants to be updated as well (see initial patch).

Mraw,
KiBi.
From a93583034f56b6bc35192935e93911105a65efc8 Mon Sep 17 00:00:00 2001
From: Cyril Brulebois <kibi@debian.org>
Date: Sun, 2 Mar 2014 16:30:29 +0100
Subject: [PATCH] Add preseedable passwd/user-extra-groups. Closes: #543268

---
 debian/changelog                 | 7 +++++++
 debian/user-setup-udeb.templates | 6 ++++++
 user-setup-apply                 | 8 +++++---
 3 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index c98349c..cf9dc22 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+user-setup (1.56) UNRELEASED; urgency=medium
+
+  [ Joey Hess ]
+  * Add preseedable passwd/user-extra-groups. Closes: #543268
+
+ -- Cyril Brulebois <kibi@debian.org>  Sun, 02 Mar 2014 16:29:35 +0100
+
 user-setup (1.55) unstable; urgency=low
 
   * Add first created user to lpadmin group so that it can use local
diff --git a/debian/user-setup-udeb.templates b/debian/user-setup-udeb.templates
index 603325f..33b3514 100644
--- a/debian/user-setup-udeb.templates
+++ b/debian/user-setup-udeb.templates
@@ -22,6 +22,12 @@ Type: string
 Default: audio cdrom dip floppy video plugdev netdev powerdev scanner bluetooth debian-tor lpadmin
 Description: for internal use only
 
+# Allow adding user to extra groups in addition to the default
+Template: passwd/user-extra-groups
+Type: string
+Default: 
+Description: for internal use only
+
 Template: passwd/root-login
 Type: boolean
 Default: true
diff --git a/user-setup-apply b/user-setup-apply
index f24ece2..2347b9f 100755
--- a/user-setup-apply
+++ b/user-setup-apply
@@ -141,9 +141,11 @@ if [ "$RET" = true ] && ! is_system_user; then
 	fi
 
 	if [ -n "$USER" ]; then
-		db_get passwd/user-default-groups
-		for group in $RET; do
-			$log $chroot $ROOT adduser "$USER" $group >/dev/null 2>&1 || true
+		for type in default extra; do
+			db_get passwd/user-$type-groups
+			for group in $RET; do
+				$log $chroot $ROOT adduser "$USER" $group >/dev/null 2>&1 || true
+			done
 		done
 	fi
 
-- 
1.9.0

Attachment: signature.asc
Description: Digital signature


Reply to: