[debian-edu-commits] debian-edu/ 28/30: Don't use getent passwd, it breaks idem-potency of the postinst script.

Mike Gabriel sunweaver at debian.org
Fri Oct 9 03:44:07 UTC 2015


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

sunweaver pushed a commit to branch multi-distro-support
in repository educlient.

commit 7acdc030e82085fe7d330c9b4ba1af4c05adae8b
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Tue Aug 25 23:57:21 2015 +0200

    Don't use getent passwd, it breaks idem-potency of the postinst script.
---
 debian/educlient.postinst | 4 ++--
 debian/educlient.prerm    | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/debian/educlient.postinst b/debian/educlient.postinst
index aa71806..7833e4d 100755
--- a/debian/educlient.postinst
+++ b/debian/educlient.postinst
@@ -121,9 +121,9 @@ fi
 
 
 # Move UID and GID of the first local user to 500
-USERN="$(getent passwd 1000 | cut -d ":" -f 1)"
+USERN="$(grep :x:1000:1000: /etc/passwd | cut -d ":" -f 1)"
 if [ -n "${USERN}" ]; then
-	HOME="$(getent passwd 1000 | cut -d ":" -f 6)"
+	HOME="$(grep :x:1000:1000: /etc/passwd | cut -d ":" -f 6)"
 	sed -i "s/:x:1000:1000:/:x:500:500/g" /etc/passwd
 	sed -i "s/:x:1000/:x:500/g" /etc/group
 	if which nscd 1>/dev/null; then
diff --git a/debian/educlient.prerm b/debian/educlient.prerm
index 8c3220c..752bdd8 100755
--- a/debian/educlient.prerm
+++ b/debian/educlient.prerm
@@ -47,9 +47,9 @@ cat /etc/debian-edu/educlient.files-* | while read file;
 	done
 
 # Revert first user to UID and GID 1000
-USERN=$(getent passwd 500 | cut -d ":" -f 1)
+USERN="$(grep :x:500:500: /etc/passwd | cut -d ":" -f 1)"
 if [ -n "$USERN" ]; then
-	HOME=$(getent passwd 500 | cut -d ":" -f 6)
+	HOME="$(grep :x:500:500: /etc/passwd | cut -d ":" -f 6)"
 	sed "s/:x:500:500:/:x:1000:1000:/g" /etc/passwd
 	sed "s/:x:500:/:x:1000:/g" /etc/group
 	if which nscd 1>/dev/null; then

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



More information about the debian-edu-commits mailing list