aboutsummaryrefslogtreecommitdiffstats
path: root/main/nfs-utils
diff options
context:
space:
mode:
Diffstat (limited to 'main/nfs-utils')
-rw-r--r--main/nfs-utils/0001-conffile-use-standard-uint-_t-and-unsigned-char.patch74
-rw-r--r--main/nfs-utils/0002-Fix-header-include-for-definition-of-NULL.patch27
-rw-r--r--main/nfs-utils/0003-configure.ac-enable-GNU_SOURCE-for-stat64-statfs64.patch30
-rw-r--r--main/nfs-utils/0004-replace-__attribute_malloc__-with-the-more-portable-.patch208
-rw-r--r--main/nfs-utils/0005-mountd-use-standard-dev_t-instead-of-glibc-internals.patch29
-rw-r--r--main/nfs-utils/0006-nfsstat-replace-the-legacy-SA_ONESHOT-with-standard-.patch27
-rw-r--r--main/nfs-utils/0007-Allow-usage-of-getrpcbynumber-when-getrpcbynumber_r-.patch62
-rw-r--r--main/nfs-utils/0008-Only-work-around-glibc-bugs-on-glibc.patch26
-rw-r--r--main/nfs-utils/0009-include-libgen.h-for-basename.patch82
-rw-r--r--main/nfs-utils/0010-exportfs-fix-test-of-NULL-pointer-in-host_pton.patch49
-rw-r--r--main/nfs-utils/APKBUILD55
-rw-r--r--main/nfs-utils/nfs-utils-1.3.1-rc3.patch1086
12 files changed, 6 insertions, 1749 deletions
diff --git a/main/nfs-utils/0001-conffile-use-standard-uint-_t-and-unsigned-char.patch b/main/nfs-utils/0001-conffile-use-standard-uint-_t-and-unsigned-char.patch
deleted file mode 100644
index 2be3602ac7..0000000000
--- a/main/nfs-utils/0001-conffile-use-standard-uint-_t-and-unsigned-char.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From 733f0786ee7fb6091e35827a7ba1c1c96a7b393d Mon Sep 17 00:00:00 2001
-From: Natanael Copa <ncopa@alpinelinux.org>
-Date: Wed, 12 Feb 2014 13:40:36 +0000
-Subject: [PATCH] conffile: use standard uint*_t and unsigned char
-
-Use the standard integer types. This fixes compiling errors with musl
-libc.
-
-Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
----
- support/include/conffile.h | 2 +-
- support/nfs/conffile.c | 14 +++++++-------
- 2 files changed, 8 insertions(+), 8 deletions(-)
-
-diff --git a/support/include/conffile.h b/support/include/conffile.h
-index 05ea5d2..94fb005 100644
---- a/support/include/conffile.h
-+++ b/support/include/conffile.h
-@@ -49,7 +49,7 @@ struct conf_list {
- extern char *conf_path;
-
- extern int conf_begin(void);
--extern int conf_decode_base64(u_int8_t *, u_int32_t *, u_char *);
-+extern int conf_decode_base64(uint8_t *, uint32_t *, unsigned char *);
- extern int conf_end(int, int);
- extern void conf_free_list(struct conf_list *);
- extern struct sockaddr *conf_get_address(char *, char *);
-diff --git a/support/nfs/conffile.c b/support/nfs/conffile.c
-index c3434d5..6b94ec0 100644
---- a/support/nfs/conffile.c
-+++ b/support/nfs/conffile.c
-@@ -72,10 +72,10 @@ TAILQ_HEAD (conf_trans_head, conf_trans) conf_trans_queue;
- /*
- * Radix-64 Encoding.
- */
--static const u_int8_t bin2asc[]
-+static const uint8_t bin2asc[]
- = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-
--static const u_int8_t asc2bin[] =
-+static const uint8_t asc2bin[] =
- {
- 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255,
-@@ -109,10 +109,10 @@ LIST_HEAD (conf_bindings, conf_binding) conf_bindings[256];
-
- static char *conf_addr;
-
--static __inline__ u_int8_t
-+static __inline__ uint8_t
- conf_hash(char *s)
- {
-- u_int8_t hash = 0;
-+ uint8_t hash = 0;
-
- while (*s) {
- hash = ((hash << 1) | (hash >> 7)) ^ tolower (*s);
-@@ -603,10 +603,10 @@ cleanup:
-
- /* Decode a PEM encoded buffer. */
- int
--conf_decode_base64 (u_int8_t *out, u_int32_t *len, u_char *buf)
-+conf_decode_base64 (uint8_t *out, uint32_t *len, unsigned char *buf)
- {
-- u_int32_t c = 0;
-- u_int8_t c1, c2, c3, c4;
-+ uint32_t c = 0;
-+ uint8_t c1, c2, c3, c4;
-
- while (*buf) {
- if (*buf > 127 || (c1 = asc2bin[*buf]) == 255)
---
-2.0.4
-
diff --git a/main/nfs-utils/0002-Fix-header-include-for-definition-of-NULL.patch b/main/nfs-utils/0002-Fix-header-include-for-definition-of-NULL.patch
deleted file mode 100644
index ef359b9759..0000000000
--- a/main/nfs-utils/0002-Fix-header-include-for-definition-of-NULL.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From bf56f9f7a782a8b854f698bf2b452c790ebc2e93 Mon Sep 17 00:00:00 2001
-From: Natanael Copa <ncopa@alpinelinux.org>
-Date: Wed, 12 Feb 2014 13:43:34 +0000
-Subject: [PATCH] Fix header include for definition of NULL
-
-NULL is defined in stdlib.h so we need to include that.
-
-Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
----
- support/include/sockaddr.h | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/support/include/sockaddr.h b/support/include/sockaddr.h
-index a1c30f9..446b537 100644
---- a/support/include/sockaddr.h
-+++ b/support/include/sockaddr.h
-@@ -27,6 +27,7 @@
- #ifdef HAVE_LIBIO_H
- #include <libio.h>
- #endif
-+#include <stdlib.h>
- #include <stdbool.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
---
-2.0.4
-
diff --git a/main/nfs-utils/0003-configure.ac-enable-GNU_SOURCE-for-stat64-statfs64.patch b/main/nfs-utils/0003-configure.ac-enable-GNU_SOURCE-for-stat64-statfs64.patch
deleted file mode 100644
index 40163bf8a7..0000000000
--- a/main/nfs-utils/0003-configure.ac-enable-GNU_SOURCE-for-stat64-statfs64.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 3c09cd3801d1200a11e03a387cd4844591b7850d Mon Sep 17 00:00:00 2001
-From: Natanael Copa <ncopa@alpinelinux.org>
-Date: Tue, 5 Aug 2014 17:02:25 +0200
-Subject: [PATCH] configure.ac: enable GNU_SOURCE for stat64/statfs64
-
-Use AC_USE_SYSTEM_EXTENSIONS to enable GNU_SOURCE, which is needed
-for:
- - stat64 in utils/exportfs/exportfs.c
- - statfs64 in utils/mountd/cache.c
-
-Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
----
- configure.ac | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/configure.ac b/configure.ac
-index 408f4c8..b9682ed 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -8,6 +8,7 @@ AM_INIT_AUTOMAKE
- AC_PREREQ(2.59)
- AC_PREFIX_DEFAULT(/usr)
- AM_MAINTAINER_MODE
-+AC_USE_SYSTEM_EXTENSIONS
-
- dnl *************************************************************
- dnl * Define the set of applicable options
---
-2.0.4
-
diff --git a/main/nfs-utils/0004-replace-__attribute_malloc__-with-the-more-portable-.patch b/main/nfs-utils/0004-replace-__attribute_malloc__-with-the-more-portable-.patch
deleted file mode 100644
index f92e1df6d4..0000000000
--- a/main/nfs-utils/0004-replace-__attribute_malloc__-with-the-more-portable-.patch
+++ /dev/null
@@ -1,208 +0,0 @@
-From c09597e62a4fcd68fa4aab1183146d36c0326a35 Mon Sep 17 00:00:00 2001
-From: Natanael Copa <ncopa@alpinelinux.org>
-Date: Wed, 12 Feb 2014 13:46:51 +0000
-Subject: [PATCH] replace __attribute_malloc__ with the more portable
- __attribute__((__malloc__))
-
-Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
----
- support/export/hostname.c | 14 +++++++-------
- support/include/exportfs.h | 10 +++++-----
- support/nfs/svc_create.c | 2 +-
- utils/statd/hostname.c | 6 +++---
- utils/statd/sm-notify.c | 8 ++++----
- utils/statd/statd.h | 2 +-
- 6 files changed, 21 insertions(+), 21 deletions(-)
-
-diff --git a/support/export/hostname.c b/support/export/hostname.c
-index 3e949a1..ad595d1 100644
---- a/support/export/hostname.c
-+++ b/support/export/hostname.c
-@@ -91,7 +91,7 @@ host_ntop(const struct sockaddr *sap, char *buf, const size_t buflen)
- * Returns address info structure, or NULL if an error occurs. Caller
- * must free the returned structure with freeaddrinfo(3).
- */
--__attribute_malloc__
-+__attribute__((__malloc__))
- struct addrinfo *
- host_pton(const char *paddr)
- {
-@@ -153,7 +153,7 @@ host_pton(const char *paddr)
- * if no information is available for @hostname. Caller must free the
- * returned structure with freeaddrinfo(3).
- */
--__attribute_malloc__
-+__attribute__((__malloc__))
- struct addrinfo *
- host_addrinfo(const char *hostname)
- {
-@@ -199,7 +199,7 @@ host_addrinfo(const char *hostname)
- * the string.
- */
- #ifdef HAVE_GETNAMEINFO
--__attribute_malloc__
-+__attribute__((__malloc__))
- char *
- host_canonname(const struct sockaddr *sap)
- {
-@@ -234,7 +234,7 @@ host_canonname(const struct sockaddr *sap)
- return strdup(buf);
- }
- #else /* !HAVE_GETNAMEINFO */
--__attribute_malloc__
-+__attribute__((__malloc__))
- char *
- host_canonname(const struct sockaddr *sap)
- {
-@@ -266,7 +266,7 @@ host_canonname(const struct sockaddr *sap)
- *
- * Caller must free the returned structure with freeaddrinfo(3).
- */
--__attribute_malloc__
-+__attribute__((__malloc__))
- struct addrinfo *
- host_reliable_addrinfo(const struct sockaddr *sap)
- {
-@@ -313,7 +313,7 @@ out_free_hostname:
- * Caller must free the returned structure with freeaddrinfo(3).
- */
- #ifdef HAVE_GETNAMEINFO
--__attribute_malloc__
-+__attribute__((__malloc__))
- struct addrinfo *
- host_numeric_addrinfo(const struct sockaddr *sap)
- {
-@@ -361,7 +361,7 @@ host_numeric_addrinfo(const struct sockaddr *sap)
- return ai;
- }
- #else /* !HAVE_GETNAMEINFO */
--__attribute_malloc__
-+__attribute__((__malloc__))
- struct addrinfo *
- host_numeric_addrinfo(const struct sockaddr *sap)
- {
-diff --git a/support/include/exportfs.h b/support/include/exportfs.h
-index 97b2327..9021fae 100644
---- a/support/include/exportfs.h
-+++ b/support/include/exportfs.h
-@@ -156,15 +156,15 @@ int secinfo_addflavor(struct flav_info *, struct exportent *);
-
- char * host_ntop(const struct sockaddr *sap,
- char *buf, const size_t buflen);
--__attribute_malloc__
-+__attribute__((__malloc__))
- struct addrinfo * host_pton(const char *paddr);
--__attribute_malloc__
-+__attribute__((__malloc__))
- struct addrinfo * host_addrinfo(const char *hostname);
--__attribute_malloc__
-+__attribute__((__malloc__))
- char * host_canonname(const struct sockaddr *sap);
--__attribute_malloc__
-+__attribute__((__malloc__))
- struct addrinfo * host_reliable_addrinfo(const struct sockaddr *sap);
--__attribute_malloc__
-+__attribute__((__malloc__))
- struct addrinfo * host_numeric_addrinfo(const struct sockaddr *sap);
-
- int rmtab_read(void);
-diff --git a/support/nfs/svc_create.c b/support/nfs/svc_create.c
-index 6b9e85b..a706f87 100644
---- a/support/nfs/svc_create.c
-+++ b/support/nfs/svc_create.c
-@@ -113,7 +113,7 @@ svc_create_find_xprt(const struct sockaddr *bindaddr, const struct netconfig *nc
- *
- * Otherwise NULL is returned if an error occurs.
- */
--__attribute_malloc__
-+__attribute__((__malloc__))
- static struct addrinfo *
- svc_create_bindaddr(struct netconfig *nconf, const uint16_t port)
- {
-diff --git a/utils/statd/hostname.c b/utils/statd/hostname.c
-index 746ecc7..c61087c 100644
---- a/utils/statd/hostname.c
-+++ b/utils/statd/hostname.c
-@@ -105,7 +105,7 @@ statd_present_address(const struct sockaddr *sap, char *buf, const size_t buflen
- * Look up the hostname; report exceptional errors. Caller must
- * call freeaddrinfo(3) if a valid addrinfo is returned.
- */
--__attribute_malloc__
-+__attribute__((__malloc__))
- static struct addrinfo *
- get_addrinfo(const char *hostname, const struct addrinfo *hint)
- {
-@@ -184,7 +184,7 @@ get_nameinfo(const struct sockaddr *sap,
- * We won't monitor peers that don't have a reverse map. The canonical
- * name gives us a key for our monitor list.
- */
--__attribute_malloc__
-+__attribute__((__malloc__))
- char *
- statd_canonical_name(const char *hostname)
- {
-@@ -234,7 +234,7 @@ statd_canonical_name(const char *hostname)
- * NULL if some error occurs. Caller must free the returned
- * list with freeaddrinfo(3).
- */
--__attribute_malloc__
-+__attribute__((__malloc__))
- static struct addrinfo *
- statd_canonical_list(const char *hostname)
- {
-diff --git a/utils/statd/sm-notify.c b/utils/statd/sm-notify.c
-index 9dbe5d9..5994b2f 100644
---- a/utils/statd/sm-notify.c
-+++ b/utils/statd/sm-notify.c
-@@ -74,7 +74,7 @@ static int record_pid(void);
-
- static struct nsm_host * hosts = NULL;
-
--__attribute_malloc__
-+__attribute__((__malloc__))
- static struct addrinfo *
- smn_lookup(const char *name)
- {
-@@ -149,7 +149,7 @@ smn_get_hostname(const struct sockaddr *sap,
- * if the canonical name doesn't exist or cannot be determined.
- * The caller must free the result with free(3).
- */
--__attribute_malloc__
-+__attribute__((__malloc__))
- static char *
- smn_verify_my_name(const char *name)
- {
-@@ -189,7 +189,7 @@ smn_verify_my_name(const char *name)
- return retval;
- }
-
--__attribute_malloc__
-+__attribute__((__malloc__))
- static struct nsm_host *
- smn_alloc_host(const char *hostname, const char *mon_name,
- const char *my_name, const time_t timestamp)
-@@ -343,7 +343,7 @@ static int smn_socket(void)
- * If admin specified a source address or srcport, then convert those
- * to a sockaddr and return it. Otherwise, return an ANYADDR address.
- */
--__attribute_malloc__
-+__attribute__((__malloc__))
- static struct addrinfo *
- smn_bind_address(const char *srcaddr, const char *srcport)
- {
-diff --git a/utils/statd/statd.h b/utils/statd/statd.h
-index e89e666..a1d8035 100644
---- a/utils/statd/statd.h
-+++ b/utils/statd/statd.h
-@@ -25,7 +25,7 @@
- extern _Bool statd_matchhostname(const char *hostname1, const char *hostname2);
- extern _Bool statd_present_address(const struct sockaddr *sap, char *buf,
- const size_t buflen);
--__attribute_malloc__
-+__attribute__((__malloc__))
- extern char * statd_canonical_name(const char *hostname);
-
- extern void my_svc_run(void);
---
-2.0.4
-
diff --git a/main/nfs-utils/0005-mountd-use-standard-dev_t-instead-of-glibc-internals.patch b/main/nfs-utils/0005-mountd-use-standard-dev_t-instead-of-glibc-internals.patch
deleted file mode 100644
index e9c666954f..0000000000
--- a/main/nfs-utils/0005-mountd-use-standard-dev_t-instead-of-glibc-internals.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From f16907e3a179438ff93e712d5303d8041f918dbe Mon Sep 17 00:00:00 2001
-From: Natanael Copa <ncopa@alpinelinux.org>
-Date: Wed, 12 Feb 2014 14:04:30 +0000
-Subject: [PATCH] mountd: use standard dev_t instead of glibc internals
-
-The __dev_t is a GNU libc internal. Use the standard dev_t instead,
-which is specified in POSIX.
-
-Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
----
- utils/mountd/cache.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c
-index b0cc6a8..663a52a 100644
---- a/utils/mountd/cache.c
-+++ b/utils/mountd/cache.c
-@@ -1419,7 +1419,7 @@ static int cache_export_ent(char *domain, struct exportent *exp, char *path)
- */
- struct stat stb;
- size_t l = strlen(exp->e_path);
-- __dev_t dev;
-+ dev_t dev;
-
- if (strlen(path) <= l || path[l] != '/' ||
- strncmp(exp->e_path, path, l) != 0)
---
-2.0.4
-
diff --git a/main/nfs-utils/0006-nfsstat-replace-the-legacy-SA_ONESHOT-with-standard-.patch b/main/nfs-utils/0006-nfsstat-replace-the-legacy-SA_ONESHOT-with-standard-.patch
deleted file mode 100644
index 82477985f3..0000000000
--- a/main/nfs-utils/0006-nfsstat-replace-the-legacy-SA_ONESHOT-with-standard-.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From bcf08c3eba0c529077c16110e066750c5cce8292 Mon Sep 17 00:00:00 2001
-From: Natanael Copa <ncopa@alpinelinux.org>
-Date: Wed, 12 Feb 2014 14:07:16 +0000
-Subject: [PATCH] nfsstat: replace the legacy SA_ONESHOT with standard
- SA_RESETHAND
-
-Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
----
- utils/nfsstat/nfsstat.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/utils/nfsstat/nfsstat.c b/utils/nfsstat/nfsstat.c
-index 70f8d10..3612bfe 100644
---- a/utils/nfsstat/nfsstat.c
-+++ b/utils/nfsstat/nfsstat.c
-@@ -336,7 +336,7 @@ main(int argc, char **argv)
-
- struct sigaction act = {
- .sa_handler = unpause,
-- .sa_flags = SA_ONESHOT,
-+ .sa_flags = SA_RESETHAND,
- };
-
- if ((progname = strrchr(argv[0], '/')))
---
-2.0.4
-
diff --git a/main/nfs-utils/0007-Allow-usage-of-getrpcbynumber-when-getrpcbynumber_r-.patch b/main/nfs-utils/0007-Allow-usage-of-getrpcbynumber-when-getrpcbynumber_r-.patch
deleted file mode 100644
index c39b01fe0a..0000000000
--- a/main/nfs-utils/0007-Allow-usage-of-getrpcbynumber-when-getrpcbynumber_r-.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 733d3316dd67aeb175016a098d6d0fd08cefdd33 Mon Sep 17 00:00:00 2001
-From: Natanael Copa <ncopa@alpinelinux.org>
-Date: Wed, 12 Feb 2014 13:54:31 +0000
-Subject: [PATCH] Allow usage of getrpcbynumber() when getrpcbynumber_r() is
- unavailable
-
-Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
----
- configure.ac | 6 +-----
- support/nfs/svc_socket.c | 6 ++++++
- 2 files changed, 7 insertions(+), 5 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index b9682ed..bc48373 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -248,9 +248,6 @@ AC_CHECK_FUNC([connect], ,
- AC_CHECK_FUNC([getaddrinfo], ,
- [AC_MSG_ERROR([Function 'getaddrinfo' not found.])])
-
--AC_CHECK_FUNC([getrpcbynumber], ,
-- [AC_MSG_ERROR([Function 'getrpcbynumber' not found.])])
--
- AC_CHECK_FUNC([getservbyname], ,
- [AC_MSG_ERROR([Function 'getservbyname' not found.])])
-
-@@ -409,12 +406,11 @@ AC_FUNC_STAT
- AC_FUNC_VPRINTF
- AC_CHECK_FUNCS([alarm atexit dup2 fdatasync ftruncate getcwd \
- gethostbyaddr gethostbyname gethostname getmntent \
-- getnameinfo getrpcbyname getifaddrs \
-+ getnameinfo getrpcbyname getrpcbynumber getrpcbynumber_r getifaddrs \
- gettimeofday hasmntopt inet_ntoa innetgr memset mkdir pathconf \
- ppoll realpath rmdir select socket strcasecmp strchr strdup \
- strerror strrchr strtol strtoul sigprocmask name_to_handle_at])
-
--
- dnl *************************************************************
- dnl Check for data sizes
- dnl *************************************************************
-diff --git a/support/nfs/svc_socket.c b/support/nfs/svc_socket.c
-index f56f310..61ccf5b 100644
---- a/support/nfs/svc_socket.c
-+++ b/support/nfs/svc_socket.c
-@@ -42,8 +42,14 @@ int getservport(u_long number, const char *proto)
- struct servent servbuf, *servp = NULL;
- int ret;
-
-+#if HAVE_GETRPCBYNUMBER_R
- ret = getrpcbynumber_r(number, &rpcbuf, rpcdata, sizeof rpcdata,
- &rpcp);
-+#else
-+ rpcp = getrpcbynumber(number);
-+ ret = 0;
-+#endif
-+
- if (ret == 0 && rpcp != NULL) {
- /* First try name. */
- ret = getservbyname_r(rpcp->r_name, proto, &servbuf, servdata,
---
-2.0.4
-
diff --git a/main/nfs-utils/0008-Only-work-around-glibc-bugs-on-glibc.patch b/main/nfs-utils/0008-Only-work-around-glibc-bugs-on-glibc.patch
deleted file mode 100644
index 9f87eec597..0000000000
--- a/main/nfs-utils/0008-Only-work-around-glibc-bugs-on-glibc.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 21a0c6b3ace23acd0236339582366bb128065347 Mon Sep 17 00:00:00 2001
-From: Natanael Copa <ncopa@alpinelinux.org>
-Date: Thu, 24 Apr 2014 14:25:23 +0200
-Subject: [PATCH] Only work around glibc bugs on glibc
-
-Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
----
- utils/mountd/svc_run.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/utils/mountd/svc_run.c b/utils/mountd/svc_run.c
-index 1938a67..a572441 100644
---- a/utils/mountd/svc_run.c
-+++ b/utils/mountd/svc_run.c
-@@ -60,7 +60,7 @@
- void cache_set_fds(fd_set *fdset);
- int cache_process_req(fd_set *readfds);
-
--#if LONG_MAX != INT_MAX
-+#if defined(__GLIBC__) && LONG_MAX != INT_MAX
- /* bug in glibc 2.3.6 and earlier, we need
- * our own svc_getreqset
- */
---
-2.0.4
-
diff --git a/main/nfs-utils/0009-include-libgen.h-for-basename.patch b/main/nfs-utils/0009-include-libgen.h-for-basename.patch
deleted file mode 100644
index 0cca70e1c0..0000000000
--- a/main/nfs-utils/0009-include-libgen.h-for-basename.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-From e828b9c9ac735a18850bd90c61b60064c236937b Mon Sep 17 00:00:00 2001
-From: Natanael Copa <ncopa@alpinelinux.org>
-Date: Thu, 24 Apr 2014 10:38:26 +0200
-Subject: [PATCH] include libgen.h for basename
-
-According POSIX basename(3) should have an #include <libgen.h>
-
-There are a different GNU implementation too, that can be used with
-_GNU_SOURCE, but the POSIX version is good enough and more portable.
-
-Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
----
- tools/rpcdebug/rpcdebug.c | 1 +
- utils/mount/mount.c | 1 +
- utils/mount/mount_libmount.c | 1 +
- utils/nfsd/nfsd.c | 1 +
- utils/nfsidmap/nfsidmap.c | 1 +
- 5 files changed, 5 insertions(+)
-
-diff --git a/tools/rpcdebug/rpcdebug.c b/tools/rpcdebug/rpcdebug.c
-index d6e10d3..18b1622 100644
---- a/tools/rpcdebug/rpcdebug.c
-+++ b/tools/rpcdebug/rpcdebug.c
-@@ -26,6 +26,7 @@
- #include <malloc.h>
- #include <fcntl.h>
- #include <ctype.h>
-+#include <libgen.h>
- /* RPC debug flags
- #include <sunrpc/debug.h> */
- /* NFS debug flags
-diff --git a/utils/mount/mount.c b/utils/mount/mount.c
-index eea00af..91f1087 100644
---- a/utils/mount/mount.c
-+++ b/utils/mount/mount.c
-@@ -33,6 +33,7 @@
- #include <getopt.h>
- #include <mntent.h>
- #include <pwd.h>
-+#include <libgen.h>
-
- #include "fstab.h"
- #include "xcommon.h"
-diff --git a/utils/mount/mount_libmount.c b/utils/mount/mount_libmount.c
-index 701d41e..6f85dc9 100644
---- a/utils/mount/mount_libmount.c
-+++ b/utils/mount/mount_libmount.c
-@@ -29,6 +29,7 @@
- #include <string.h>
- #include <errno.h>
- #include <getopt.h>
-+#include <libgen.h>
-
- #include <libmount/libmount.h>
-
-diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c
-index 03e3c81..201bb13 100644
---- a/utils/nfsd/nfsd.c
-+++ b/utils/nfsd/nfsd.c
-@@ -19,6 +19,7 @@
- #include <errno.h>
- #include <getopt.h>
- #include <netdb.h>
-+#include <libgen.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #include <arpa/inet.h>
-diff --git a/utils/nfsidmap/nfsidmap.c b/utils/nfsidmap/nfsidmap.c
-index 3f51b4d..e0d31e7 100644
---- a/utils/nfsidmap/nfsidmap.c
-+++ b/utils/nfsidmap/nfsidmap.c
-@@ -4,6 +4,7 @@
- #include <stdlib.h>
- #include <string.h>
- #include <errno.h>
-+#include <libgen.h>
-
- #include <pwd.h>
- #include <grp.h>
---
-2.0.4
-
diff --git a/main/nfs-utils/0010-exportfs-fix-test-of-NULL-pointer-in-host_pton.patch b/main/nfs-utils/0010-exportfs-fix-test-of-NULL-pointer-in-host_pton.patch
deleted file mode 100644
index 00ec08c787..0000000000
--- a/main/nfs-utils/0010-exportfs-fix-test-of-NULL-pointer-in-host_pton.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From 7fc596097b2a0545a8a21e90ecdabdc34073ab49 Mon Sep 17 00:00:00 2001
-From: Natanael Copa <ncopa@alpinelinux.org>
-Date: Mon, 2 Jun 2014 14:20:59 +0200
-Subject: [PATCH] exportfs: fix test of NULL pointer in host_pton()
-
-should fix https://bugzilla.redhat.com/show_bug.cgi?id=1083018
-
-Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
----
- support/export/hostname.c | 12 +++++++-----
- 1 file changed, 7 insertions(+), 5 deletions(-)
-
-diff --git a/support/export/hostname.c b/support/export/hostname.c
-index ad595d1..d9153e1 100644
---- a/support/export/hostname.c
-+++ b/support/export/hostname.c
-@@ -115,6 +115,11 @@ host_pton(const char *paddr)
- * have a real AF_INET presentation address, before invoking
- * getaddrinfo(3) to generate the full addrinfo list.
- */
-+ if (paddr == NULL) {
-+ xlog(D_GENERAL, "%s: passed a NULL presentation address",
-+ __func__);
-+ return NULL;
-+ }
- inet4 = 1;
- if (inet_pton(AF_INET, paddr, &sin.sin_addr) == 0)
- inet4 = 0;
-@@ -123,15 +128,12 @@ host_pton(const char *paddr)
- switch (error) {
- case 0:
- if (!inet4 && ai->ai_addr->sa_family == AF_INET) {
-+ xlog(D_GENERAL, "%s: failed to convert %s",
-+ __func__, paddr);
- freeaddrinfo(ai);
- break;
- }
- return ai;
-- case EAI_NONAME:
-- if (paddr == NULL)
-- xlog(D_GENERAL, "%s: passed a NULL presentation address",
-- __func__);
-- break;
- case EAI_SYSTEM:
- xlog(D_GENERAL, "%s: failed to convert %s: (%d) %m",
- __func__, paddr, errno);
---
-2.0.4
-
diff --git a/main/nfs-utils/APKBUILD b/main/nfs-utils/APKBUILD
index 9cccd6716f..76acd4219c 100644
--- a/main/nfs-utils/APKBUILD
+++ b/main/nfs-utils/APKBUILD
@@ -1,14 +1,15 @@
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=nfs-utils
-pkgver=1.3.1_rc3
-_basever=1.3.0
+pkgver=1.3.1
+_basever=$pkgver
pkgrel=0
pkgdesc="kernel-mode NFS"
url="http://nfs.sourceforge.net/"
arch="all"
license="GPL"
depends="rpcbind"
+options="suid"
makedepends="util-linux-dev libtirpc-dev libcap-dev libevent-dev
libnfsidmap-dev keyutils-dev lvm2-dev krb5-dev sqlite-dev
autoconf automake libtool !rpcgen"
@@ -16,17 +17,6 @@ subpackages="$pkgname-doc $pkgname-dbg"
[ "$ALPINE_LIBC" != "eglibc" ] && subpackages="$subpackages rpcgen"
source="http://downloads.sourceforge.net/nfs/$pkgname-$_basever.tar.bz2
- nfs-utils-1.3.1-rc3.patch
- 0001-conffile-use-standard-uint-_t-and-unsigned-char.patch
- 0002-Fix-header-include-for-definition-of-NULL.patch
- 0003-configure.ac-enable-GNU_SOURCE-for-stat64-statfs64.patch
- 0004-replace-__attribute_malloc__-with-the-more-portable-.patch
- 0005-mountd-use-standard-dev_t-instead-of-glibc-internals.patch
- 0006-nfsstat-replace-the-legacy-SA_ONESHOT-with-standard-.patch
- 0007-Allow-usage-of-getrpcbynumber-when-getrpcbynumber_r-.patch
- 0008-Only-work-around-glibc-bugs-on-glibc.patch
- 0009-include-libgen.h-for-basename.patch
- 0010-exportfs-fix-test-of-NULL-pointer-in-host_pton.patch
0011-exportfs-only-do-glibc-specific-hackery-on-glibc.patch
0012-rework-access-to-proc-net-rpc.patch
@@ -110,18 +100,7 @@ rpcgen() {
install -m755 -D tools/rpcgen/rpcgen "$subpkgdir"/usr/bin/rpcgen
}
-md5sums="3ac3726eda563946d1f44ac3e5b61d56 nfs-utils-1.3.0.tar.bz2
-4f6b75806437b08742f95eeb8abc640e nfs-utils-1.3.1-rc3.patch
-714afe3a88d6a584d15e167c96c57925 0001-conffile-use-standard-uint-_t-and-unsigned-char.patch
-42df50df2888a3384550d4f5667fb515 0002-Fix-header-include-for-definition-of-NULL.patch
-0ee94b77a48b6b364e6b14bb75b992a2 0003-configure.ac-enable-GNU_SOURCE-for-stat64-statfs64.patch
-2e67ee958bbdcc11d1888c1b8c4329f0 0004-replace-__attribute_malloc__-with-the-more-portable-.patch
-d10a5b570dbbb20accfb4117f605914a 0005-mountd-use-standard-dev_t-instead-of-glibc-internals.patch
-4b5e2ed10351eb8d6ab4aa99e65d72aa 0006-nfsstat-replace-the-legacy-SA_ONESHOT-with-standard-.patch
-93588b3c68825eadf758832a0045f9e2 0007-Allow-usage-of-getrpcbynumber-when-getrpcbynumber_r-.patch
-3b733a0bb274ecdf80bbc09b2a11aa4f 0008-Only-work-around-glibc-bugs-on-glibc.patch
-6424e1113a838ab35eb8623ed82a2352 0009-include-libgen.h-for-basename.patch
-232a07d7d923435a12e51ee74e05cea2 0010-exportfs-fix-test-of-NULL-pointer-in-host_pton.patch
+md5sums="97f157f954edb6d4d4385a0c5986f36f nfs-utils-1.3.1.tar.bz2
5994a46367486129e2892c73dcdc82c2 0011-exportfs-only-do-glibc-specific-hackery-on-glibc.patch
1f6ba2d021b5fa7f7ea4e66b393bd268 0012-rework-access-to-proc-net-rpc.patch
2b2d228f9947581c924a691a84664fa1 nfs-utils-mtab-sym.patch
@@ -136,18 +115,7 @@ d514fb87ce5de9909f43d99012352f09 nfsmount.initd
20e71ab412555b2dc9b50f346f68e5c8 rpc.svcgssd.initd
09135438d6df50b868bbe5a2260f973c nfs.confd
4f1bb7b2412ce5952ecb5ec22d8ed99d nfs.exports"
-sha256sums="25f1c974018c944347d74eebe89643e1004c822a6145153136b192d1acfaf60d nfs-utils-1.3.0.tar.bz2
-d138a10d4d97e185f1563574019919881a742f2908ef432055b64c4e1a249e2c nfs-utils-1.3.1-rc3.patch
-3ea08ea31560eef7315953d691862174bb1a814ef7d5a0c7d695e922d8723b67 0001-conffile-use-standard-uint-_t-and-unsigned-char.patch
-562647aeb295c612889744a4ca7770409ac60ff5953210e5765cac6689d9b0c4 0002-Fix-header-include-for-definition-of-NULL.patch
-bf0af038c1f73a15abaca0242652b9f6666bdff9eae0ac6d4188291abe742769 0003-configure.ac-enable-GNU_SOURCE-for-stat64-statfs64.patch
-5f95083f65eb4b8f7e2687a1070c0a7a8eee1ec2fb10a56a47e4d69ddd3b9188 0004-replace-__attribute_malloc__-with-the-more-portable-.patch
-993b944d25f03fe7282e1be1d1a294e72d2f879365f08d5c59ea377e51736204 0005-mountd-use-standard-dev_t-instead-of-glibc-internals.patch
-5f9ef2978c6cf2c7883984d2ef6bbcb79d88e2155e0b183bfbb8748d1696ba81 0006-nfsstat-replace-the-legacy-SA_ONESHOT-with-standard-.patch
-cae35793e7548be84fdb4719d92156b7ff167304952fd15d9023e051ec176a82 0007-Allow-usage-of-getrpcbynumber-when-getrpcbynumber_r-.patch
-1de98cbae3b03ea3fba14f1a125bf88b01581e7a9e155377b9d9d98963ced365 0008-Only-work-around-glibc-bugs-on-glibc.patch
-e0eca027b68c191dc96ca89ebe628df18e487b7cbdfb3629231526ef35953de6 0009-include-libgen.h-for-basename.patch
-280ab8bb989c555d880c0aa9b75a6fa83d3bf912ffde75588d914eb9d4cdf54d 0010-exportfs-fix-test-of-NULL-pointer-in-host_pton.patch
+sha256sums="748c4afbdfd3e92017fe579f1dd3280a10db1306c43228f83cd6b55f0d95aed3 nfs-utils-1.3.1.tar.bz2
0bd62ea53c980369990f04b620db725259fa919a351b8ed44e081a8b7a1c221e 0011-exportfs-only-do-glibc-specific-hackery-on-glibc.patch
2d5cc55a6047ef576d6795442b3926f7f686122be26be8566606e0a2d5695b56 0012-rework-access-to-proc-net-rpc.patch
5a1c6875f43ecc93d5db7bcf84b4ceda16c09b6109c28696eb55d05247511706 nfs-utils-mtab-sym.patch
@@ -162,18 +130,7 @@ a727948ccf665b6bb1977ac3014b7086ff654173d1a2be1e2b38a43e97f84ca8 rpc.statd.init
f1c460d8b0e91e54a551397d755135d05a3728d81de596535bf8bda074455677 rpc.svcgssd.initd
9ca3b7dfbac5bedd818a3637805380f4e873ef8e809c21c26f410c86ac16e03e nfs.confd
f2aaf1c92e07172adeb65f7f2bc0140c533ae453a3477e99be677ef2e05f2d4b nfs.exports"
-sha512sums="9cb9efa26d2b1bd6ae3e0c516ac50b17b4c7993366ae36c7786da734dc8ea4dd7a05f0d6fabb6fba6df36ead8642341a095f1972cb46b400840705356d410a6a nfs-utils-1.3.0.tar.bz2
-a19bea1792e2034e713c49f407512ed6a5d0bfc9c99a8ef96b656b183f90d44554d2f007f28d2ba66e07c9756c9c50d6b5fab3a200fb6ce573e2d7755ec2cf0b nfs-utils-1.3.1-rc3.patch
-4f215d3824142dcf911e57e5772c8d8df4671703c46ba1a28afeca84c94c566034fbaa11214998ae8e636666b32afac6fcfd7b7ee7ba3f4ce469a5952e3aea18 0001-conffile-use-standard-uint-_t-and-unsigned-char.patch
-7e6367904135465a06561ab3053362992380eaaa012277697d6f3ae7bbdf022d20cb1e36099ecfb646f414892eb1c32142073561f48ab82f09589473115fb889 0002-Fix-header-include-for-definition-of-NULL.patch
-30161e256160ba258e588412e6dbe5a7b112c19963c489eb01b4b93af329c5f034a6466e44031c4b63f9df9577d30ba8b50102013abdde7bcb40b08d1d222a35 0003-configure.ac-enable-GNU_SOURCE-for-stat64-statfs64.patch
-fea39cdc904cf58c0ddf848c941e8bfda12f30e3a723b9be051042682876d7fbe3bf42b464e1f38993230cb63a7a55d93c08cb26dd6b79b482e10cf4f119515b 0004-replace-__attribute_malloc__-with-the-more-portable-.patch
-8372f6f5b71e9f5e262396c7d319188998e46e91ad763d0acc5e8931d1a12f2240f49dfcab20a71048ec2445e8dbb0d15d8f798978308fd492e146beda4a589e 0005-mountd-use-standard-dev_t-instead-of-glibc-internals.patch
-0d8030816a19ababbc2c3e59960240fe3ed84a058082f7f5bee28129cb9969d14be6d6ebb96d0992928ef76610c94dc5937510db05b4853ef93489ea7134af4b 0006-nfsstat-replace-the-legacy-SA_ONESHOT-with-standard-.patch
-c665989dfb7d050f87f998373d1b26e816beb87063df625596aca6bf372a65a919d6cf8c8b1664f9aa3422a95e276a0ad5b11b883a40a65c0769fd5f37ea08f9 0007-Allow-usage-of-getrpcbynumber-when-getrpcbynumber_r-.patch
-fe8191a231cd53dd5e44abeb46dbe34bf33df8f8071375c7f80468c12a6de47d16e6eba1342dbd889b16a821491b80f191691fae29f5e4a46f262e3d8beca5ab 0008-Only-work-around-glibc-bugs-on-glibc.patch
-b5042e36f46701ef1163f54e3ef537a07590dec71e39f4fc64ba7a9d0e27a2d7c65af0e639a17867704f212774a375d47bf9bba74ec4c5afffe59c8cee74c588 0009-include-libgen.h-for-basename.patch
-703f1cd9f72faad84fbf60f631acb8e1927a1915addcc64840f6f690e6577837b7a3cefd493fc3b553e724c31352053558395a7a813c90c4186666cd5fd433e1 0010-exportfs-fix-test-of-NULL-pointer-in-host_pton.patch
+sha512sums="304e718aaee1df4decb0711c58c814ac773d55277baca01fd74d275969b9a1cee4bf0c0c20ba3ed72a112bd92b4744d45179f29a2a69a7fc2ca2590762a671c9 nfs-utils-1.3.1.tar.bz2
9561a979a2313f00c0bbb2ffb3193ca089e5de2f15cf5b6c142e65e04a9401bbc962e490e5b1de026750262a05e5258b286a79781444e7f2ac6bd581b426211a 0011-exportfs-only-do-glibc-specific-hackery-on-glibc.patch
babaf804265cdd768a2dc8ec798e0a31e8cd8c65c6d8f57f4d254b9b56f336c1c3ec2e8a34ed7765a32720b5d75eb9490ad6269daba51aded8fe29136b3b715e 0012-rework-access-to-proc-net-rpc.patch
5fd9039a61a0cdaeb57b5332ea545034101e6f15be200b7cf8fc7d0a3d22836a6fc778e0560656c1825808a4dc09046d9923d81b4d1324a6e526b226c657d064 nfs-utils-mtab-sym.patch
diff --git a/main/nfs-utils/nfs-utils-1.3.1-rc3.patch b/main/nfs-utils/nfs-utils-1.3.1-rc3.patch
deleted file mode 100644
index 9e4048b59c..0000000000
--- a/main/nfs-utils/nfs-utils-1.3.1-rc3.patch
+++ /dev/null
@@ -1,1086 +0,0 @@
-diff --git a/Makefile.am b/Makefile.am
-index ae7cd16..5824adc 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -54,13 +54,13 @@ install-data-hook:
- touch $(DESTDIR)$(statedir)/xtab; chmod 644 $(DESTDIR)$(statedir)/xtab
- touch $(DESTDIR)$(statedir)/etab; chmod 644 $(DESTDIR)$(statedir)/etab
- touch $(DESTDIR)$(statedir)/rmtab; chmod 644 $(DESTDIR)$(statedir)/rmtab
-- mkdir -p $(DESTDIR)$(statedir)/sm $(DESTDIR)$(statedir)/sm.bak
-- touch $(DESTDIR)$(statedir)/state
-- chmod go-rwx $(DESTDIR)$(statedir)/sm $(DESTDIR)$(statedir)/sm.bak $(DESTDIR)$(statedir)/state
-- -chown $(statduser) $(DESTDIR)$(statedir)/sm $(DESTDIR)$(statedir)/sm.bak $(DESTDIR)$(statedir)/state
-+ mkdir -p $(DESTDIR)$(statdpath)/sm $(DESTDIR)$(statdpath)/sm.bak
-+ touch $(DESTDIR)$(statdpath)/state
-+ chmod go-rwx $(DESTDIR)$(statdpath)/sm $(DESTDIR)$(statdpath)/sm.bak $(DESTDIR)$(statdpath)/state
-+ -chown $(statduser) $(DESTDIR)$(statdpath)/sm $(DESTDIR)$(statdpath)/sm.bak $(DESTDIR)$(statdpath)/state
-
- uninstall-hook:
- rm $(DESTDIR)$(statedir)/xtab
- rm $(DESTDIR)$(statedir)/etab
- rm $(DESTDIR)$(statedir)/rmtab
-- rm $(DESTDIR)$(statedir)/state
-+ rm $(DESTDIR)$(statdpath)/state
-diff --git a/configure.ac b/configure.ac
-index 7b93de6..408f4c8 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -411,7 +411,7 @@ AC_CHECK_FUNCS([alarm atexit dup2 fdatasync ftruncate getcwd \
- getnameinfo getrpcbyname getifaddrs \
- gettimeofday hasmntopt inet_ntoa innetgr memset mkdir pathconf \
- ppoll realpath rmdir select socket strcasecmp strchr strdup \
-- strerror strrchr strtol strtoul sigprocmask])
-+ strerror strrchr strtol strtoul sigprocmask name_to_handle_at])
-
-
- dnl *************************************************************
-diff --git a/support/export/client.c b/support/export/client.c
-index dbf47b9..f85e11c 100644
---- a/support/export/client.c
-+++ b/support/export/client.c
-@@ -482,8 +482,12 @@ add_name(char *old, const char *add)
- else
- cp = cp + strlen(cp);
- }
-- strncpy(new, old, cp-old);
-- new[cp-old] = 0;
-+ if (old) {
-+ strncpy(new, old, cp-old);
-+ new[cp-old] = 0;
-+ } else {
-+ new[0] = 0;
-+ }
- if (cp != old && !*cp)
- strcat(new, ",");
- strcat(new, add);
-diff --git a/tools/mountstats/mountstats.py b/tools/mountstats/mountstats.py
-index e46105d..1fb3e2f 100644
---- a/tools/mountstats/mountstats.py
-+++ b/tools/mountstats/mountstats.py
-@@ -371,7 +371,7 @@ def parse_stats_file(filename):
- ms_dict = dict()
- key = ''
-
-- f = file(filename)
-+ f = open(filename)
- for line in f.readlines():
- words = line.split()
- if len(words) == 0:
-diff --git a/tools/nfs-iostat/nfs-iostat.py b/tools/nfs-iostat/nfs-iostat.py
-index 341cdbf..61d15a5 100644
---- a/tools/nfs-iostat/nfs-iostat.py
-+++ b/tools/nfs-iostat/nfs-iostat.py
-@@ -213,7 +213,8 @@ class DeviceData:
- # the reference to them. so we build new lists here
- # for the result object.
- for op in result.__rpc_data['ops']:
-- result.__rpc_data[op] = map(difference, self.__rpc_data[op], old_stats.__rpc_data[op])
-+ result.__rpc_data[op] = list(map(
-+ difference, self.__rpc_data[op], old_stats.__rpc_data[op]))
-
- # update the remaining keys we care about
- result.__rpc_data['rpcsends'] -= old_stats.__rpc_data['rpcsends']
-@@ -243,27 +244,15 @@ class DeviceData:
- """Print attribute cache efficiency stats
- """
- nfs_stats = self.__nfs_data
-- getattr_stats = self.__rpc_data['GETATTR']
--
-- if nfs_stats['inoderevalidates'] != 0:
-- getattr_ops = float(getattr_stats[1])
-- opens = float(nfs_stats['vfsopen'])
-- revalidates = float(nfs_stats['inoderevalidates']) - opens
-- if revalidates != 0:
-- ratio = ((revalidates - getattr_ops) * 100) / revalidates
-- else:
-- ratio = 0.0
--
-- data_invalidates = float(nfs_stats['datainvalidates'])
-- attr_invalidates = float(nfs_stats['attrinvalidates'])
-
-- print()
-- print('%d inode revalidations, hitting in cache %4.2f%% of the time' % \
-- (revalidates, ratio))
-- print('%d open operations (mandatory GETATTR requests)' % opens)
-- if getattr_ops != 0:
-- print('%4.2f%% of GETATTRs resulted in data cache invalidations' % \
-- ((data_invalidates * 100) / getattr_ops))
-+ print()
-+ print('%d VFS opens' % (nfs_stats['vfsopen']))
-+ print('%d inoderevalidates (forced GETATTRs)' % \
-+ (nfs_stats['inoderevalidates']))
-+ print('%d page cache invalidations' % \
-+ (nfs_stats['datainvalidates']))
-+ print('%d attribute cache invalidations' % \
-+ (nfs_stats['attrinvalidates']))
-
- def __print_dir_cache_stats(self, sample_time):
- """Print directory stats
-@@ -353,15 +342,21 @@ class DeviceData:
- exe_per_op = 0.0
-
- op += ':'
-- print('%s' % op.lower().ljust(15), end='')
-- print(' ops/s\t\t kB/s\t\t kB/op\t\tretrans\t\tavg RTT (ms)\tavg exe (ms)')
--
-- print('\t\t%7.3f' % (ops / sample_time), end='')
-- print('\t%7.3f' % (kilobytes / sample_time), end='')
-- print('\t%7.3f' % kb_per_op, end='')
-- print(' %7d (%3.1f%%)' % (retrans, retrans_percent), end='')
-- print('\t%7.3f' % rtt_per_op, end='')
-- print('\t%7.3f' % exe_per_op)
-+ print(format(op.lower(), '<16s'), end='')
-+ print(format('ops/s', '>8s'), end='')
-+ print(format('kB/s', '>16s'), end='')
-+ print(format('kB/op', '>16s'), end='')
-+ print(format('retrans', '>16s'), end='')
-+ print(format('avg RTT (ms)', '>16s'), end='')
-+ print(format('avg exe (ms)', '>16s'))
-+
-+ print(format((ops / sample_time), '>24.3f'), end='')
-+ print(format((kilobytes / sample_time), '>16.3f'), end='')
-+ print(format(kb_per_op, '>16.3f'), end='')
-+ retransmits = '{0:>10.0f} ({1:>3.1f}%)'.format(retrans, retrans_percent).strip()
-+ print(format(retransmits, '>16'), end='')
-+ print(format(rtt_per_op, '>16.3f'), end='')
-+ print(format(exe_per_op, '>16.3f'))
-
- def ops(self, sample_time):
- sends = float(self.__rpc_data['rpcsends'])
-@@ -391,9 +386,10 @@ class DeviceData:
- (self.__nfs_data['export'], self.__nfs_data['mountpoint']))
- print()
-
-- print(' op/s\t\trpc bklog')
-- print('%7.2f' % (sends / sample_time), end='')
-- print('\t%7.2f' % backlog)
-+ print(format('ops/s', '>16') + format('rpc bklog', '>16'))
-+ print(format((sends / sample_time), '>16.3f'), end='')
-+ print(format(backlog, '>16.3f'))
-+ print()
-
- if which == 0:
- self.__print_rpc_op_stats('READ', sample_time)
-diff --git a/tools/nfs-iostat/nfsiostat.man b/tools/nfs-iostat/nfsiostat.man
-index 3ec245d..b477a9a 100644
---- a/tools/nfs-iostat/nfsiostat.man
-+++ b/tools/nfs-iostat/nfsiostat.man
-@@ -38,6 +38,61 @@ If one or more
- .I <mount point>
- names are specified, statistics for only these mount points will
- be displayed. Otherwise, all NFS mount points on the client are listed.
-+.TP
-+The meaning of each column of \fBnfsiostat\fR's output is the following:
-+.RS 8
-+- \fBop/s\fR
-+.RS
-+This is the number of operations per second.
-+.RS
-+.RE
-+.RE
-+.RE
-+.RS 8
-+- \fBrpc bklog\fR
-+.RS
-+This is the length of the backlog queue.
-+.RE
-+.RE
-+.RE
-+.RS 8
-+- \fBkB/s\fR
-+.RS
-+This is the number of kB written/read per second.
-+.RE
-+.RE
-+.RE
-+.RS 8
-+- \fBkB/op\fR
-+.RS
-+This is the number of kB written/read per each operation.
-+.RE
-+.RE
-+.RE
-+.RS 8
-+- \fBretrans\fR
-+.RS
-+This is the number of retransmissions.
-+.RE
-+.RE
-+.RE
-+.RS 8
-+- \fBavg RTT (ms)\fR
-+.RS
-+This is the duration from the time that client's kernel sends the RPC request until the time it receives the reply.
-+.RE
-+.RE
-+.RE
-+.RS 8
-+- \fBavg exe (ms)\fR
-+.RS
-+This is the duration from the time that NFS client does the RPC request to its kernel until the RPC request is completed, this includes the RTT time above.
-+.RE
-+.RE
-+.RE
-+.TP
-+Note that if an interval is used as argument to \fBnfsiostat\fR, then the diffrence from previous interval will be displayed, otherwise the results will be from the time that the share was mounted.
-+
- .SH OPTIONS
- .TP
- .B \-a " or " \-\-attr
-diff --git a/utils/gssd/Makefile.am b/utils/gssd/Makefile.am
-index a9a3e42..af59791 100644
---- a/utils/gssd/Makefile.am
-+++ b/utils/gssd/Makefile.am
-@@ -18,11 +18,13 @@ COMMON_SRCS = \
- context_lucid.c \
- gss_util.c \
- gss_oids.c \
-+ gss_names.c \
- err_util.c \
- \
- context.h \
- err_util.h \
- gss_oids.h \
-+ gss_names.h \
- gss_util.h
-
- gssd_SOURCES = \
-diff --git a/utils/gssd/gss_names.c b/utils/gssd/gss_names.c
-new file mode 100644
-index 0000000..047069d
---- /dev/null
-+++ b/utils/gssd/gss_names.c
-@@ -0,0 +1,138 @@
-+/*
-+ Copyright (c) 2000 The Regents of the University of Michigan.
-+ All rights reserved.
-+
-+ Copyright (c) 2002 Bruce Fields <bfields@UMICH.EDU>
-+
-+ Redistribution and use in source and binary forms, with or without
-+ modification, are permitted provided that the following conditions
-+ are met:
-+
-+ 1. Redistributions of source code must retain the above copyright
-+ notice, this list of conditions and the following disclaimer.
-+ 2. Redistributions in binary form must reproduce the above copyright
-+ notice, this list of conditions and the following disclaimer in the
-+ documentation and/or other materials provided with the distribution.
-+ 3. Neither the name of the University nor the names of its
-+ contributors may be used to endorse or promote products derived
-+ from this software without specific prior written permission.
-+
-+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
-+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-+ DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+*/
-+
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif /* HAVE_CONFIG_H */
-+
-+#include <sys/param.h>
-+#include <sys/stat.h>
-+#include <rpc/rpc.h>
-+
-+#include <pwd.h>
-+#include <stdio.h>
-+#include <unistd.h>
-+#include <ctype.h>
-+#include <string.h>
-+#include <fcntl.h>
-+#include <errno.h>
-+#include <nfsidmap.h>
-+#include <nfslib.h>
-+#include <time.h>
-+
-+#include "svcgssd.h"
-+#include "gss_util.h"
-+#include "err_util.h"
-+#include "context.h"
-+#include "misc.h"
-+#include "gss_oids.h"
-+#include "svcgssd_krb5.h"
-+
-+static int
-+get_krb5_hostbased_name(gss_buffer_desc *name, char **hostbased_name)
-+{
-+ char *p, *sname = NULL;
-+ if (strchr(name->value, '@') && strchr(name->value, '/')) {
-+ if ((sname = calloc(name->length, 1)) == NULL) {
-+ printerr(0, "ERROR: get_krb5_hostbased_name failed "
-+ "to allocate %d bytes\n", name->length);
-+ return -1;
-+ }
-+ /* read in name and instance and replace '/' with '@' */
-+ sscanf(name->value, "%[^@]", sname);
-+ p = strrchr(sname, '/');
-+ if (p == NULL) { /* The '@' preceeded the '/' */
-+ free(sname);
-+ return -1;
-+ }
-+ *p = '@';
-+ }
-+ *hostbased_name = sname;
-+ return 0;
-+}
-+
-+int
-+get_hostbased_client_name(gss_name_t client_name, gss_OID mech,
-+ char **hostbased_name)
-+{
-+ u_int32_t maj_stat, min_stat;
-+ gss_buffer_desc name;
-+ gss_OID name_type = GSS_C_NO_OID;
-+ char *cname;
-+ int res = -1;
-+
-+ *hostbased_name = NULL; /* preset in case we fail */
-+
-+ /* Get the client's gss authenticated name */
-+ maj_stat = gss_display_name(&min_stat, client_name, &name, &name_type);
-+ if (maj_stat != GSS_S_COMPLETE) {
-+ pgsserr("get_hostbased_client_name: gss_display_name",
-+ maj_stat, min_stat, mech);
-+ goto out_err;
-+ }
-+ if (name.length >= 0xffff) { /* don't overflow */
-+ printerr(0, "ERROR: get_hostbased_client_name: "
-+ "received gss_name is too long (%d bytes)\n",
-+ name.length);
-+ goto out_rel_buf;
-+ }
-+
-+ /* For Kerberos, transform the NT_KRB5_PRINCIPAL name to
-+ * an NT_HOSTBASED_SERVICE name */
-+ if (g_OID_equal(&krb5oid, mech)) {
-+ if (get_krb5_hostbased_name(&name, &cname) == 0)
-+ *hostbased_name = cname;
-+ } else {
-+ printerr(1, "WARNING: unknown/unsupport mech OID\n");
-+ }
-+
-+ res = 0;
-+out_rel_buf:
-+ gss_release_buffer(&min_stat, &name);
-+out_err:
-+ return res;
-+}
-+
-+void
-+get_hostbased_client_buffer(gss_name_t client_name, gss_OID mech,
-+ gss_buffer_t buf)
-+{
-+ char *hname;
-+
-+ if (!get_hostbased_client_name(client_name, mech, &hname)) {
-+ buf->length = strlen(hname) + 1;
-+ buf->value = hname;
-+ } else {
-+ buf->length = 0;
-+ buf->value = NULL;
-+ }
-+}
-diff --git a/utils/gssd/gss_names.h b/utils/gssd/gss_names.h
-new file mode 100644
-index 0000000..ce182f7
---- /dev/null
-+++ b/utils/gssd/gss_names.h
-@@ -0,0 +1,36 @@
-+/*
-+ Copyright (c) 2000 The Regents of the University of Michigan.
-+ All rights reserved.
-+
-+ Copyright (c) 2002 Bruce Fields <bfields@UMICH.EDU>
-+
-+ Redistribution and use in source and binary forms, with or without
-+ modification, are permitted provided that the following conditions
-+ are met:
-+
-+ 1. Redistributions of source code must retain the above copyright
-+ notice, this list of conditions and the following disclaimer.
-+ 2. Redistributions in binary form must reproduce the above copyright
-+ notice, this list of conditions and the following disclaimer in the
-+ documentation and/or other materials provided with the distribution.
-+ 3. Neither the name of the University nor the names of its
-+ contributors may be used to endorse or promote products derived
-+ from this software without specific prior written permission.
-+
-+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
-+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-+ DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+*/
-+
-+extern int get_hostbased_client_name(gss_name_t client_name, gss_OID mech,
-+ char **hostbased_name);
-+extern void get_hostbased_client_buffer(gss_name_t client_name,
-+ gss_OID mech, gss_buffer_t buf);
-diff --git a/utils/gssd/gssd.c b/utils/gssd/gssd.c
-index 611ef1a..6b8b863 100644
---- a/utils/gssd/gssd.c
-+++ b/utils/gssd/gssd.c
-@@ -64,6 +64,7 @@ char *ccachesearch[GSSD_MAX_CCACHE_SEARCH + 1];
- int use_memcache = 0;
- int root_uses_machine_creds = 1;
- unsigned int context_timeout = 0;
-+unsigned int rpc_timeout = 5;
- char *preferred_realm = NULL;
- int pipefds[2] = { -1, -1 };
-
-@@ -105,7 +106,7 @@ main(int argc, char *argv[])
- char *progname;
-
- memset(ccachesearch, 0, sizeof(ccachesearch));
-- while ((opt = getopt(argc, argv, "DfvrlmnMp:k:d:t:R:")) != -1) {
-+ while ((opt = getopt(argc, argv, "DfvrlmnMp:k:d:t:T:R:")) != -1) {
- switch (opt) {
- case 'f':
- fg = 1;
-@@ -143,6 +144,9 @@ main(int argc, char *argv[])
- case 't':
- context_timeout = atoi(optarg);
- break;
-+ case 'T':
-+ rpc_timeout = atoi(optarg);
-+ break;
- case 'R':
- preferred_realm = strdup(optarg);
- break;
-diff --git a/utils/gssd/gssd.h b/utils/gssd/gssd.h
-index 56a18d6..48f4ad8 100644
---- a/utils/gssd/gssd.h
-+++ b/utils/gssd/gssd.h
-@@ -66,6 +66,7 @@ extern char *ccachesearch[];
- extern int use_memcache;
- extern int root_uses_machine_creds;
- extern unsigned int context_timeout;
-+extern unsigned int rpc_timeout;
- extern char *preferred_realm;
- extern int pipefds[2];
-
-diff --git a/utils/gssd/gssd.man b/utils/gssd/gssd.man
-index ac13fd4..ea58fa0 100644
---- a/utils/gssd/gssd.man
-+++ b/utils/gssd/gssd.man
-@@ -289,6 +289,14 @@ new kernel contexts to be negotiated after
- seconds, which allows changing Kerberos tickets and identities frequently.
- The default is no explicit timeout, which means the kernel context will live
- the lifetime of the Kerberos service ticket used in its creation.
-+.TP
-+.B -T timeout
-+Timeout, in seconds, to create an RPC connection with a server while
-+establishing an authenticated gss context for a user.
-+The default timeout is set to 5 seconds.
-+If you get messages like "WARNING: can't create tcp rpc_clnt to server
-+%servername% for user with uid %uid%: RPC: Remote system error -
-+Connection timed out", you should consider an increase of this timeout.
- .SH SEE ALSO
- .BR rpc.svcgssd (8),
- .BR kerberos (1),
-diff --git a/utils/gssd/gssd_main_loop.c b/utils/gssd/gssd_main_loop.c
-index 9970028..6946ab6 100644
---- a/utils/gssd/gssd_main_loop.c
-+++ b/utils/gssd/gssd_main_loop.c
-@@ -173,6 +173,10 @@ topdirs_init_list(void)
- if (ret)
- goto out_err;
- }
-+ if (TAILQ_EMPTY(&topdirs_list)) {
-+ printerr(0, "ERROR: rpc_pipefs directory '%s' is empty!\n", pipefs_dir);
-+ return -1;
-+ }
- closedir(pipedir);
- return 0;
- out_err:
-@@ -233,9 +237,10 @@ gssd_run()
- sigaddset(&set, DNOTIFY_SIGNAL);
- sigprocmask(SIG_UNBLOCK, &set, NULL);
-
-- if (topdirs_init_list() != 0)
-- return;
--
-+ if (topdirs_init_list() != 0) {
-+ /* Error msg is already printed */
-+ exit(1);
-+ }
- init_client_list();
-
- printerr(1, "beginning poll\n");
-diff --git a/utils/gssd/gssd_proc.c b/utils/gssd/gssd_proc.c
-index 33cfeb2..121feb1 100644
---- a/utils/gssd/gssd_proc.c
-+++ b/utils/gssd/gssd_proc.c
-@@ -77,6 +77,7 @@
- #include "context.h"
- #include "nfsrpc.h"
- #include "nfslib.h"
-+#include "gss_names.h"
-
- /*
- * pollarray:
-@@ -217,7 +218,7 @@ get_servername(const char *name, const struct sockaddr *sa, const char *addr)
- NI_NAMEREQD);
- if (err) {
- printerr(0, "ERROR: unable to resolve %s to hostname: %s\n",
-- addr, err == EAI_SYSTEM ? strerror(err) :
-+ addr, err == EAI_SYSTEM ? strerror(errno) :
- gai_strerror(err));
- return NULL;
- }
-@@ -681,19 +682,25 @@ parse_enctypes(char *enctypes)
- return 0;
- }
-
--static int
-+static void
- do_downcall(int k5_fd, uid_t uid, struct authgss_private_data *pd,
-- gss_buffer_desc *context_token, OM_uint32 lifetime_rec)
-+ gss_buffer_desc *context_token, OM_uint32 lifetime_rec,
-+ gss_buffer_desc *acceptor)
- {
- char *buf = NULL, *p = NULL, *end = NULL;
- unsigned int timeout = context_timeout;
- unsigned int buf_size = 0;
-
-- printerr(1, "doing downcall lifetime_rec %u\n", lifetime_rec);
-+ printerr(1, "doing downcall: lifetime_rec=%u acceptor=%.*s\n",
-+ lifetime_rec, acceptor->length, acceptor->value);
- buf_size = sizeof(uid) + sizeof(timeout) + sizeof(pd->pd_seq_win) +
- sizeof(pd->pd_ctx_hndl.length) + pd->pd_ctx_hndl.length +
-- sizeof(context_token->length) + context_token->length;
-+ sizeof(context_token->length) + context_token->length +
-+ sizeof(acceptor->length) + acceptor->length;
- p = buf = malloc(buf_size);
-+ if (!buf)
-+ goto out_err;
-+
- end = buf + buf_size;
-
- /* context_timeout set by -t option overrides context lifetime */
-@@ -704,14 +711,15 @@ do_downcall(int k5_fd, uid_t uid, struct authgss_private_data *pd,
- if (WRITE_BYTES(&p, end, pd->pd_seq_win)) goto out_err;
- if (write_buffer(&p, end, &pd->pd_ctx_hndl)) goto out_err;
- if (write_buffer(&p, end, context_token)) goto out_err;
-+ if (write_buffer(&p, end, acceptor)) goto out_err;
-
- if (write(k5_fd, buf, p - buf) < p - buf) goto out_err;
-- if (buf) free(buf);
-- return 0;
-+ free(buf);
-+ return;
- out_err:
-- if (buf) free(buf);
-+ free(buf);
- printerr(1, "Failed to write downcall!\n");
-- return -1;
-+ return;
- }
-
- static int
-@@ -842,7 +850,7 @@ create_auth_rpc_client(struct clnt_info *clp,
- OM_uint32 min_stat;
- char rpc_errmsg[1024];
- int protocol;
-- struct timeval timeout = {5, 0};
-+ struct timeval timeout;
- struct sockaddr *addr = (struct sockaddr *) &clp->addr;
- socklen_t salen;
-
-@@ -910,6 +918,10 @@ create_auth_rpc_client(struct clnt_info *clp,
- if (!populate_port(addr, salen, clp->prog, clp->vers, protocol))
- goto out_fail;
-
-+ /* set the timeout according to the requested valued */
-+ timeout.tv_sec = (long) rpc_timeout;
-+ timeout.tv_usec = (long) 0;
-+
- rpc_clnt = nfs_get_rpcclient(addr, salen, protocol, clp->prog,
- clp->vers, &timeout);
- if (!rpc_clnt) {
-@@ -1031,6 +1043,9 @@ process_krb5_upcall(struct clnt_info *clp, uid_t uid, int fd, char *tgtname,
- gss_cred_id_t gss_cred;
- OM_uint32 maj_stat, min_stat, lifetime_rec;
- pid_t pid;
-+ gss_name_t gacceptor = GSS_C_NO_NAME;
-+ gss_OID mech;
-+ gss_buffer_desc acceptor = {0};
-
- pid = fork();
- switch(pid) {
-@@ -1171,15 +1186,24 @@ process_krb5_upcall(struct clnt_info *clp, uid_t uid, int fd, char *tgtname,
- goto out_return_error;
- }
-
-- /* Grab the context lifetime to pass to the kernel. lifetime_rec
-- * is set to zero on error */
-- maj_stat = gss_inquire_context(&min_stat, pd.pd_ctx, NULL, NULL,
-- &lifetime_rec, NULL, NULL, NULL, NULL);
-+ /* Grab the context lifetime and acceptor name out of the ctx. */
-+ maj_stat = gss_inquire_context(&min_stat, pd.pd_ctx, NULL, &gacceptor,
-+ &lifetime_rec, &mech, NULL, NULL, NULL);
-
-- if (maj_stat)
-- printerr(1, "WARNING: Failed to inquire context for lifetme "
-- "maj_stat %u\n", maj_stat);
-+ if (maj_stat != GSS_S_COMPLETE) {
-+ printerr(1, "WARNING: Failed to inquire context "
-+ "maj_stat (0x%x)\n", maj_stat);
-+ lifetime_rec = 0;
-+ } else {
-+ get_hostbased_client_buffer(gacceptor, mech, &acceptor);
-+ gss_release_name(&min_stat, &gacceptor);
-+ }
-
-+ /*
-+ * The serialization can mean turning pd.pd_ctx into a lucid context. If
-+ * that happens then the pd.pd_ctx will be unusable, so we must never
-+ * try to use it after this point.
-+ */
- if (serialize_context_for_kernel(&pd.pd_ctx, &token, &krb5oid, NULL)) {
- printerr(0, "WARNING: Failed to serialize krb5 context for "
- "user with uid %d for server %s\n",
-@@ -1187,9 +1211,10 @@ process_krb5_upcall(struct clnt_info *clp, uid_t uid, int fd, char *tgtname,
- goto out_return_error;
- }
-
-- do_downcall(fd, uid, &pd, &token, lifetime_rec);
-+ do_downcall(fd, uid, &pd, &token, lifetime_rec, &acceptor);
-
- out:
-+ gss_release_buffer(&min_stat, &acceptor);
- if (token.value)
- free(token.value);
- #ifdef HAVE_AUTHGSS_FREE_PRIVATE_DATA
-diff --git a/utils/gssd/svcgssd_proc.c b/utils/gssd/svcgssd_proc.c
-index 3757d51..5bdb438 100644
---- a/utils/gssd/svcgssd_proc.c
-+++ b/utils/gssd/svcgssd_proc.c
-@@ -59,6 +59,7 @@
- #include "misc.h"
- #include "gss_oids.h"
- #include "svcgssd_krb5.h"
-+#include "gss_names.h"
-
- extern char * mech2file(gss_OID mech);
- #define SVCGSSD_CONTEXT_CHANNEL "/proc/net/rpc/auth.rpcsec.context/channel"
-@@ -315,71 +316,6 @@ print_hexl(const char *description, unsigned char *cp, int length)
- }
- #endif
-
--static int
--get_krb5_hostbased_name (gss_buffer_desc *name, char **hostbased_name)
--{
-- char *p, *sname = NULL;
-- if (strchr(name->value, '@') && strchr(name->value, '/')) {
-- if ((sname = calloc(name->length, 1)) == NULL) {
-- printerr(0, "ERROR: get_krb5_hostbased_name failed "
-- "to allocate %d bytes\n", name->length);
-- return -1;
-- }
-- /* read in name and instance and replace '/' with '@' */
-- sscanf(name->value, "%[^@]", sname);
-- p = strrchr(sname, '/');
-- if (p == NULL) { /* The '@' preceeded the '/' */
-- free(sname);
-- return -1;
-- }
-- *p = '@';
-- }
-- *hostbased_name = sname;
-- return 0;
--}
--
--static int
--get_hostbased_client_name(gss_name_t client_name, gss_OID mech,
-- char **hostbased_name)
--{
-- u_int32_t maj_stat, min_stat;
-- gss_buffer_desc name;
-- gss_OID name_type = GSS_C_NO_OID;
-- char *cname;
-- int res = -1;
--
-- *hostbased_name = NULL; /* preset in case we fail */
--
-- /* Get the client's gss authenticated name */
-- maj_stat = gss_display_name(&min_stat, client_name, &name, &name_type);
-- if (maj_stat != GSS_S_COMPLETE) {
-- pgsserr("get_hostbased_client_name: gss_display_name",
-- maj_stat, min_stat, mech);
-- goto out_err;
-- }
-- if (name.length >= 0xffff) { /* don't overflow */
-- printerr(0, "ERROR: get_hostbased_client_name: "
-- "received gss_name is too long (%d bytes)\n",
-- name.length);
-- goto out_rel_buf;
-- }
--
-- /* For Kerberos, transform the NT_KRB5_PRINCIPAL name to
-- * an NT_HOSTBASED_SERVICE name */
-- if (g_OID_equal(&krb5oid, mech)) {
-- if (get_krb5_hostbased_name(&name, &cname) == 0)
-- *hostbased_name = cname;
-- } else {
-- printerr(1, "WARNING: unknown/unsupport mech OID\n");
-- }
--
-- res = 0;
--out_rel_buf:
-- gss_release_buffer(&min_stat, &name);
--out_err:
-- return res;
--}
--
- void
- handle_nullreq(FILE *f) {
- /* XXX initialize to a random integer to reduce chances of unnecessary
-diff --git a/utils/mount/error.c b/utils/mount/error.c
-index f8fc13f..e06f598 100644
---- a/utils/mount/error.c
-+++ b/utils/mount/error.c
-@@ -215,8 +215,12 @@ void mount_error(const char *spec, const char *mount_point, int error)
- progname);
- break;
- case ENOTDIR:
-- nfs_error(_("%s: mount point %s is not a directory"),
-- progname, mount_point);
-+ if (spec)
-+ nfs_error(_("%s: mount spec %s or point %s is not a "
-+ "directory"), progname, spec, mount_point);
-+ else
-+ nfs_error(_("%s: mount point %s is not a directory"),
-+ progname, mount_point);
- break;
- case EBUSY:
- nfs_error(_("%s: %s is busy or already mounted"),
-diff --git a/utils/mount/nfsmount.conf b/utils/mount/nfsmount.conf
-index 9b8ff4a..aeb3023 100644
---- a/utils/mount/nfsmount.conf
-+++ b/utils/mount/nfsmount.conf
-@@ -133,3 +133,12 @@
- # RPCGSS security flavors
- # [none, sys, krb5, krb5i, krb5p ]
- # Sec=sys
-+#
-+# Allow Signals to interrupt file operations
-+# Intr=True
-+#
-+# Specifies how the kernel manages its cache of directory
-+# Lookupcache=all|none|pos|positive
-+#
-+# Turn of the caching of that access time
-+# noatime=True
-diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c
-index 9a1bb27..b0cc6a8 100644
---- a/utils/mountd/cache.c
-+++ b/utils/mountd/cache.c
-@@ -377,6 +377,86 @@ static char *next_mnt(void **v, char *p)
- return me->mnt_dir;
- }
-
-+/* same_path() check is two paths refer to the same directory.
-+ * We don't rely on 'strcmp()' as some filesystems support case-insensitive
-+ * names and we might have two different names for the one directory.
-+ * Theoretically the lengths of the names could be different, but the
-+ * number of components must be the same.
-+ * So if the paths have the same number of components (but aren't identical)
-+ * we ask the kernel if they are the same thing.
-+ * By preference we use name_to_handle_at(), as the mntid it returns
-+ * will distinguish between bind-mount points. If that isn't available
-+ * we fall back on lstat, which is usually good enough.
-+ */
-+static inline int count_slashes(char *p)
-+{
-+ int cnt = 0;
-+ while (*p)
-+ if (*p++ == '/')
-+ cnt++;
-+ return cnt;
-+}
-+
-+static int same_path(char *child, char *parent, int len)
-+{
-+ static char p[PATH_MAX];
-+ struct stat sc, sp;
-+
-+ if (len <= 0)
-+ len = strlen(child);
-+ strncpy(p, child, len);
-+ p[len] = 0;
-+ if (strcmp(p, parent) == 0)
-+ return 1;
-+
-+ /* If number of '/' are different, they must be different */
-+ if (count_slashes(p) != count_slashes(parent))
-+ return 0;
-+
-+#if HAVE_NAME_TO_HANDLE_AT
-+ struct {
-+ struct file_handle fh;
-+ unsigned char handle[128];
-+ } fchild, fparent;
-+ int mnt_child, mnt_parent;
-+
-+ fchild.fh.handle_bytes = 128;
-+ fparent.fh.handle_bytes = 128;
-+ if (name_to_handle_at(AT_FDCWD, p, &fchild.fh, &mnt_child, 0) != 0) {
-+ if (errno == ENOSYS)
-+ goto fallback;
-+ return 0;
-+ }
-+ if (name_to_handle_at(AT_FDCWD, parent, &fparent.fh, &mnt_parent, 0) != 0)
-+ return 0;
-+
-+ if (mnt_child != mnt_parent ||
-+ fchild.fh.handle_bytes != fparent.fh.handle_bytes ||
-+ fchild.fh.handle_type != fparent.fh.handle_type ||
-+ memcmp(fchild.handle, fparent.handle,
-+ fchild.fh.handle_bytes) != 0)
-+ return 0;
-+
-+ return 1;
-+fallback:
-+#endif
-+
-+ /* This is nearly good enough. However if a directory is
-+ * bind-mounted in two places and both are exported, it
-+ * could give a false positive
-+ */
-+ if (lstat(p, &sc) != 0)
-+ return 0;
-+ if (lstat(parent, &sp) != 0)
-+ return 0;
-+ if (sc.st_dev != sp.st_dev)
-+ return 0;
-+ if (sc.st_ino != sp.st_ino)
-+ return 0;
-+
-+ return 1;
-+}
-+
- static int is_subdirectory(char *child, char *parent)
- {
- /* Check is child is strictly a subdirectory of
-@@ -387,7 +467,7 @@ static int is_subdirectory(char *child, char *parent)
- if (strcmp(parent, "/") == 0 && child[1] != 0)
- return 1;
-
-- return (strncmp(child, parent, l) == 0 && child[l] == '/');
-+ return (same_path(child, parent, l) && child[l] == '/');
- }
-
- static int path_matches(nfs_export *exp, char *path)
-@@ -396,7 +476,7 @@ static int path_matches(nfs_export *exp, char *path)
- * exact match, or does the export have CROSSMOUNT, and path
- * is a descendant?
- */
-- return strcmp(path, exp->m_export.e_path) == 0
-+ return same_path(path, exp->m_export.e_path, 0)
- || ((exp->m_export.e_flags & NFSEXP_CROSSMOUNT)
- && is_subdirectory(path, exp->m_export.e_path));
- }
-diff --git a/utils/mountd/mountd.man b/utils/mountd/mountd.man
-index e59a559..a8828ae 100644
---- a/utils/mountd/mountd.man
-+++ b/utils/mountd/mountd.man
-@@ -86,7 +86,7 @@ Turn on debugging. Valid kinds are: all, auth, call, general and parse.
- .B \-F " or " \-\-foreground
- Run in foreground (do not daemonize)
- .TP
--.B \-f " or " \-\-exports-file
-+.B \-f export-file " or " \-\-exports-file export-file
- This option specifies the exports file, listing the clients that this
- server is prepared to serve and parameters to apply to each
- such mount (see
-@@ -101,7 +101,7 @@ Display usage message.
- Set the limit of the number of open file descriptors to num. The
- default is to leave the limit unchanged.
- .TP
--.B \-N " or " \-\-no-nfs-version
-+.B \-N mountd-version " or " \-\-no-nfs-version mountd-version
- This option can be used to request that
- .B rpc.mountd
- do not offer certain versions of NFS. The current version of
-@@ -118,7 +118,7 @@ Don't advertise TCP for mount.
- .B \-P
- Ignored (compatibility with unfsd??).
- .TP
--.B \-p " or " \-\-port num
-+.B \-p num " or " \-\-port num
- Specifies the port number used for RPC listener sockets.
- If this option is not specified,
- .B rpc.mountd
-@@ -132,7 +132,7 @@ This option can be used to fix the port value of
- listeners when NFS MOUNT requests must traverse a firewall
- between clients and servers.
- .TP
--.B \-H " or " \-\-ha-callout prog
-+.B \-H " prog or " \-\-ha-callout prog
- Specify a high availability callout program.
- This program receives callouts for all MOUNT and UNMOUNT requests.
- This allows
-@@ -174,7 +174,7 @@ to perform a reverse lookup on each IP address and return that hostname instead.
- Enabling this can have a substantial negative effect on performance
- in some situations.
- .TP
--.BR "\-t N" " or " "\-\-num\-threads=N"
-+.BR "\-t N" " or " "\-\-num\-threads=N" or " \-\-num\-threads N"
- This option specifies the number of worker threads that rpc.mountd
- spawns. The default is 1 thread, which is probably enough. More
- threads are usually only needed for NFS servers which need to handle
-@@ -184,7 +184,7 @@ your DNS server is slow or unreliable.
- .B \-u " or " \-\-no-udp
- Don't advertise UDP for mounting
- .TP
--.B \-V " or " \-\-nfs-version
-+.B \-V version " or " \-\-nfs-version version
- This option can be used to request that
- .B rpc.mountd
- offer certain versions of NFS. The current version of
-diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c
-index 73d6a92..03e3c81 100644
---- a/utils/nfsd/nfsd.c
-+++ b/utils/nfsd/nfsd.c
-@@ -101,7 +101,7 @@ main(int argc, char **argv)
- int count = NFSD_NPROC, c, i, error = 0, portnum = 0, fd, found_one;
- char *p, *progname, *port, *rdma_port = NULL;
- char **haddr = NULL;
-- unsigned int hcounter = 0;
-+ int hcounter = 0;
- int socket_up = 0;
- unsigned int minorvers = 0;
- unsigned int minorversset = 0;
-diff --git a/utils/nfsdcltrack/Makefile.am b/utils/nfsdcltrack/Makefile.am
-index a860ffb..7524295 100644
---- a/utils/nfsdcltrack/Makefile.am
-+++ b/utils/nfsdcltrack/Makefile.am
-@@ -1,5 +1,9 @@
- ## Process this file with automake to produce Makefile.in
-
-+# These binaries go in /sbin (not /usr/sbin), and that cannot be
-+# overridden at config time. The kernel "knows" the /sbin name.
-+sbindir = /sbin
-+
- man8_MANS = nfsdcltrack.man
- EXTRA_DIST = $(man8_MANS)
-
-diff --git a/utils/statd/callback.c b/utils/statd/callback.c
-index d1cc139..bb7c590 100644
---- a/utils/statd/callback.c
-+++ b/utils/statd/callback.c
-@@ -10,11 +10,13 @@
- #include <config.h>
- #endif
-
-+#include <unistd.h>
- #include <netdb.h>
-
- #include "rpcmisc.h"
- #include "statd.h"
- #include "notlist.h"
-+#include "ha-callout.h"
-
- /* Callback notify list. */
- /* notify_list *cbnl = NULL; ... never used */
-@@ -87,6 +89,13 @@ sm_notify_1_svc(struct stat_chge *argp, struct svc_req *rqstp)
- xlog(D_CALL, "Received SM_NOTIFY from %s, state: %d",
- argp->mon_name, argp->state);
-
-+ if (!statd_present_address(sap, ip_addr, sizeof(ip_addr))) {
-+ xlog_warn("Unrecognized sender address");
-+ return ((void *) &result);
-+ }
-+
-+ ha_callout("sm-notify", argp->mon_name, ip_addr, argp->state);
-+
- /* quick check - don't bother if we're not monitoring anyone */
- if (rtnl == NULL) {
- xlog_warn("SM_NOTIFY from %s while not monitoring any hosts",
-@@ -94,11 +103,6 @@ sm_notify_1_svc(struct stat_chge *argp, struct svc_req *rqstp)
- return ((void *) &result);
- }
-
-- if (!statd_present_address(sap, ip_addr, sizeof(ip_addr))) {
-- xlog_warn("Unrecognized sender address");
-- return ((void *) &result);
-- }
--
- /* okir change: statd doesn't remove the remote host from its
- * internal monitor list when receiving an SM_NOTIFY call from
- * it. Lockd will want to continue monitoring the remote host
-diff --git a/utils/statd/start-statd b/utils/statd/start-statd
-index cde3583..dcdaf77 100644
---- a/utils/statd/start-statd
-+++ b/utils/statd/start-statd
-@@ -4,8 +4,8 @@
- # /var/run/rpc.statd.pid).
- # It should run statd with whatever flags are apropriate for this
- # site.
--PATH=/sbin:/usr/sbin
--if systemctl start statd.service
-+PATH="/sbin:/usr/sbin:/bin:/usr/bin"
-+if systemctl start rpc-statd.service
- then :
- else
- exec rpc.statd --no-notify
-diff --git a/utils/statd/statd.man b/utils/statd/statd.man
-index 896c2f8..1e5520c 100644
---- a/utils/statd/statd.man
-+++ b/utils/statd/statd.man
-@@ -346,7 +346,8 @@ points due to inactivity.
- .SS High-availability callouts
- .B rpc.statd
- can exec a special callout program during processing of
--successful SM_MON, SM_UNMON, and SM_UNMON_ALL requests.
-+successful SM_MON, SM_UNMON, and SM_UNMON_ALL requests,
-+or when it receives SM_NOTIFY.
- Such a program may be used in High Availability NFS (HA-NFS)
- environments to track lock state that may need to be migrated after
- a system reboot.
-@@ -357,15 +358,26 @@ option.
- The program is run with 3 arguments:
- The first is either
- .B add-client
--or
- .B del-client
-+or
-+.B sm-notify
- depending on the reason for the callout.
- The second is the
- .I mon_name
- of the monitored peer.
- The third is the
--.I caller_name
--of the requesting lock manager.
-+.I caller_name
-+of the requesting lock manager for
-+.B add-client
-+or
-+.B del-client
-+, otherwise it is
-+.I IP_address
-+of the caller sending SM_NOTIFY.
-+The forth is the
-+.I state_value
-+in the SM_NOTIFY request.
-+
- .SS IPv6 and TI-RPC support
- TI-RPC is a pre-requisite for supporting NFS on IPv6.
- If TI-RPC support is built into