[ypserv] Require hostname for domainname in pre
Honza Horak
hhorak at fedoraproject.org
Fri Sep 5 15:36:41 UTC 2014
commit 3bf9a6bb98a6bc49387e04c90d3c63db53b5a659
Author: Honza Horak <hhorak at redhat.com>
Date: Fri Sep 5 17:36:15 2014 +0200
Require hostname for domainname in pre
Do not crash in pre if /etc/sysconfig/network is missing
ypserv.spec | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/ypserv.spec b/ypserv.spec
index 950f983..115ece0 100644
--- a/ypserv.spec
+++ b/ypserv.spec
@@ -4,7 +4,7 @@ Summary: The NIS (Network Information Service) server
Url: http://www.linux-nis.org/nis/ypserv/index.html
Name: ypserv
Version: 2.32.1
-Release: 4%{?dist}
+Release: 5%{?dist}
License: GPLv2
Group: System Environment/Daemons
Source0: http://www.linux-nis.org/download/ypserv/ypserv-%{version}.tar.bz2
@@ -16,6 +16,8 @@ Source5: yppasswdd-pre-setdomain
Requires: gawk, make, portmap, bash >= 2.0
Requires: tokyocabinet
+# requirement for domainname
+Requires(pre): hostname
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
@@ -166,7 +168,7 @@ if [ $1 == 2 ] ; then
fi
# store old domainname and set the correct one
olddomain=`domainname`
- . /etc/sysconfig/network
+ [ -f /etc/sysconfig/network ] $$ . /etc/sysconfig/network
DOMAINNAME=`domainname`
if [ "$olddomain" = "(none)" -o "x$olddomain" = "x" ]; then
if [ -n "$NISDOMAIN" ]; then
@@ -224,6 +226,10 @@ fi
%{_includedir}/rpcsvc
%changelog
+* Fri Sep 05 2014 Honza Horak <hhorak at redhat.com> - 2.32.1-5
+- Require hostname for domainname in pre
+ Do not crash in pre if /etc/sysconfig/network is missing
+
* Thu Aug 21 2014 Kevin Fenzi <kevin at scrye.com> - 2.32.1-4
- Rebuild for rpm bug 1131960
More information about the scm-commits
mailing list