Updated to the latest RC release: nfs-utils-1-3-4-rc3

Signed-off-by: Steve Dickson <steved@redhat.com>
This commit is contained in:
Steve Dickson 2016-01-16 17:04:53 -05:00
parent 2583527e55
commit 1b2b7ba376
3 changed files with 146 additions and 83 deletions

View File

@ -1,55 +0,0 @@
commit 4b5bd85481a45957122357feebfcd514550fc219
Author: Frank Sorenson <sorenson@redhat.com>
Date: Wed Dec 16 10:12:38 2015 -0500
mountd: fix netgroup lookup for short hostnames
Commit 9a92ef6f to add netgroup lookup of resolvable
IP addresses inadvertently broke the netgroup
check for short hostnames.
This patch fixes that breakage by changing the IP address
lookup to use a separate variable.
Signed-off-by: Frank Sorenson <sorenson@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
diff --git a/support/export/client.c b/support/export/client.c
index af9e6bb..2346f99 100644
--- a/support/export/client.c
+++ b/support/export/client.c
@@ -639,7 +639,7 @@ check_netgroup(const nfs_client *clp, const struct addrinfo *ai)
const char *netgroup = clp->m_hostname + 1;
struct addrinfo *tmp = NULL;
struct hostent *hp;
- char *dot, *hname;
+ char *dot, *hname, *ip;
int i, match;
match = 0;
@@ -687,19 +687,16 @@ check_netgroup(const nfs_client *clp, const struct addrinfo *ai)
}
/* check whether the IP itself is in the netgroup */
- for (tmp = (struct addrinfo *)ai ; tmp != NULL ; tmp = tmp->ai_next) {
- free(hname);
- hname = calloc(INET6_ADDRSTRLEN, 1);
-
- if (inet_ntop(tmp->ai_family, &(((struct sockaddr_in *)tmp->ai_addr)->sin_addr), hname, INET6_ADDRSTRLEN) != hname) {
- xlog(D_GENERAL, " %s: unable to inet_ntop addrinfo %p: %m", __func__, tmp, errno);
- goto out;
- }
- if (innetgr(netgroup, hname, NULL, NULL)) {
+ ip = calloc(INET6_ADDRSTRLEN, 1);
+ if (inet_ntop(ai->ai_family, &(((struct sockaddr_in *)ai->ai_addr)->sin_addr), ip, INET6_ADDRSTRLEN) == ip) {
+ if (innetgr(netgroup, ip, NULL, NULL)) {
+ free(hname);
+ hname = ip;
match = 1;
goto out;
}
}
+ free(ip);
/* Okay, strip off the domain (if we have one) */
dot = strchr(hname, '.');

View File

@ -16,44 +16,58 @@ index b7de636..27368ff 100644
AC_SUBST(LIBTIRPC)
diff --git a/support/export/client.c b/support/export/client.c
index 95156f0..af9e6bb 100644
index 95156f0..2346f99 100644
--- a/support/export/client.c
+++ b/support/export/client.c
@@ -686,6 +686,21 @@ check_netgroup(const nfs_client *clp, const struct addrinfo *ai)
@@ -639,7 +639,7 @@ check_netgroup(const nfs_client *clp, const struct addrinfo *ai)
const char *netgroup = clp->m_hostname + 1;
struct addrinfo *tmp = NULL;
struct hostent *hp;
- char *dot, *hname;
+ char *dot, *hname, *ip;
int i, match;
match = 0;
@@ -686,6 +686,18 @@ check_netgroup(const nfs_client *clp, const struct addrinfo *ai)
}
}
+ /* check whether the IP itself is in the netgroup */
+ for (tmp = (struct addrinfo *)ai ; tmp != NULL ; tmp = tmp->ai_next) {
+ free(hname);
+ hname = calloc(INET6_ADDRSTRLEN, 1);
+
+ if (inet_ntop(tmp->ai_family, &(((struct sockaddr_in *)tmp->ai_addr)->sin_addr), hname, INET6_ADDRSTRLEN) != hname) {
+ xlog(D_GENERAL, " %s: unable to inet_ntop addrinfo %p: %m", __func__, tmp, errno);
+ goto out;
+ }
+ if (innetgr(netgroup, hname, NULL, NULL)) {
+ ip = calloc(INET6_ADDRSTRLEN, 1);
+ if (inet_ntop(ai->ai_family, &(((struct sockaddr_in *)ai->ai_addr)->sin_addr), ip, INET6_ADDRSTRLEN) == ip) {
+ if (innetgr(netgroup, ip, NULL, NULL)) {
+ free(hname);
+ hname = ip;
+ match = 1;
+ goto out;
+ }
+ }
+ free(ip);
+
/* Okay, strip off the domain (if we have one) */
dot = strchr(hname, '.');
if (dot == NULL)
diff --git a/support/export/hostname.c b/support/export/hostname.c
index 169baa5..7a44d42 100644
index 169baa5..4daabe9 100644
--- a/support/export/hostname.c
+++ b/support/export/hostname.c
@@ -134,6 +134,8 @@ host_pton(const char *paddr)
@@ -134,12 +134,14 @@ host_pton(const char *paddr)
break;
}
return ai;
+ case EAI_NONAME:
+ break;
case EAI_SYSTEM:
xlog(D_GENERAL, "%s: failed to convert %s: (%d) %m",
- xlog(D_GENERAL, "%s: failed to convert %s: (%d) %m",
+ xlog(L_WARNING, "%s: failed to convert %s: (%d) %m",
__func__, paddr, errno);
break;
default:
- xlog(D_GENERAL, "%s: failed to convert %s: %s",
+ xlog(L_WARNING, "%s: failed to convert %s: %s",
__func__, paddr, gai_strerror(error));
break;
}
diff --git a/support/include/nfslib.h b/support/include/nfslib.h
index c9a13cb..ddd71ac 100644
--- a/support/include/nfslib.h
@ -101,6 +115,40 @@ index 3391eff..343e80b 100644
dup2(pipefds[1], 3);
pipefds[1] = 3;
closeall(4);
diff --git a/support/nfs/rpc_socket.c b/support/nfs/rpc_socket.c
index 2900d18..bdf6d2f 100644
--- a/support/nfs/rpc_socket.c
+++ b/support/nfs/rpc_socket.c
@@ -185,7 +185,7 @@ static int nfs_connect_nb(const int fd, const struct sockaddr *sap,
* use it later.
*/
ret = connect(fd, sap, salen);
- if (ret < 0 && errno != EINPROGRESS) {
+ if (ret < 0 && errno != EINPROGRESS && errno != EINTR) {
ret = -1;
goto done;
}
@@ -197,10 +197,16 @@ static int nfs_connect_nb(const int fd, const struct sockaddr *sap,
FD_ZERO(&rset);
FD_SET(fd, &rset);
- ret = select(fd + 1, NULL, &rset, NULL, timeout);
- if (ret <= 0) {
- if (ret == 0)
- errno = ETIMEDOUT;
+ while ((ret = select(fd + 1, NULL, &rset, NULL, timeout)) < 0) {
+ if (errno != EINTR) {
+ ret = -1;
+ goto done;
+ } else {
+ continue;
+ }
+ }
+ if (ret == 0) {
+ errno = ETIMEDOUT;
ret = -1;
goto done;
}
diff --git a/support/nfs/svc_create.c b/support/nfs/svc_create.c
index 5cb5ff6..ef7ff05 100644
--- a/support/nfs/svc_create.c
@ -834,7 +882,7 @@ index c809f78..d45658e 100644
.Op Fl c Ar path
.Sh DESCRIPTION
diff --git a/utils/mount/network.c b/utils/mount/network.c
index b5ed850..ebc39d3 100644
index b5ed850..7240ca7 100644
--- a/utils/mount/network.c
+++ b/utils/mount/network.c
@@ -92,6 +92,7 @@ static const char *nfs_version_opttbl[] = {
@ -845,7 +893,27 @@ index b5ed850..ebc39d3 100644
NULL,
};
@@ -1272,7 +1273,11 @@ nfs_nfs_version(struct mount_options *options, struct nfs_version *version)
@@ -793,6 +794,7 @@ int start_statd(void)
if (stat(START_STATD, &stb) == 0) {
if (S_ISREG(stb.st_mode) && (stb.st_mode & S_IXUSR)) {
int cnt = STATD_TIMEOUT * 10;
+ int status = 0;
const struct timespec ts = {
.tv_sec = 0,
.tv_nsec = 100000000,
@@ -807,7 +809,10 @@ int start_statd(void)
progname, strerror(errno));
break;
default: /* parent */
- waitpid(pid, NULL,0);
+ if (waitpid(pid, &status,0) == pid &&
+ status == 0)
+ /* assume it worked */
+ return 1;
break;
}
while (1) {
@@ -1272,7 +1277,11 @@ nfs_nfs_version(struct mount_options *options, struct nfs_version *version)
if (!(version->major = strtol(version_val, &cptr, 10)))
goto ret_error;
@ -858,6 +926,18 @@ index b5ed850..ebc39d3 100644
version->v_mode = V_SPECIFIC;
if (*cptr == '.') {
@@ -1626,7 +1635,10 @@ int nfs_options2pmap(struct mount_options *options,
return 0;
if (!nfs_nfs_version(options, &version))
return 0;
- nfs_pmap->pm_vers = version.major;
+ if (version.v_mode == V_DEFAULT)
+ nfs_pmap->pm_vers = 0;
+ else
+ nfs_pmap->pm_vers = version.major;
if (!nfs_nfs_protocol(options, &nfs_pmap->pm_prot))
return 0;
if (!nfs_nfs_port(options, &nfs_pmap->pm_port))
diff --git a/utils/mount/parse_dev.c b/utils/mount/parse_dev.c
index d64b83d..0d3bcb9 100644
--- a/utils/mount/parse_dev.c
@ -872,6 +952,20 @@ index d64b83d..0d3bcb9 100644
return nfs_pdn_nomem_err();
}
}
diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index c8f5a6d..86829a9 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -841,6 +841,9 @@ check_result:
case EPROTONOSUPPORT:
/* A clear indication that the server or our
* client does not support NFS version 4 and minor */
+ case EINVAL:
+ /* A less clear indication that our client
+ * does not support NFSv4 minor version. */
if (mi->version.v_mode == V_GENERAL &&
mi->version.minor == 0)
return result;
diff --git a/utils/mountd/auth.c b/utils/mountd/auth.c
index 330cab5..894a7a5 100644
--- a/utils/mountd/auth.c
@ -987,7 +1081,7 @@ index 507193b..15b4a51 100644
xlog_errno(rc, "Unable to create name to user id mappings.");
return EXIT_FAILURE;
diff --git a/utils/nfsstat/nfsstat.c b/utils/nfsstat/nfsstat.c
index 9f481db..b67f0aa 100644
index 9f481db..8376347 100644
--- a/utils/nfsstat/nfsstat.c
+++ b/utils/nfsstat/nfsstat.c
@@ -31,8 +31,8 @@ enum {
@ -996,12 +1090,12 @@ index 9f481db..b67f0aa 100644
SRVPROC4_SZ = 2,
- CLTPROC4_SZ = 49,
- SRVPROC4OPS_SZ = 59,
+ CLTPROC4_SZ = 60,
+ CLTPROC4_SZ = 59,
+ SRVPROC4OPS_SZ = 71,
};
static unsigned int srvproc2info[SRVPROC2_SZ+2],
@@ -127,19 +127,31 @@ static const char * nfscltproc4name[CLTPROC4_SZ] = {
@@ -127,19 +127,30 @@ static const char * nfscltproc4name[CLTPROC4_SZ] = {
"remove", "rename", "link", "symlink", "create", "pathconf",
"statfs", "readlink", "readdir", "server_caps", "delegreturn", "getacl",
"setacl", "fs_locations",
@ -1017,12 +1111,11 @@ index 9f481db..b67f0aa 100644
- "get_lease_t",
+ "get_lease_time",
"reclaim_comp",
- "layoutget",
"layoutget",
"getdevinfo",
+ "layoutget",
"layoutcommit",
"layoutreturn",
"getdevlist",
- "getdevlist",
+ "secinfo_no",
+ "test_stateid",
+ "free_stateid",
@ -1038,7 +1131,7 @@ index 9f481db..b67f0aa 100644
};
static const char * nfssrvproc4opname[SRVPROC4OPS_SZ] = {
@@ -170,6 +182,19 @@ static const char * nfssrvproc4opname[SRVPROC4OPS_SZ] = {
@@ -170,6 +181,19 @@ static const char * nfssrvproc4opname[SRVPROC4OPS_SZ] = {
"want_deleg",
"destroy_clid",
"reclaim_comp",
@ -1058,7 +1151,7 @@ index 9f481db..b67f0aa 100644
};
#define LABEL_srvnet "Server packet stats:\n"
@@ -823,13 +848,13 @@ print_callstats(const char *hdr, const char **names,
@@ -823,13 +847,13 @@ print_callstats(const char *hdr, const char **names,
total += info[i];
if (!total)
total = 1;
@ -1193,6 +1286,30 @@ index 45c84f9..c4f6364 100644
return sockfd;
}
diff --git a/utils/statd/start-statd b/utils/statd/start-statd
index 14369e5..19e6eb2 100755
--- a/utils/statd/start-statd
+++ b/utils/statd/start-statd
@@ -6,11 +6,19 @@
# site.
PATH="/sbin:/usr/sbin:/bin:/usr/bin"
+if [ -s /var/run/rpc.statd.pid ] &&
+ [ 1`cat /var/run/rpc.statd.pid` -gt 1 ] &&
+ kill -0 `cat /var/run/rpc.statd.pid` > /dev/null 2>&1
+then
+ # statd already running - must have been slow to respond.
+ exit 0
+fi
# First try systemd if it's installed.
if [ -d /run/systemd/system ]; then
# Quit only if the call worked.
systemctl start rpc-statd.service && exit
fi
+cd /
# Fall back to launching it ourselves.
exec rpc.statd --no-notify
diff --git a/utils/statd/statd.c b/utils/statd/statd.c
index 2b7a167..e5b4c98 100644
--- a/utils/statd/statd.c

View File

@ -2,7 +2,7 @@ Summary: NFS utilities and supporting clients and daemons for the kernel NFS ser
Name: nfs-utils
URL: http://sourceforge.net/projects/nfs
Version: 1.3.3
Release: 6.rc2%{?dist}
Release: 6.rc3%{?dist}
Epoch: 1
# group all 32bit related archs
@ -15,8 +15,7 @@ Source2: nfs.sysconfig
Source3: nfs-utils_env.sh
Source4: lockd.conf
Patch001: nfs-utils-1.3.4-rc2.patch
Patch002: nfs-utils-1.3.3-netgroup-fix.patch
Patch001: nfs-utils-1.3.4-rc3.patch
Patch100: nfs-utils-1.2.1-statdpath-man.patch
Patch101: nfs-utils-1.2.1-exp-subtree-warn-off.patch
@ -76,7 +75,6 @@ This package also contains the mount.nfs and umount.nfs program.
%setup -q
%patch001 -p1
%patch002 -p1
%patch100 -p1
%patch101 -p1
@ -293,6 +291,9 @@ fi
/sbin/umount.nfs4
%changelog
* Sat Jan 16 2016 Steve Dickson <steved@redhat.com> 1.3.3-6.rc3
- Updated to the latest RC release: nfs-utils-1-3-4-rc3
* Wed Dec 16 2015 Steve Dickson <steved@redhat.com> 1.3.3-6.rc2
- mountd: fix netgroup lookup for short hostnames (bz 1284079)