[debian-edu-commits] debian-edu/ 01/01: Capture non-existing group names and default to group 'root' instead. Also, correctly now detect existence of groups.

Mike Gabriel sunweaver at debian.org
Mon Apr 28 09:55:00 UTC 2014


This is an automated email from the git hooks/post-receive script.

sunweaver pushed a commit to branch master
in repository italc.

commit fa996a737b5880ab13965665e82f023141062549
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Mon Apr 28 11:54:18 2014 +0200

    Capture non-existing group names and default to group 'root' instead. Also, correctly now detect existence of groups.
---
 debian/changelog           |  2 ++
 debian/italc-client.config | 16 ++++++++--------
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index a436fe8..d8c3da5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,8 @@ italc (1:2.0.1-5) UNRELEASED; urgency=low
 
   * DebConf:
     + Make empty group names will be set with our default group ('root').
+    + Capture non-existing group names and default to group 'root' instead.
+      Also, correctly now detect existence of groups.
 
  -- Mike Gabriel <sunweaver at debian.org>  Mon, 28 Apr 2014 11:28:17 +0200
 
diff --git a/debian/italc-client.config b/debian/italc-client.config
index 3ebc365..6d4f562 100755
--- a/debian/italc-client.config
+++ b/debian/italc-client.config
@@ -45,10 +45,10 @@ if [ "$create_keypairs" = "true" ]; then
 		db_get italc-client/group-italc-teacher
 		italc_group_teacher=$RET
 		db_get italc-client/last-group-teacher
-		if [ -z "$RET" ]; then
+		if [ -z "$RET" ] || ! getent group $RET 1>/dev/null; then
 			RET="root"
 		fi
-		if [ "$RET" != "$italc_group_teacher" ] && [ "$RET" != 'italc-teacher' ] && [ `id -g "$RET"` -ge 100 ]; then
+		if [ "$RET" != "$italc_group_teacher" ] && [ "$RET" != 'italc-teacher' ] && [ $(getent group $RET | cut -d ":" -f 3) -ge 500 ]; then
 			db_input critical italc-client/del-last-group-teacher || true
 			db_go
 		fi
@@ -59,10 +59,10 @@ if [ "$create_keypairs" = "true" ]; then
 		db_get italc-client/group-italc-student
 		italc_group_student=$RET
 		db_get italc-client/last-group-student
-		if [ -z "$RET" ]; then
+		if [ -z "$RET" ] || ! getent group $RET 1>/dev/null; then
 			RET="root"
 		fi
-		if [ "$RET" != "$italc_group_student" ] && [ "$RET" != 'italc-student' ] && [ `id -g "$RET"` -ge 100 ]; then
+		if [ "$RET" != "$italc_group_student" ] && [ "$RET" != 'italc-student' ] && [ $(getent group $RET | cut -d ":" -f 3) -ge 500 ]; then
 			db_input critical italc-client/del-last-group-student || true
 			db_go
 		fi
@@ -73,10 +73,10 @@ if [ "$create_keypairs" = "true" ]; then
 		db_get italc-client/group-italc-supporter
 		italc_group_supporter=$RET
 		db_get italc-client/last-group-supporter
-		if [ -z "$RET" ]; then
+		if [ -z "$RET" ] || ! getent group $RET 1>/dev/null; then
 			RET="root"
 		fi
-		if [ "$RET" != "$italc_group_supporter" ] && [ "$RET" != 'italc-supporter' ] && [ `id -g "$RET"` -ge 100 ]; then
+		if [ "$RET" != "$italc_group_supporter" ] && [ "$RET" != 'italc-supporter' ] && [ $(getent group $RET | cut -d ":" -f 3) -ge 500 ]; then
 			db_input critical italc-client/del-last-group-supporter || true
 			db_go
 		fi
@@ -87,10 +87,10 @@ if [ "$create_keypairs" = "true" ]; then
 		db_get italc-client/group-italc-admin
 		italc_group_admin=$RET
 		db_get italc-client/last-group-admin
-		if [ -z "$RET" ]; then
+		if [ -z "$RET" ] || ! getent group $RET 1>/dev/null; then
 			RET="root"
 		fi
-		if [ "$RET" != "$italc_group_admin" ] && [ "$RET" != 'italc-admin' ] && [ `id -g "$RET"` -ge 100 ]; then
+		if [ "$RET" != "$italc_group_admin" ] && [ "$RET" != 'italc-admin' ] && [ $(getent group $RET | cut -d ":" -f 3) -ge 500 ]; then
 			db_input critical italc-client/del-last-group-admin || true
 			db_go
 		fi

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/pkg-team/italc.git



More information about the debian-edu-commits mailing list