[ypbind] ypbind.init: More effective syntax for #601296

Karel Klíč kklic at fedoraproject.org
Fri Nov 19 20:39:52 UTC 2010


commit 67c56513a553dbce55379ebcde38030bf88de385
Author: Karel Klic <kklic at redhat.com>
Date:   Fri Nov 19 21:39:50 2010 +0100

    ypbind.init: More effective syntax for #601296

 ypbind.init |    3 +--
 ypbind.spec |    7 +++++--
 2 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/ypbind.init b/ypbind.init
index cc18889..f70a15e 100755
--- a/ypbind.init
+++ b/ypbind.init
@@ -66,8 +66,7 @@ start() {
 	if [ -n "$NISDOMAIN" ]; then
 	    action $"domain is '$NISDOMAIN' " domainname $NISDOMAIN
 	else # See if the domain is set in config file
-	    NISDOMAIN=`grep "domain" /etc/yp.conf | grep -v ^# | \
-		awk '{print $2}' | head -1`
+	    NISDOMAIN=`awk '{ if ($1 == "domain") {print $2; exit} }' /etc/yp.conf`
 	    if [ -n "$NISDOMAIN" ]; then
 		action $"domain is '$NISDOMAIN' " \
 		    domainname $NISDOMAIN
diff --git a/ypbind.spec b/ypbind.spec
index 5bbb778..2a428ac 100644
--- a/ypbind.spec
+++ b/ypbind.spec
@@ -1,7 +1,7 @@
 Summary: The NIS daemon which binds NIS clients to an NIS domain
 Name: ypbind
 Version: 1.32
-Release: 2%{?dist}
+Release: 3%{?dist}
 License: GPLv2
 Group: System Environment/Daemons
 Source0: ftp://ftp.us.kernel.org/pub/linux/utils/net/NIS/ypbind-mt-%{version}.tar.bz2
@@ -79,7 +79,10 @@ fi
 %doc README NEWS COPYING
 
 %changelog
-* Fri Nov 19 2010 Karel Klic <kklic at redhat.co,> - 3:1.32-2
+* Fri Nov 19 2010 Karel Klic <kklic at redhat.com> - 3:1.32-3
+- ypbind.init: More effective syntax for #601296.
+
+* Fri Nov 19 2010 Karel Klic <kklic at redhat.com> - 3:1.32-2
 - Modified the chkconfig priorities from 27/73 to 24/76, to move
   ypbind before netfs. This is useful for hosts that mount NFS file
   systems that reside on a server which is resolvable through NIS.


More information about the scm-commits mailing list