[debian-edu-commits] debian-edu/ 02/02: shutdown-at-night/clients-generator: Empty NIS netgroups for s-a-n-wakeup-hosts and s-a-n-wakeup-hosts-blacklists are now recognized as empty lists. Thus, all systems can be blocked from waking-up by placing an empty NIS netgroup s-a-n-wakeup-hosts into LDAP.

Mike Gabriel sunweaver at debian.org
Fri Feb 26 11:07:56 UTC 2016


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 c2fd2972b598722aa4a4c00c6ca3fad6f7c7a459
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Fri Feb 26 12:07:38 2016 +0100

    shutdown-at-night/clients-generator: Empty NIS netgroups for s-a-n-wakeup-hosts and s-a-n-wakeup-hosts-blacklists are now recognized as empty lists. Thus, all systems can be blocked from waking-up by placing an empty NIS netgroup s-a-n-wakeup-hosts into LDAP.
---
 debian/changelog                        | 4 ++++
 etc/shutdown-at-night/clients-generator | 5 ++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index a5a5738..d413fd9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -74,6 +74,10 @@ debian-edu-config (1.819) UNRELEASED; urgency=low
     differentiate between non-existent and non-kerberized accounts.
   * Don't create home dir and Kerberos principal for GOsa user template
     account. (Closes: #815040).
+  * shutdown-at-night/clients-generator: Empty NIS netgroups for
+    s-a-n-wakeup-hosts and s-a-n-wakeup-hosts-blacklists are now recognized
+    as empty lists. Thus, all systems can be blocked from waking-up by placing
+    an empty NIS netgroup s-a-n-wakeup-hosts into LDAP.
 
  -- Petter Reinholdtsen <pere at debian.org>  Sat, 16 May 2015 23:12:06 +0200
 
diff --git a/etc/shutdown-at-night/clients-generator b/etc/shutdown-at-night/clients-generator
index 6c4ad31..4894bee 100755
--- a/etc/shutdown-at-night/clients-generator
+++ b/etc/shutdown-at-night/clients-generator
@@ -14,7 +14,7 @@ my @host_whitelist = `netgroup -h shutdown-at-night-hosts 2>/dev/null || true`;
 my @host_blacklist = `netgroup -h shutdown-at-night-hosts-blacklist 2>/dev/null || true`;
 
 my @wakeup_host_whitelist = `netgroup -h shutdown-at-night-wakeup-hosts 2>/dev/null || printf "NETGROUP-NOT-FOUND"`;
-if((exists $wakeup_host_whitelist[0]) && ($wakeup_host_whitelist[0] ne "NETGROUP-NOT-FOUND")) {
+if(((exists $wakeup_host_whitelist[0]) && ($wakeup_host_whitelist[0] ne "NETGROUP-NOT-FOUND")) || (scalar(@wakeup_host_whitelist) == 0)) {
     @host_whitelist = @wakeup_host_whitelist;
     # when wakeup-in-the-morning-hosts netgroup is used, expect its own blacklist pendant (i.e., netgroup no-wakeup-in-the-morning-hosts)
     @host_blacklist = ();
@@ -22,7 +22,7 @@ if((exists $wakeup_host_whitelist[0]) && ($wakeup_host_whitelist[0] ne "NETGROUP
 
 # only use the no-wakeup-in-the-morning
 my @wakeup_host_blacklist = `netgroup -h shutdown-at-night-wakeup-hosts-blacklist 2>/dev/null || printf "NETGROUP-NOT-FOUND"`;
-if((exists $wakeup_host_blacklist[0]) && ($wakeup_host_blacklist[0] ne "NETGROUP-NOT-FOUND")) {
+if(((exists $wakeup_host_blacklist[0]) && ($wakeup_host_blacklist[0] ne "NETGROUP-NOT-FOUND")) || (scalar(@wakeup_host_blacklist) == 0)) {
     @host_blacklist = @wakeup_host_blacklist;
 }
 
@@ -32,7 +32,6 @@ map { $hostmap{$_} = 1; } @host_whitelist;
 foreach my $blacklisted_host (@host_blacklist) {
     if($blacklisted_host) { $hostmap{$blacklisted_host} = 0; }
 }
-
 # comment out for better debugging...
 #print STDERR "$_ $hostmap{$_}\n" for (keys %hostmap);
 

-- 
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