[ypserv] Return proper error code when map file opening did not succeeded RHBZ#1004110
Honza Horak
hhorak at fedoraproject.org
Wed Sep 4 11:24:59 UTC 2013
commit 10cbfc5895888130e3e27e3a6b548a7dc66045a4
Author: Honza HorĂ¡k <hhorak at redhat.com>
Date: Wed Sep 4 13:24:23 2013 +0200
Return proper error code when map file opening did not succeeded
RHBZ#1004110
ypserv-tcopenfail.patch | 23 +++++++++++++++++++++++
ypserv.spec | 8 +++++++-
2 files changed, 30 insertions(+), 1 deletions(-)
---
diff --git a/ypserv-tcopenfail.patch b/ypserv-tcopenfail.patch
new file mode 100644
index 0000000..bae0ec5
--- /dev/null
+++ b/ypserv-tcopenfail.patch
@@ -0,0 +1,23 @@
+When tcbdbopen fails to open a database file wrong pointer is returned
+instead of NULL pointer.
+
+Patch by Edgar Hoch
+
+RHBZ#1004110
+
+--- ypserv-2.31/lib/yp_db.c.orig 2013-04-10 16:42:21.000000000 +0200
++++ ypserv-2.31/lib/yp_db.c 2013-09-04 02:38:04.515428554 +0200
+@@ -181,6 +181,12 @@
+ }
+ else if (debug_flag)
+ log_msg ("\t\t->Returning OK!");
++ if ( !isok )
++ {
++ /* DB not successful opened. Close database object and set return value to NULL. */
++ tcbdbdel (dbp);
++ dbp = NULL;
++ }
+ }
+ else
+ {
+
diff --git a/ypserv.spec b/ypserv.spec
index 4055bc2..245a799 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.31
-Release: 4%{?dist}
+Release: 5%{?dist}
License: GPLv2
Group: System Environment/Daemons
Source0: http://www.linux-nis.org/download/ypserv/ypserv-%{version}.tar.bz2
@@ -31,6 +31,7 @@ Patch7: ypserv-2.24-aliases.patch
Patch8: ypserv-2.27-confpost.patch
Patch9: ypserv-2.29-relro.patch
Patch10: ypserv-2.31-netgrprecur.patch
+Patch11: ypserv-tcopenfail.patch
BuildRequires: tokyocabinet-devel
BuildRequires: systemd
@@ -66,6 +67,7 @@ machines.
%patch8 -p1 -b .confpost
%patch9 -p1 -b .relro
%patch10 -p1 -b .netgrprecur
+%patch11 -p1 -b .tcopenfail
autoreconf
@@ -222,6 +224,10 @@ fi
%{_includedir}/*/*
%changelog
+* Wed Sep 4 2013 Honza Horak <hhorak at redhat.com> - 2.31-5
+- Return proper error code when map file opening did not succeeded
+ RHBZ#1004110
+
* Mon Jul 29 2013 Honza Horak <hhorak at redhat.com> - 2.31-4
- Remove systemd-units and systemd-sysv requirements
- Clean-up SysV init conversion code
More information about the scm-commits
mailing list