diff --git a/autofs-5.0.8-fix-fix-ipv6-libtirpc-getport.patch b/autofs-5.0.8-fix-fix-ipv6-libtirpc-getport.patch new file mode 100644 index 0000000..70877ca --- /dev/null +++ b/autofs-5.0.8-fix-fix-ipv6-libtirpc-getport.patch @@ -0,0 +1,34 @@ +autofs-5.0.8 - fix fix ipv6 libtirpc getport + +From: Ian Kent + +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, diff --git a/autofs-5.0.8-fix-ipv6-libtirpc-getport-proto-not-set.patch b/autofs-5.0.8-fix-ipv6-libtirpc-getport-proto-not-set.patch new file mode 100644 index 0000000..f335fa5 --- /dev/null +++ b/autofs-5.0.8-fix-ipv6-libtirpc-getport-proto-not-set.patch @@ -0,0 +1,32 @@ +autofs-5.0.8 - fix rpc_portmap_getport() proto not set + +From: Ian Kent + +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 diff --git a/autofs-5.0.8-fix-ipv6-link-local-address-handling.patch b/autofs-5.0.8-fix-ipv6-link-local-address-handling.patch new file mode 100644 index 0000000..d04158c --- /dev/null +++ b/autofs-5.0.8-fix-ipv6-link-local-address-handling.patch @@ -0,0 +1,41 @@ +autofs-5.0.8 - fix ipv6 link local address handling + +From: Ian Kent + +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; diff --git a/autofs-5.0.8-get_nfs_info-should-query-portmapper-if-port-is-not-given.patch b/autofs-5.0.8-get_nfs_info-should-query-portmapper-if-port-is-not-given.patch new file mode 100644 index 0000000..8b8a7f2 --- /dev/null +++ b/autofs-5.0.8-get_nfs_info-should-query-portmapper-if-port-is-not-given.patch @@ -0,0 +1,31 @@ +autofs-5.0.8 - get_nfs_info() should query portmapper if port is not given + +From: Scott Mayhew + +It shouldn't just assume it can use port 2049. + +Signed-off-by: Scott Mayhew +--- + 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)); diff --git a/autofs.spec b/autofs.spec index 4035d55..dae3c38 100644 --- a/autofs.spec +++ b/autofs.spec @@ -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 - 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 - 1:5.0.8-4 - allow --with-systemd to take a path arg. - fix WITH_LIBTIRPC function name.