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

[Bug 1435] Shutdown-at-night do not work because ldap group membership names do not match



http://bugs.skolelinux.org/show_bug.cgi?id=1435





--- Comment #1 from Petter Reinholdtsen <pere@hungry.com>  2010-02-01 14:38:23 ---
This patch implement approach 2.

Index: debian/changelog
===================================================================
--- debian/changelog    (revision 59386)
+++ debian/changelog    (working copy)
@@ -1,3 +1,11 @@
+shutdown-at-night (0.8) UNRELEASED; 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@debian.org>  Mon, 01 Feb 2010 14:35:38 +0100
+
 shutdown-at-night (0.7) unstable; urgency=low

   [ Petter Reinholdtsen ]
Index: shutdown-at-night
===================================================================
--- shutdown-at-night   (revision 59386)
+++ shutdown-at-night   (working copy)
@@ -16,7 +16,13 @@
 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() {


-- 
Configure bugmail: http://bugs.skolelinux.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are watching all bug changes.


Reply to: