- add patches from bug 1038356.

This commit is contained in:
Ian Kent 2013-12-24 17:34:59 +08:00
parent c7d149a7a9
commit a8a463576e
5 changed files with 153 additions and 1 deletions

View File

@ -0,0 +1,34 @@
autofs-5.0.8 - fix fix ipv6 libtirpc getport
From: Ian Kent <raven@themaw.net>
Remove a duplicated case entry and remove redundant check, since it
can never be reached, in rpc_rpcb_getport().
---
lib/rpc_subs.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/lib/rpc_subs.c b/lib/rpc_subs.c
index 9d5b2f5..cfb63d2 100644
--- a/lib/rpc_subs.c
+++ b/lib/rpc_subs.c
@@ -524,7 +524,6 @@ static enum clnt_stat rpc_rpcb_getport(CLIENT *client,
if (rpcerr.re_vers.low > RPCBVERS4)
return status;
continue;
- case RPC_PROCUNAVAIL:
case RPC_PROGUNAVAIL:
continue;
default:
@@ -533,10 +532,7 @@ static enum clnt_stat rpc_rpcb_getport(CLIENT *client,
}
}
- if (s_port == 0)
- return RPC_PROGNOTREGISTERED;
-
- return RPC_PROCUNAVAIL;
+ return RPC_PROGNOTREGISTERED;
}
static enum clnt_stat rpc_getport(struct conn_info *info,

View File

@ -0,0 +1,32 @@
autofs-5.0.8 - fix rpc_portmap_getport() proto not set
From: Ian Kent <raven@themaw.net>
Recent changes to fix libtirpc usage problems when getting a server
exports list cause later server probing to fail.
When getting an exports list a new rpc client is always created for
the query, which includes setting the protocol in the parameters
structure. But when probing availability the client is reused where
possible and the protocol is not set in the parameters structure in
this case.
The rpc_portmap_getport() changes require that the protocol is set
in oder to function.
---
lib/rpc_subs.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/rpc_subs.c b/lib/rpc_subs.c
index cfb63d2..7c99ea8 100644
--- a/lib/rpc_subs.c
+++ b/lib/rpc_subs.c
@@ -877,6 +877,8 @@ int rpc_portmap_getport(struct conn_info *info,
memset(&pmap_info, 0, sizeof(struct conn_info));
+ pmap_info.proto = proto;
+
if (proto == IPPROTO_TCP)
pmap_info.timeout.tv_sec = PMAP_TOUT_TCP;
else

View File

@ -0,0 +1,41 @@
autofs-5.0.8 - fix ipv6 link local address handling
From: Ian Kent <raven@themaw.net>
Stop the validate_location() function from choking on link local
ipv6 addresses.
---
lib/rpc_subs.c | 6 ++++++
modules/parse_sun.c | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/lib/rpc_subs.c b/lib/rpc_subs.c
index 2365b6e..9d5b2f5 100644
--- a/lib/rpc_subs.c
+++ b/lib/rpc_subs.c
@@ -669,6 +669,12 @@ static int create_client(struct conn_info *info, CLIENT **client)
goto done;
if (ret == -EHOSTUNREACH)
goto out_close;
+ if (ret == -EINVAL) {
+ char buf[MAX_ERR_BUF];
+ char *estr = strerror_r(-ret, buf, MAX_ERR_BUF);
+ error(LOGOPT_ANY, "connect() failed: %s", estr);
+ goto out_close;
+ }
if (!info->client && fd != RPC_ANYSOCK) {
close(fd);
diff --git a/modules/parse_sun.c b/modules/parse_sun.c
index 30820b5..e5a4def 100644
--- a/modules/parse_sun.c
+++ b/modules/parse_sun.c
@@ -862,7 +862,7 @@ static int validate_location(unsigned int logopt, char *loc)
*ptr == '-' || *ptr == '.' || *ptr == '_' ||
*ptr == ',' || *ptr == '(' || *ptr == ')' ||
*ptr == '#' || *ptr == '@' || *ptr == ':' ||
- *ptr == '[' || *ptr == ']')) {
+ *ptr == '[' || *ptr == ']' || *ptr == '%')) {
error(logopt, "invalid character \"%c\" "
"found in location %s", *ptr, loc);
return 0;

View File

@ -0,0 +1,31 @@
autofs-5.0.8 - get_nfs_info() should query portmapper if port is not given
From: Scott Mayhew <smayhew@redhat.com>
It shouldn't just assume it can use port 2049.
Signed-off-by: Scott Mayhew <smayhew@redhat.com>
---
modules/replicated.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/modules/replicated.c b/modules/replicated.c
index 5fdd9d9..2463235 100644
--- a/modules/replicated.c
+++ b/modules/replicated.c
@@ -444,9 +444,12 @@ static unsigned int get_nfs_info(unsigned logopt, struct host *host,
host->name, proto, version);
rpc_info->proto = proto;
- if (port < 0)
- rpc_info->port = NFS_PORT;
- else if (port > 0)
+ if (port < 0) {
+ if (version & NFS4_REQUESTED)
+ rpc_info->port = NFS_PORT;
+ else
+ port = 0;
+ } else if (port > 0)
rpc_info->port = port;
memset(&parms, 0, sizeof(struct pmap));

View File

@ -8,7 +8,7 @@
Summary: A tool for automatically mounting and unmounting filesystems
Name: autofs
Version: 5.0.8
Release: 4%{?dist}
Release: 5%{?dist}
Epoch: 1
License: GPLv2+
Group: System Environment/Daemons
@ -20,6 +20,10 @@ Patch4: autofs-5.0.8-allow-with-systemd-to-take-a-path-arg.patch
Patch5: autofs-5.0.8-fix-allow-with-systemd-to-take-a-path-arg.patch
Patch6: autofs-5.0.8-fix-WITH_LIBTIRPC-function-name.patch
Patch7: autofs-5.0.8-fix-ipv6-libtirpc-getport.patch
Patch8: autofs-5.0.8-fix-ipv6-link-local-address-handling.patch
Patch9: autofs-5.0.8-fix-fix-ipv6-libtirpc-getport.patch
Patch10: autofs-5.0.8-get_nfs_info-should-query-portmapper-if-port-is-not-given.patch
Patch11: autofs-5.0.8-fix-ipv6-libtirpc-getport-proto-not-set.patch
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%if %{with_systemd}
BuildRequires: systemd-units
@ -84,6 +88,10 @@ echo %{version}-%{release} > .version
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%build
LDFLAGS=-Wl,-z,now
@ -175,6 +183,12 @@ fi
%dir /etc/auto.master.d
%changelog
* Tue Dec 24 2013 Ian Kent <ikent@redhat.com> - 1:5.0.8-5
- fix ipv6 link local address handling.
- fix fix ipv6 libtirpc getport.
- get_nfs_info() should query portmapper if port is not given.
- fix rpc_portmap_getport() proto not set.
* Mon Nov 25 2013 Ian Kent <ikent@redhat.com> - 1:5.0.8-4
- allow --with-systemd to take a path arg.
- fix WITH_LIBTIRPC function name.