[debian-edu-commits] debian-edu/ 01/01: debian-edu-config/tools/gosa-*: White-space cleanups.

Mike Gabriel sunweaver at debian.org
Sat Jan 20 23:24:59 UTC 2018


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

sunweaver pushed a commit to branch master
in repository debian-edu-config.

commit d6c8beb87c201c72b427ed37f702dcfbcffbc8da
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Sun Jan 21 00:16:59 2018 +0100

    debian-edu-config/tools/gosa-*: White-space cleanups.
---
 debian/changelog                               |  4 ++
 share/debian-edu-config/tools/gosa-create      | 56 +++++++++++++-------------
 share/debian-edu-config/tools/gosa-create-host | 28 ++++++-------
 share/debian-edu-config/tools/gosa-remove      | 30 +++++++-------
 share/debian-edu-config/tools/gosa-sync        | 24 +++++------
 5 files changed, 73 insertions(+), 69 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index a2340a8..624997b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,6 @@
 debian-edu-config (1.947) UNRELEASED; urgency=medium
 
+  [ Wolfgang Schweer ]
   * debian/debian-edu-config.postrm: Also remove a generated cfengine3 config
     file. Thanks to Holger Levsen. (Closes: #887726).
   * Amend wording in two previous changelog entries.
@@ -10,6 +11,9 @@ debian-edu-config (1.947) UNRELEASED; urgency=medium
   * Fix typo debian-debian-edu-config.postinst (cfengine log file removal).
   * Adjust debian/debian-edu-config.lintian-overrides.
 
+  [ Mike Gabriel ]
+  * debian-edu-config/tools/gosa-*: White-space cleanups.
+
  -- Wolfgang Schweer <wschweer at arcor.de>  Fri, 19 Jan 2018 16:42:59 +0100
 
 debian-edu-config (1.946) unstable; urgency=medium
diff --git a/share/debian-edu-config/tools/gosa-create b/share/debian-edu-config/tools/gosa-create
index 9ea7073..96a119b 100755
--- a/share/debian-edu-config/tools/gosa-create
+++ b/share/debian-edu-config/tools/gosa-create
@@ -21,35 +21,35 @@ USERID=$1
 ## lookup user and create home directory and principal:
 ldapsearch -xLLL "(&(uid=$USERID)(objectClass=posixAccount)(!(objectClass=gosaUserTemplate)))" \
     cn homeDirectory gidNumber 2>/dev/null | perl -p0e 's/\n //g' | \
-while read KEY VALUE ; do 
-    case "$KEY" in 
-	dn:) USERNAME= ; HOMEDIR= ; GROUPID= ; USERDN="dn=$VALUE" ;;
-        cn:) USERNAME="$VALUE" ;;
-        homeDirectory:) HOMEDIR="$VALUE" ;;
-        gidNumber:) GROUPID="$VALUE"  ;;
-        "") 
-            test "$HOMEDIR" || continue 
-            echo "$HOMEDIR" | grep -q "^$PREFIX/$HOSTNAME" || continue
-            test -e "$HOMEDIR" && continue 
-    	    cp -r /etc/skel $HOMEDIR
-            if type nscd > /dev/null 2>&1 ; then
-                # These calls fail when nscd isn't running.  And then we do
-                # not care about the result, as there is no cache to invalidate.
-                nscd -i passwd || true
-                nscd -i group || true
-            fi
-	    certutil  -A -d dbm:$HOMEDIR/.mozilla/firefox/debian-edu.default/ -t "CT,CT," -n "DebianEdu" -i /etc/ssl/certs/Debian-Edu_rootCA.crt
-	    certutil  -A -d dbm:$HOMEDIR/.thunderbird/debian-edu.default/ -t "CT,CT," -n "DebianEdu" -i /etc/ssl/certs/Debian-Edu_rootCA.crt
-	    certutil  -A -d sql:$HOMEDIR/.pki/nssdb/ -t "CT,CT," -n "DebianEdu" -i /etc/ssl/certs/Debian-Edu_rootCA.crt
-	    logger -t gosa-create -p notice Both dbm and sql nssdb files created in \'$HOMEDIR\'.
-    	    chown -R $USERID:$GROUPID $HOMEDIR
-	    kadmin.local -q "add_principal -policy users -randkey -x \"$USERDN\" $USERID"
-	    logger -t gosa-create -p notice Home directory \'$HOMEDIR\' and principal \'$USERID\' created.
+while read KEY VALUE ; do
+	case "$KEY" in
+		dn:) USERNAME= ; HOMEDIR= ; GROUPID= ; USERDN="dn=$VALUE" ;;
+		cn:) USERNAME="$VALUE" ;;
+		homeDirectory:) HOMEDIR="$VALUE" ;;
+		gidNumber:) GROUPID="$VALUE"  ;;
+		"")
+			test "$HOMEDIR" || continue
+			echo "$HOMEDIR" | grep -q "^$PREFIX/$HOSTNAME" || continue
+			test -e "$HOMEDIR" && continue
+			cp -r /etc/skel $HOMEDIR
+			if type nscd > /dev/null 2>&1 ; then
+				# These calls fail when nscd isn't running.  And then we do
+				# not care about the result, as there is no cache to invalidate.
+				nscd -i passwd || true
+				nscd -i group || true
+			fi
+			certutil  -A -d dbm:$HOMEDIR/.mozilla/firefox/debian-edu.default/ -t "CT,CT," -n "DebianEdu" -i /etc/ssl/certs/Debian-Edu_rootCA.crt
+			certutil  -A -d dbm:$HOMEDIR/.thunderbird/debian-edu.default/ -t "CT,CT," -n "DebianEdu" -i /etc/ssl/certs/Debian-Edu_rootCA.crt
+			certutil  -A -d sql:$HOMEDIR/.pki/nssdb/ -t "CT,CT," -n "DebianEdu" -i /etc/ssl/certs/Debian-Edu_rootCA.crt
+			logger -t gosa-create -p notice Both dbm and sql nssdb files created in \'$HOMEDIR\'.
+			chown -R $USERID:$GROUPID $HOMEDIR
+			kadmin.local -q "add_principal -policy users -randkey -x \"$USERDN\" $USERID"
+			logger -t gosa-create -p notice Home directory \'$HOMEDIR\' and principal \'$USERID\' created.
 ## send a welcome-email:
-            cat << EOF | /usr/lib/sendmail $USERID
+			cat << EOF | /usr/lib/sendmail $USERID
 Subject: Welcome to the mail-system
 
-Hello $USERNAME, 
+Hello $USERNAME,
 
 welcome to the mail-system.
 
@@ -62,8 +62,8 @@ Regards,
     Debian-Edu SysAdmin
 
 EOF
-	    ;; 
-    esac 
+			;;
+		esac
 done
 
 exit 0
diff --git a/share/debian-edu-config/tools/gosa-create-host b/share/debian-edu-config/tools/gosa-create-host
index e778f60..d361226 100755
--- a/share/debian-edu-config/tools/gosa-create-host
+++ b/share/debian-edu-config/tools/gosa-create-host
@@ -19,8 +19,8 @@ find_fqdn() {
 	} || {
 		ldapsearch -xLLL "(&(objectClass=dNSZone)(relativeDomainName=$RELATIVE_HOSTNAME))" \
 		           zoneName aRecord | tr [A-Z] [a-z] | \
-		while read KEY VALUE ; do 
-			case "$KEY" in 
+		while read KEY VALUE ; do
+			case "$KEY" in
 				dn:) ARECORD= ; ZONENAME= ;;
 				zonename:) ZONENAME="$VALUE" ;;
 				arecord:) ARECORD="$VALUE" ;;
@@ -28,7 +28,7 @@ find_fqdn() {
 					fqdn="${RELATIVE_HOSTNAME}.${ZONENAME}"
 					[ "x$ARECORD" == "x$IPADDRESS" ] && { echo "$fqdn"; }
 					;;
-			esac 
+			esac
 		done
 	}
 }
@@ -36,17 +36,17 @@ find_fqdn() {
 ## lookup user and create home directory and principal:
 ldapsearch -xLLL "(&(cn=$HOSTNAME)(|(objectClass=GOHard)(objectClass=ipHost)))" \
            cn ipHostNumber macAddress 2>/dev/null  | perl -p00e 's/\r?\n //g' | \
-while read KEY VALUE ; do 
-        case "$KEY" in 
-                dn:) HOSTNAME= ; IP= ; HOSTDN="dn=$VALUE" ;;
-                cn:) HOSTNAME="$VALUE" ;;
-                ipHostNumber:) IP="$VALUE" ;;
-                macAddress:) MAC="$VALUE"  ;;
-                "")
-                        FQDN=`find_fqdn $HOSTNAME $IP`
-                        test -n $FQDN && kadmin.local -q "add_principal -policy hosts -randkey -x \"$HOSTDN\" host/$FQDN" && logger -t gosa-create-host -p notice Krb5 principal \'host/$FQDN\' created.
-                        ;;
-                esac 
+while read KEY VALUE ; do
+	case "$KEY" in
+		dn:) HOSTNAME= ; IP= ; HOSTDN="dn=$VALUE" ;;
+		cn:) HOSTNAME="$VALUE" ;;
+		ipHostNumber:) IP="$VALUE" ;;
+		macAddress:) MAC="$VALUE"  ;;
+		"")
+			FQDN=`find_fqdn $HOSTNAME $IP`
+			test -n $FQDN && kadmin.local -q "add_principal -policy hosts -randkey -x \"$HOSTDN\" host/$FQDN" && logger -t gosa-create-host -p notice Krb5 principal \'host/$FQDN\' created.
+			;;
+	esac
 done
 
 exit 0
diff --git a/share/debian-edu-config/tools/gosa-remove b/share/debian-edu-config/tools/gosa-remove
index 0af003c..35936e6 100755
--- a/share/debian-edu-config/tools/gosa-remove
+++ b/share/debian-edu-config/tools/gosa-remove
@@ -7,16 +7,16 @@ set -e
 ##
 ## This script removes the home directories and principals for users removed with gosa.
 ## Home directories are not purged immediately, but marked with a time stamp. Next time
-## this script is run it looks for all home directories marked for removal and removes 
-## directories older than the given age $MAXAGE. 
+## this script is run it looks for all home directories marked for removal and removes
+## directories older than the given age $MAXAGE.
 ##
-## Malicious execution can mark directories for purging, but if $MAXAGE is chosen not 
-## too short, this will be detected by the owner and no data will get lost. 
+## Malicious execution can mark directories for purging, but if $MAXAGE is chosen not
+## too short, this will be detected by the owner and no data will get lost.
 
 USERID=$1
 HOMEDIR=$2
 
-## minimum age to keep a directory before it is purged 
+## minimum age to keep a directory before it is purged
 ## in days (only integer values):
 
 MAXAGE_DAYS=500
@@ -33,9 +33,9 @@ echo "$HOMEDIR" | egrep -q "^$PREFIX/$HOSTNAME.*$USERID" || exit 1
 
 ## move mail directory to home directory
 if [ -d /var/mail/$USERID ]; then
-    mkdir -p $HOMEDIR/Maildir/
-    mv /var/mail/$USERID/* $HOMEDIR/Maildir/
-    rmdir /var/mail/$USERID 
+	mkdir -p $HOMEDIR/Maildir/
+	mv /var/mail/$USERID/* $HOMEDIR/Maildir/
+	rmdir /var/mail/$USERID
 fi
 
 ## rename home directory and delete principal:
@@ -47,15 +47,15 @@ chown root:root $RM_HOMEDIR
 chmod go-rwx $RM_HOMEDIR
 
 kadmin.local -q "delete_principal $USERID"
-logger -t gosa-remove -p notice Home directory \'$HOMEDIR\' marked for deletion and principal \'$USERID\' removed. 
+logger -t gosa-remove -p notice Home directory \'$HOMEDIR\' marked for deletion and principal \'$USERID\' removed.
 
 for DIR in `find $HOME -maxdepth 1 -type d -regextype posix-egrep -regex ".*/rm_[0-9]{8}_[^/]+"` ; do
     RMDATE=`echo $DIR | sed "s/.*rm_\([0-9]\{8\}\)_.*/\1/"`
-    AGE=$(( `date +"%s"`-`date +"%s" -d $RMDATE` )) 
-    if [ $AGE -gt $MAXAGE_SEC ] ; then
-	rm -rf $DIR
-	logger -t gosa-remove -p notice Home directory \'$DIR\' purged.
-    fi
-done 
+    AGE=$(( `date +"%s"`-`date +"%s" -d $RMDATE` ))
+	if [ $AGE -gt $MAXAGE_SEC ] ; then
+		rm -rf $DIR
+		logger -t gosa-remove -p notice Home directory \'$DIR\' purged.
+	fi
+done
 
 exit 0
diff --git a/share/debian-edu-config/tools/gosa-sync b/share/debian-edu-config/tools/gosa-sync
index 4f6f2b2..40c0d29 100755
--- a/share/debian-edu-config/tools/gosa-sync
+++ b/share/debian-edu-config/tools/gosa-sync
@@ -21,8 +21,8 @@ USERID=`echo "$USERDN" | sed "s/^uid=\([^,]*\),.*$/\1/"`
 is_krbprincipal=`ldapsearch -LLL -x "(&(uid=${USERID})(objectClass=krbPrincipalAux))"`
 if [ -z "$is_krbprincipal" ]; then
 
-   # if not, simply bail out here without noise...
-    exit 0
+	# if not, simply bail out here without noise...
+	exit 0
 
 fi
 
@@ -49,17 +49,17 @@ if [ "$IAM" = "dn:$USERDN" ] ; then
     cat > "$TMPFILE" <<EOF
 change_password -pw "$EUSERPASSWORD" $USERID
 EOF
-    RET=$((cat "$TMPFILE" | kadmin.local 1> /dev/null) 2>&1)
-    if [ -z "$RET" ] ; then
-        logger -t gosa-sync -p notice "Sucessfully changed kerberos password for '$USERID'."
-    else
-        logger -t gosa-sync -p warning "$RET"
-        echo "$RET"
-    fi
+	RET=$((cat "$TMPFILE" | kadmin.local 1> /dev/null) 2>&1)
+	if [ -z "$RET" ] ; then
+		logger -t gosa-sync -p notice "Sucessfully changed kerberos password for '$USERID'."
+	else
+		logger -t gosa-sync -p warning "$RET"
+		echo "$RET"
+	fi
 else
-    RET="Could not verify password for '$USERID'. Nothing done."
-    echo $RET
-    logger -t gosa-sync -p warning "$RET"
+	RET="Could not verify password for '$USERID'. Nothing done."
+	echo $RET
+	logger -t gosa-sync -p warning "$RET"
 fi
 
 rm "$TMPFILE"

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



More information about the debian-edu-commits mailing list