Merge branch 'f17'

Conflicts:
	autofs.spec

- fix SEGV in libtirpc when using internal autofs hosts map.
This commit is contained in:
Ian Kent 2012-05-23 11:27:14 +08:00
commit db4990362f
3 changed files with 130 additions and 2 deletions

View File

@ -0,0 +1,70 @@
autofs-5.0.6 - fix initialization in rpc create_client()
From: Ian Kent <ikent@redhat.com>
Sometimes the RPC function create_client() gets a non-null stack
variable passed in which can cause a SEGV. Fix it by initializing
the passed in variable.
---
CHANGELOG | 1 +
lib/rpc_subs.c | 11 ++++++++---
2 files changed, 9 insertions(+), 3 deletions(-)
--- autofs-5.0.6.orig/CHANGELOG
+++ autofs-5.0.6/CHANGELOG
@@ -40,6 +40,7 @@
- fix sss wildcard match.
- fix dlopen() error handling in sss module.
- fix configure string length tests for sss library.
+- fix initialization in rpc create_client().
28/06/2011 autofs-5.0.6
-----------------------
--- autofs-5.0.6.orig/lib/rpc_subs.c
+++ autofs-5.0.6/lib/rpc_subs.c
@@ -316,6 +316,7 @@ static int create_client(struct conn_inf
int fd, ret;
fd = RPC_ANYSOCK;
+ *client = NULL;
if (info->client) {
if (!clnt_control(info->client, CLGET_FD, (char *) &fd)) {
@@ -344,7 +345,10 @@ static int create_client(struct conn_inf
memset(&hints, 0, sizeof(hints));
hints.ai_flags = AI_ADDRCONFIG;
hints.ai_family = AF_UNSPEC;
- hints.ai_socktype = SOCK_DGRAM;
+ if (info->proto->p_proto == IPPROTO_UDP)
+ hints.ai_socktype = SOCK_DGRAM;
+ else
+ hints.ai_socktype = SOCK_STREAM;
ret = getaddrinfo(info->host, NULL, &hints, &ai);
if (ret) {
@@ -377,12 +381,13 @@ static int create_client(struct conn_inf
freeaddrinfo(ai);
+done:
if (!*client) {
info->client = NULL;
ret = -ENOTCONN;
goto out_close;
}
-done:
+
/* Close socket fd on destroy, as is default for rpcowned fds */
if (!clnt_control(*client, CLSET_FD_CLOSE, NULL)) {
clnt_destroy(*client);
@@ -800,7 +805,7 @@ static int rpc_get_exports_proto(struct
(xdrproc_t) xdr_void, NULL,
(xdrproc_t) xdr_exports, (caddr_t) exp,
info->timeout);
- if (status != RPC_PROGVERSMISMATCH)
+ if (status == RPC_SUCCESS)
break;
if (++vers_entry > 2)
break;

View File

@ -0,0 +1,45 @@
autofs-5.0.6 - fix libtirpc name clash
From: Ian Kent <ikent@redhat.com>
The tirpc function auth_destroy() is a macro definition in tirpc/rpc/auth.h
which includes an unconditional call to a function log_debug() which clashes
with an autofs function of the same name and has a different call signature.
To fix it redefine auth_destroy() and exclude the debug log call.
---
CHANGELOG | 1 +
lib/rpc_subs.c | 10 ++++++++++
2 files changed, 11 insertions(+)
--- autofs-5.0.6.orig/CHANGELOG
+++ autofs-5.0.6/CHANGELOG
@@ -41,6 +41,7 @@
- fix dlopen() error handling in sss module.
- fix configure string length tests for sss library.
- fix initialization in rpc create_client().
+- fix libtirpc name clash.
28/06/2011 autofs-5.0.6
-----------------------
--- autofs-5.0.6.orig/lib/rpc_subs.c
+++ autofs-5.0.6/lib/rpc_subs.c
@@ -34,6 +34,16 @@
#include <pthread.h>
#include <poll.h>
+#ifdef WITH_LIBTIRPC
+#undef auth_destroy
+#define auth_destroy(auth) \
+ do { \
+ int refs; \
+ if ((refs = auth_put((auth))) == 0) \
+ ((*((auth)->ah_ops->ah_destroy))(auth));\
+ } while (0)
+#endif
+
#include "mount.h"
#include "rpc_subs.h"
#include "automount.h"

View File

@ -8,7 +8,7 @@
Summary: A tool for automatically mounting and unmounting filesystems Summary: A tool for automatically mounting and unmounting filesystems
Name: autofs Name: autofs
Version: 5.0.6 Version: 5.0.6
Release: 16%{?dist} Release: 19%{?dist}
Epoch: 1 Epoch: 1
License: GPLv2+ License: GPLv2+
Group: System Environment/Daemons Group: System Environment/Daemons
@ -57,6 +57,8 @@ Patch41: autofs-5.0.6-fix-segfault-in-get_query_dn.patch
Patch42: autofs-5.0.6-fix-sss-wildcard-match.patch Patch42: autofs-5.0.6-fix-sss-wildcard-match.patch
Patch43: autofs-5.0.6-fix-dlopen-error-handling-in-sss-module.patch Patch43: autofs-5.0.6-fix-dlopen-error-handling-in-sss-module.patch
Patch44: autofs-5.0.6-fix-configure-string-length-tests.patch Patch44: autofs-5.0.6-fix-configure-string-length-tests.patch
Patch45: autofs-5.0.6-fix-initialization-in-rpc-create_client.patch
Patch46: autofs-5.0.6-fix-libtirpc-name-clash.patch
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%if %{with_systemd} %if %{with_systemd}
BuildRequires: systemd-units BuildRequires: systemd-units
@ -157,6 +159,8 @@ echo %{version}-%{release} > .version
%patch42 -p1 %patch42 -p1
%patch43 -p1 %patch43 -p1
%patch44 -p1 %patch44 -p1
%patch45 -p1
%patch46 -p1
%build %build
#CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr --libdir=%{_libdir} #CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr --libdir=%{_libdir}
@ -259,7 +263,16 @@ fi
%dir /etc/auto.master.d %dir /etc/auto.master.d
%changelog %changelog
* Tue May 2 2012 Ian Kent <ikent@redhat.com> - 1:5.0.6-16 * Tue May 22 2012 Ian Kent <ikent@redhat.com> - 1:5.0.6-19
- fix libtirpc name clash (bz821847).
* Tue May 22 2012 Ian Kent <ikent@redhat.com> - 1:5.0.6-18
- update patch fix initialization in rpc create_client() (bz821847).
* Wed May 16 2012 Ian Kent <ikent@redhat.com> - 1:5.0.6-17
- fix initialization in rpc create_client() (bz821847).
* Tue May 1 2012 Ian Kent <ikent@redhat.com> - 1:5.0.6-16
- add libsss_autofs as a build dependency. - add libsss_autofs as a build dependency.
* Tue May 1 2012 Ian Kent <ikent@redhat.com> - 1:5.0.6-15 * Tue May 1 2012 Ian Kent <ikent@redhat.com> - 1:5.0.6-15