[debian-edu-commits] debian-edu/ 41/64: Make sure netgroup membership is checked using both the full and short hostname, to work with different netgroup styles (Solves Skolelinux bug #1435).

Mike Gabriel sunweaver at debian.org
Wed Oct 23 09:51:54 UTC 2013


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

sunweaver pushed a commit to branch master
in repository shutdown-at-night.

commit 2489b7788ae33ea75d65cc18e006751fae515260
Author: Petter Reinholdtsen <pere at hungry.com>
Date:   Wed Feb 10 07:45:18 2010 +0000

    Make sure netgroup membership is checked using both the full and
    short hostname, to work with different netgroup styles (Solves
    Skolelinux bug #1435).
    
    git-svn-id: svn+ssh://svn.debian.org/svn/debian-edu/trunk/src/shutdown-at-night@62609 6e500793-9bee-0310-a5b0-9d0909bd054d
---
 debian/changelog  |    8 ++++++++
 shutdown-at-night |    8 +++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 13cd387..273c339 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+shutdown-at-night (0.8~svn62608-1) lenny; urgency=low
+
+  * Make sure netgroup membership is checked using both the full and
+    short hostname, to work with different netgroup styles (Solves
+    Skolelinux bug #1435).
+
+ -- Petter Reinholdtsen <pere at debian.org>  Mon, 01 Feb 2010 14:35:38 +0100
+
 shutdown-at-night (0.7) unstable; urgency=low
 
   [ Petter Reinholdtsen ]
diff --git a/shutdown-at-night b/shutdown-at-night
index 7e32464..84ff577 100755
--- a/shutdown-at-night
+++ b/shutdown-at-night
@@ -16,7 +16,13 @@ hostname="$(uname -n)"
 netgroupname="shutdown-at-night-hosts"
 
 in_netgroup() {
-    innetgr -h "$hostname" "$netgroupname"
+    # Try both long and short name
+    for h in "$(uname -n)" "$(hostname -s)" ; do
+	if innetgr -h "$h" "$netgroupname" ; then
+	    return 0
+	fi
+    done
+    return 1
 }
 
 enabled_for_host() {

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



More information about the debian-edu-commits mailing list