From eb9980846b8f2e0a2ba344a06d6cc6e42df7bd868f608dbb4c315c1cdaf060f8 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Wed, 14 May 2014 02:46:47 +0000 Subject: [PATCH 1/7] - New upstream version 1.3.0. Includes all our bugfix patches except 1. Adds assorted other bugfixes and improvements including initial support for NFSv4.2 Prepares the way for better systemd integration. Discards useless programs gss_clnt_send_err and gss_destroy_creds - Removes: 0001-mountd-Fix-is_subdirectory-again.patch - Removes: 0002-gssd-Fix-recent-fix-to-Avoid-DNS-reverse-resolution-.patch - Removes: 0003-Fix-handling-of-preferred-realm-command-line-option.patch - Removes: 0004-nfsiostat-restore-output-format.patch - Removes: 0005-gssd-don-t-give-up-on-machine-credential-if-hostname.patch - Removes: 0006-gssd-fixed-typo-in-machine-cred-name.patch - Removes: skip-on-ENOENT.patch - Removes: mountd-fix-bug-affecting-exports-of-dirs-with-64bit-.patch - Removes: exportfs-exit-with-error-code-if-there-was-any-error.patch - Removes: exportfs-report-failure-if-asked-to-unexport-somethi.patch - Removes: gssd-mount-hang-fix.patch - Removes: udp-fallback-fix.patch - Removes: fedfs-lib-name.patch - 0001-nfsidmap-Keys-need-to-be-invalidated-instead-of-revo.patch This upstream patch is currently reverted until we get a newer version of keyutils. OBS-URL: https://build.opensuse.org/package/show/Base:System/nfs-utils?expand=0&rev=119 --- 0001-mountd-Fix-is_subdirectory-again.patch | 81 ------------ ...ed-to-be-invalidated-instead-of-revo.patch | 68 ++++++++++ ...fix-to-Avoid-DNS-reverse-resolution-.patch | 102 --------------- ...-preferred-realm-command-line-option.patch | 45 ------- 0004-nfsiostat-restore-output-format.patch | 69 ---------- ...up-on-machine-credential-if-hostname.patch | 48 ------- ...gssd-fixed-typo-in-machine-cred-name.patch | 31 ----- ...th-error-code-if-there-was-any-error.patch | 121 ------------------ ...failure-if-asked-to-unexport-somethi.patch | 40 ------ fedfs-lib-name.patch | 59 --------- gssd-mount-hang-fix.patch | 88 ------------- ...ffecting-exports-of-dirs-with-64bit-.patch | 105 --------------- nfs-utils-1.2.8.tar.bz2 | 3 - nfs-utils-1.3.0.tar.bz2 | 3 + nfs-utils.changes | 28 ++++ nfs-utils.spec | 47 +------ skip-on-ENOENT.patch | 38 ------ udp-fallback-fix.patch | 36 ------ 18 files changed, 103 insertions(+), 909 deletions(-) delete mode 100644 0001-mountd-Fix-is_subdirectory-again.patch create mode 100644 0001-nfsidmap-Keys-need-to-be-invalidated-instead-of-revo.patch delete mode 100644 0002-gssd-Fix-recent-fix-to-Avoid-DNS-reverse-resolution-.patch delete mode 100644 0003-Fix-handling-of-preferred-realm-command-line-option.patch delete mode 100644 0004-nfsiostat-restore-output-format.patch delete mode 100644 0005-gssd-don-t-give-up-on-machine-credential-if-hostname.patch delete mode 100644 0006-gssd-fixed-typo-in-machine-cred-name.patch delete mode 100644 exportfs-exit-with-error-code-if-there-was-any-error.patch delete mode 100644 exportfs-report-failure-if-asked-to-unexport-somethi.patch delete mode 100644 fedfs-lib-name.patch delete mode 100644 gssd-mount-hang-fix.patch delete mode 100644 mountd-fix-bug-affecting-exports-of-dirs-with-64bit-.patch delete mode 100644 nfs-utils-1.2.8.tar.bz2 create mode 100644 nfs-utils-1.3.0.tar.bz2 delete mode 100644 skip-on-ENOENT.patch delete mode 100644 udp-fallback-fix.patch diff --git a/0001-mountd-Fix-is_subdirectory-again.patch b/0001-mountd-Fix-is_subdirectory-again.patch deleted file mode 100644 index 54c0317..0000000 --- a/0001-mountd-Fix-is_subdirectory-again.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 23d3980b6cfea4e9056d9b7b81e48b4fefc645e0 Mon Sep 17 00:00:00 2001 -From: NeilBrown -Date: Tue, 7 May 2013 11:46:18 -0400 -Subject: [PATCH] mountd: Fix is_subdirectory again - -The problem was that is_subdirectory() would also succeed if the two -directories were the same. This is needed for path_matches() which -needs to see if the child is same-or-descendant. - -So this patch rearranges path_matches() to do the "are they the same" -test itself and only bother with is_subdirectory() if it they are not -the same. - -So now is_subdirectory() can be strict, and so can be usable for -subexport(), which needs a strong 'in subdirectory - not the same' test. - -Acked-by: J. Bruce Fields -Signed-off-by: NeilBrown -Signed-off-by: Steve Dickson ---- - utils/mountd/cache.c | 24 ++++++++++++++---------- - 1 file changed, 14 insertions(+), 10 deletions(-) - -diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c -index 737927c..517aa62 100644 ---- a/utils/mountd/cache.c -+++ b/utils/mountd/cache.c -@@ -347,20 +347,26 @@ static char *next_mnt(void **v, char *p) - - static int is_subdirectory(char *child, char *parent) - { -+ /* Check is child is strictly a subdirectory of -+ * parent or a more distant descendant. -+ */ - size_t l = strlen(parent); - -- if (strcmp(parent, "/") == 0) -+ if (strcmp(parent, "/") == 0 && child[1] != 0) - return 1; - -- return strcmp(child, parent) == 0 -- || (strncmp(child, parent, l) == 0 && child[l] == '/'); -+ return (strncmp(child, parent, l) == 0 && child[l] == '/'); - } - - static int path_matches(nfs_export *exp, char *path) - { -- if (exp->m_export.e_flags & NFSEXP_CROSSMOUNT) -- return is_subdirectory(path, exp->m_export.e_path); -- return strcmp(path, exp->m_export.e_path) == 0; -+ /* Does the path match the export? I.e. is it an -+ * exact match, or does the export have CROSSMOUNT, and path -+ * is a descendant? -+ */ -+ return strcmp(path, exp->m_export.e_path) == 0 -+ || ((exp->m_export.e_flags & NFSEXP_CROSSMOUNT) -+ && is_subdirectory(path, exp->m_export.e_path)); - } - - static int -@@ -369,15 +375,13 @@ export_matches(nfs_export *exp, char *dom, char *path, struct addrinfo *ai) - return path_matches(exp, path) && client_matches(exp, dom, ai); - } - --/* True iff e1 is a child of e2 and e2 has crossmnt set: */ -+/* True iff e1 is a child of e2 (or descendant) and e2 has crossmnt set: */ - static bool subexport(struct exportent *e1, struct exportent *e2) - { - char *p1 = e1->e_path, *p2 = e2->e_path; -- size_t l2 = strlen(p2); - - return e2->e_flags & NFSEXP_CROSSMOUNT -- && strncmp(p1, p2, l2) == 0 -- && p1[l2] == '/'; -+ && is_subdirectory(p1, p2); - } - - struct parsed_fsid { --- -1.8.3.1.487.g3e7a5b4 - diff --git a/0001-nfsidmap-Keys-need-to-be-invalidated-instead-of-revo.patch b/0001-nfsidmap-Keys-need-to-be-invalidated-instead-of-revo.patch new file mode 100644 index 0000000..da63ba0 --- /dev/null +++ b/0001-nfsidmap-Keys-need-to-be-invalidated-instead-of-revo.patch @@ -0,0 +1,68 @@ +From 2ae0763a618d30037ebb2520f6292f80d838a440 Mon Sep 17 00:00:00 2001 +From: Steve Dickson +Date: Tue, 25 Mar 2014 10:56:58 -0400 +Subject: [PATCH] nfsidmap: Keys need to be invalidated instead of revoked + +With some recent kernel changes to the key ring +for a key to be removed they need to be invalidated +instead of revoked. + +Signed-off-by: Steve Dickson +--- + utils/nfsidmap/nfsidmap.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/utils/nfsidmap/nfsidmap.c b/utils/nfsidmap/nfsidmap.c +index 2518ed6b022b..3f51b4d4ca1b 100644 +--- a/utils/nfsidmap/nfsidmap.c ++++ b/utils/nfsidmap/nfsidmap.c +@@ -166,7 +166,7 @@ static int keyring_clear(char *keyring) + /* + * Revoke a key + */ +-static int key_revoke(char *keystr, int keymask) ++static int key_invalidate(char *keystr, int keymask) + { + FILE *fp; + char buf[BUFSIZ], *ptr; +@@ -200,7 +200,7 @@ static int key_revoke(char *keystr, int keymask) + + if (verbose) { + *(strchr(buf, '\n')) = '\0'; +- xlog_warn("revoking '%s'", buf); ++ xlog_warn("invalidating '%s'", buf); + } + /* + * The key is the first arugment in the string +@@ -208,8 +208,8 @@ static int key_revoke(char *keystr, int keymask) + *(strchr(buf, ' ')) = '\0'; + sscanf(buf, "%x", &key); + +- if (keyctl_revoke(key) < 0) { +- xlog_err("keyctl_revoke(0x%x) failed: %m", key); ++ if (keyctl_invalidate(key) < 0) { ++ xlog_err("keyctl_invalidate(0x%x) failed: %m", key); + fclose(fp); + return 1; + } +@@ -273,7 +273,7 @@ int main(int argc, char **argv) + } + } + +- if (rc = nfs4_init_name_mapping(PATH_IDMAPDCONF)) { ++ if ((rc = nfs4_init_name_mapping(PATH_IDMAPDCONF))) { + xlog_errno(rc, "Unable to create name to user id mappings."); + return 1; + } +@@ -281,7 +281,7 @@ int main(int argc, char **argv) + verbose = conf_get_num("General", "Verbosity", 0); + + if (keystr) { +- rc = key_revoke(keystr, keymask); ++ rc = key_invalidate(keystr, keymask); + return rc; + } + if (clearing) { +-- +1.8.3.1.487.g3e7a5b4 + diff --git a/0002-gssd-Fix-recent-fix-to-Avoid-DNS-reverse-resolution-.patch b/0002-gssd-Fix-recent-fix-to-Avoid-DNS-reverse-resolution-.patch deleted file mode 100644 index 70d6f90..0000000 --- a/0002-gssd-Fix-recent-fix-to-Avoid-DNS-reverse-resolution-.patch +++ /dev/null @@ -1,102 +0,0 @@ -From c93e8d8eeafec3e3228e24dfebef113e0a79a788 Mon Sep 17 00:00:00 2001 -From: "Signed-off-by: NeilBrown" -Date: Tue, 28 May 2013 12:59:22 -0400 -Subject: [PATCH] gssd: Fix recent fix to Avoid DNS reverse resolution in gssd. - -The final version for this fix that was committed inverted the test -so makes no change in the important cases. - -The documentation didn't really help a naive user know when the new -D -flag should be used. - -And the code (once fixed) avoided DNS resolution on non-qualified names too, -which probably isn't a good idea. - -This patch fixes all three issues. - -Signed-off-by: NeilBrown -Signed-off-by: Steve Dickson ---- - utils/gssd/gssd.man | 27 ++++++++++++++++++++++----- - utils/gssd/gssd_proc.c | 18 ++++++++++-------- - 2 files changed, 32 insertions(+), 13 deletions(-) - -diff --git a/utils/gssd/gssd.man b/utils/gssd/gssd.man -index 1df75c5..ac13fd4 100644 ---- a/utils/gssd/gssd.man -+++ b/utils/gssd/gssd.man -@@ -195,11 +195,28 @@ option when starting - .BR rpc.gssd . - .SH OPTIONS - .TP --.B -D --DNS Reverse lookups are not used for determining the --server names pass to GSSAPI. This option will reverses that and forces --the use of DNS Reverse resolution of the server's IP address to --retrieve the server name to use in GSAPI authentication. -+.B \-D -+The server name passed to GSSAPI for authentication is normally the -+name exactly as requested. e.g. for NFS -+it is the server name in the "servername:/path" mount request. Only if this -+servername appears to be an IP address (IPv4 or IPv6) or an -+unqualified name (no dots) will a reverse DNS lookup -+will be performed to get the canoncial server name. -+ -+If -+.B \-D -+is present, a reverse DNS lookup will -+.I always -+be used, even if the server name looks like a canonical name. So it -+is needed if partially qualified, or non canonical names are regularly -+used. -+ -+Using -+.B \-D -+can introduce a security vulnerability, so it is recommended that -+.B \-D -+not be used, and that canonical names always be used when requesting -+services. - .TP - .B -f - Runs -diff --git a/utils/gssd/gssd_proc.c b/utils/gssd/gssd_proc.c -index 6cd4276..b7e2bbb 100644 ---- a/utils/gssd/gssd_proc.c -+++ b/utils/gssd/gssd_proc.c -@@ -175,7 +175,6 @@ get_servername(const char *name, const struct sockaddr *sa, const char *addr) - char *hostname; - char hbuf[NI_MAXHOST]; - unsigned char buf[sizeof(struct in6_addr)]; -- int servername = 0; - - if (avoid_dns) { - /* -@@ -183,15 +182,18 @@ get_servername(const char *name, const struct sockaddr *sa, const char *addr) - * If it is an IP address, do the DNS lookup otherwise - * skip the DNS lookup. - */ -- servername = 0; -- if (strchr(name, '.') && inet_pton(AF_INET, name, buf) == 1) -- servername = 1; /* IPv4 */ -- else if (strchr(name, ':') && inet_pton(AF_INET6, name, buf) == 1) -- servername = 1; /* or IPv6 */ -- -- if (servername) { -+ int is_fqdn = 1; -+ if (strchr(name, '.') == NULL) -+ is_fqdn = 0; /* local name */ -+ else if (inet_pton(AF_INET, name, buf) == 1) -+ is_fqdn = 0; /* IPv4 address */ -+ else if (inet_pton(AF_INET6, name, buf) == 1) -+ is_fqdn = 0; /* IPv6 addrss */ -+ -+ if (is_fqdn) { - return strdup(name); - } -+ /* Sorry, cannot avoid dns after all */ - } - - switch (sa->sa_family) { --- -1.8.3.1.487.g3e7a5b4 - diff --git a/0003-Fix-handling-of-preferred-realm-command-line-option.patch b/0003-Fix-handling-of-preferred-realm-command-line-option.patch deleted file mode 100644 index 07b90ff..0000000 --- a/0003-Fix-handling-of-preferred-realm-command-line-option.patch +++ /dev/null @@ -1,45 +0,0 @@ -From a402f768db1dc6497cf7f592b33e142936897de2 Mon Sep 17 00:00:00 2001 -From: Maximilian Wilhelm -Date: Mon, 1 Jul 2013 11:58:13 -0400 -Subject: [PATCH] Fix handling of preferred realm command line option. - -The current implementation ignores any preferred realm specified on the -command line. Fix this behaviour and make sure the preferred realm is -used as first realm when trying to acquire a keytab entry - -Signed-off-by: Maximilian Wilhelm -Signed-off-by: Frederik Moellers -Signed-off-by: Steve Dickson ---- - utils/gssd/krb5_util.c | 12 ++++++++++-- - 1 file changed, 10 insertions(+), 2 deletions(-) - -diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c -index 9ef80f0..abebdcd 100644 ---- a/utils/gssd/krb5_util.c -+++ b/utils/gssd/krb5_util.c -@@ -852,11 +852,19 @@ find_keytab_entry(krb5_context context, krb5_keytab kt, const char *tgtname, - } - - /* -- * Try the "appropriate" realm first, and if nothing found for that -- * realm, try the default realm (if it hasn't already been tried). -+ * Make sure the preferred_realm, which may have been explicitly set -+ * on the command line, is tried first. If nothing is found go on with -+ * the host and local default realm (if that hasn't already been tried). - */ - i = 0; - realm = realmnames[i]; -+ -+ if (strcmp (realm, preferred_realm) != 0) { -+ realm = preferred_realm; -+ /* resetting the realmnames index */ -+ i = -1; -+ } -+ - while (1) { - if (realm == NULL) { - tried_all = 1; --- -1.8.3.1.487.g3e7a5b4 - diff --git a/0004-nfsiostat-restore-output-format.patch b/0004-nfsiostat-restore-output-format.patch deleted file mode 100644 index 51ef2bd..0000000 --- a/0004-nfsiostat-restore-output-format.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 94642a397d27ea0cfc6d798bc505482023eb5ec1 Mon Sep 17 00:00:00 2001 -From: Weston Andros Adamson -Date: Mon, 1 Jul 2013 12:00:51 -0400 -Subject: [PATCH] nfsiostat: restore output format - -Recent changes to support python 3 changed the output of nfsiostat from: - -read: ops/s kB/s kB/op retrans -avg RTT (ms) avg exe (ms) - 48.094 2889.133 60.072 0 (0.0%) -177.160 184.833 -... - -to: - -read: - ops/s kB/s kB/op retrans avg RTT (ms) avg exe -(ms) - 0.000 - 0.000 - 0.000 - 0 (0.0%) - 0.000 - 0.000 -... - -Signed-off-by: Weston Andros Adamson -Signed-off-by: Steve Dickson ---- - tools/nfs-iostat/nfs-iostat.py | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/tools/nfs-iostat/nfs-iostat.py b/tools/nfs-iostat/nfs-iostat.py -index dfbef87..c035537 100644 ---- a/tools/nfs-iostat/nfs-iostat.py -+++ b/tools/nfs-iostat/nfs-iostat.py -@@ -353,14 +353,14 @@ class DeviceData: - exe_per_op = 0.0 - - op += ':' -- print('%s' % op.lower().ljust(15)) -+ 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)) -- print('\t%7.3f' % (kilobytes / sample_time)) -- print('\t%7.3f' % kb_per_op) -- print(' %7d (%3.1f%%)' % (retrans, retrans_percent)) -- print('\t%7.3f' % rtt_per_op) -+ 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) - - def ops(self, sample_time): -@@ -392,7 +392,7 @@ class DeviceData: - print() - - print(' op/s\t\trpc bklog') -- print('%7.2f' % (sends / sample_time)) -+ print('%7.2f' % (sends / sample_time), end='') - print('\t%7.2f' % backlog) - - if which == 0: --- -1.8.3.1.487.g3e7a5b4 - diff --git a/0005-gssd-don-t-give-up-on-machine-credential-if-hostname.patch b/0005-gssd-don-t-give-up-on-machine-credential-if-hostname.patch deleted file mode 100644 index d693431..0000000 --- a/0005-gssd-don-t-give-up-on-machine-credential-if-hostname.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 05e6d39a988e76d5803f79018a9e40d435f6d2f7 Mon Sep 17 00:00:00 2001 -From: NeilBrown -Date: Tue, 2 Jul 2013 08:27:41 -0400 -Subject: [PATCH] gssd: don't give up on machine credential if hostname not - available. - -krb5_util tries various different credential names in order to find -the machine credential, not all of them use the full host name of the -current host. - -So if getting the full host name fails, don't give up completely, -still try the other options. - -Signed-off-by: NeilBrown -Signed-off-by: Steve Dickson ---- - utils/gssd/krb5_util.c | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c -index abebdcd..a6c7eb0 100644 ---- a/utils/gssd/krb5_util.c -+++ b/utils/gssd/krb5_util.c -@@ -825,8 +825,10 @@ find_keytab_entry(krb5_context context, krb5_keytab kt, const char *tgtname, - myhostad[i+1] = 0; - - retval = get_full_hostname(myhostname, myhostname, sizeof(myhostname)); -- if (retval) -- goto out; -+ if (retval) { -+ /* Don't use myhostname */ -+ myhostname[0] = 0; -+ } - - code = krb5_get_default_realm(context, &default_realm); - if (code) { -@@ -891,6 +893,8 @@ find_keytab_entry(krb5_context context, krb5_keytab kt, const char *tgtname, - myhostad, - NULL); - } else { -+ if (!myhostname[0]) -+ continue; - snprintf(spn, sizeof(spn), "%s/%s@%s", - svcnames[j], myhostname, realm); - code = krb5_build_principal_ext(context, &princ, --- -1.8.3.1.487.g3e7a5b4 - diff --git a/0006-gssd-fixed-typo-in-machine-cred-name.patch b/0006-gssd-fixed-typo-in-machine-cred-name.patch deleted file mode 100644 index c421348..0000000 --- a/0006-gssd-fixed-typo-in-machine-cred-name.patch +++ /dev/null @@ -1,31 +0,0 @@ -From da05b199a60e8a8fa91d4d3734cbbe84b23cff69 Mon Sep 17 00:00:00 2001 -From: Doug Nazar -Date: Tue, 2 Jul 2013 08:45:31 -0400 -Subject: [PATCH] gssd: fixed typo in machine cred name. - -Commit 1c787f14 [gssd: scan for DIR: ccaches, too] changed the default -prefix for the credential cache files. Update the check to ignore the -machine credential file when running with -n (root ignores machine -credentials). - -Signed-off-by: Steve Dickson ---- - utils/gssd/krb5_util.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c -index a6c7eb0..83b9651 100644 ---- a/utils/gssd/krb5_util.c -+++ b/utils/gssd/krb5_util.c -@@ -231,7 +231,7 @@ gssd_find_existing_krb5_ccache(uid_t uid, char *dirname, - continue; - } - if (uid == 0 && !root_uses_machine_creds && -- strstr(namelist[i]->d_name, "_machine_")) { -+ strstr(namelist[i]->d_name, "machine_")) { - printerr(3, "CC '%s' not available to root\n", - statname); - free(namelist[i]); --- -1.8.3.1.487.g3e7a5b4 - diff --git a/exportfs-exit-with-error-code-if-there-was-any-error.patch b/exportfs-exit-with-error-code-if-there-was-any-error.patch deleted file mode 100644 index d479991..0000000 --- a/exportfs-exit-with-error-code-if-there-was-any-error.patch +++ /dev/null @@ -1,121 +0,0 @@ -From e10ddcb9d913f7938fc37c72568eea4e8287ade4 Mon Sep 17 00:00:00 2001 -From: Neil Brown -Date: Mon, 21 Oct 2013 17:40:55 +1100 -Subject: [PATCH] exportfs: exit with error code if there was any error. -Reference: bnc#846064 - -exportfs currently exits with a non-zero error for some errors, -but not for others. - -It does this by having various support routines set the global -variable "export_errno". - -Change this to have 'xlog' set export_errno if an ERROR is -reported. That way all errors will be caught. - -Note that the exit error code is changed from 22 (EINVAL) -to the more traditional '1'. - -Signed-off-by: NeilBrown ---- - support/include/exportfs.h | 3 --- - support/include/xlog.h | 1 + - support/nfs/exports.c | 6 ------ - support/nfs/xlog.c | 4 ++++ - utils/exportfs/exportfs.c | 2 -- - 5 files changed, 5 insertions(+), 11 deletions(-) - ---- nfs-utils-1.2.8.orig/support/include/exportfs.h -+++ nfs-utils-1.2.8/support/include/exportfs.h -@@ -179,7 +179,4 @@ struct export_features { - struct export_features *get_export_features(void); - void fix_pseudoflavor_flags(struct exportent *ep); - --/* Record export error. */ --extern int export_errno; -- - #endif /* EXPORTFS_H */ ---- nfs-utils-1.2.8.orig/support/include/xlog.h -+++ nfs-utils-1.2.8/support/include/xlog.h -@@ -35,6 +35,7 @@ struct xlog_debugfac { - int df_fac; - }; - -+extern int export_errno; - void xlog_open(char *progname); - void xlog_stderr(int on); - void xlog_syslog(int on); ---- nfs-utils-1.2.8.orig/support/nfs/exports.c -+++ nfs-utils-1.2.8/support/nfs/exports.c -@@ -47,8 +47,6 @@ struct flav_info flav_map[] = { - - const int flav_map_size = sizeof(flav_map)/sizeof(flav_map[0]); - --int export_errno; -- - static char *efname = NULL; - static XFILE *efp = NULL; - static int first; -@@ -132,7 +130,6 @@ getexportent(int fromkernel, int fromexp - } - if (ok < 0) { - xlog(L_ERROR, "expected client(options...)"); -- export_errno = EINVAL; - return NULL; - } - first = 0; -@@ -152,7 +149,6 @@ getexportent(int fromkernel, int fromexp - ok = getexport(exp, sizeof(exp)); - if (ok < 0) { - xlog(L_ERROR, "expected client(options...)"); -- export_errno = EINVAL; - return NULL; - } - } -@@ -172,7 +168,6 @@ getexportent(int fromkernel, int fromexp - *opt++ = '\0'; - if (!(sp = strchr(opt, ')')) || sp[1] != '\0') { - syntaxerr("bad option list"); -- export_errno = EINVAL; - return NULL; - } - *sp = '\0'; -@@ -567,7 +562,6 @@ parseopts(char *cp, struct exportent *ep - flname, flline, opt); - bad_option: - free(opt); -- export_errno = EINVAL; - return -1; - } - } else if (strncmp(opt, "anongid=", 8) == 0) { ---- nfs-utils-1.2.8.orig/support/nfs/xlog.c -+++ nfs-utils-1.2.8/support/nfs/xlog.c -@@ -38,6 +38,8 @@ static int logmask = 0; /* What will b - static char log_name[256]; /* name of this program */ - static int log_pid = -1; /* PID of this program */ - -+int export_errno = 0; -+ - static void xlog_toggle(int sig); - static struct xlog_debugfac debugnames[] = { - { "general", D_GENERAL, }, -@@ -189,6 +191,8 @@ void - xlog(int kind, const char* fmt, ...) - { - va_list args; -+ if (kind & (L_ERROR|D_GENERAL)) -+ export_errno = 1; - - va_start(args, fmt); - xlog_backend(kind, fmt, args); ---- nfs-utils-1.2.8.orig/utils/exportfs/exportfs.c -+++ nfs-utils-1.2.8/utils/exportfs/exportfs.c -@@ -103,8 +103,6 @@ main(int argc, char **argv) - xlog_stderr(1); - xlog_syslog(0); - -- export_errno = 0; -- - while ((c = getopt(argc, argv, "afhio:ruv")) != EOF) { - switch(c) { - case 'a': diff --git a/exportfs-report-failure-if-asked-to-unexport-somethi.patch b/exportfs-report-failure-if-asked-to-unexport-somethi.patch deleted file mode 100644 index 0b6b499..0000000 --- a/exportfs-report-failure-if-asked-to-unexport-somethi.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 609bce0c7efde1875d1477d96fe1f359b6403005 Mon Sep 17 00:00:00 2001 -From: Neil Brown -Date: Mon, 28 Oct 2013 14:40:15 +1100 -Subject: [PATCH] exportfs: report failure if asked to unexport something not - exported. -Reference: bnc#846064 - -Currently if exportfs is asked to unexport something that is not -exported it silently succeeds. This is not ideal, particularly for -scripting situations. - -So report an error unless the unexport was successful. - -Reported-by: Tony Asleson -Signed-off-by: NeilBrown ---- - utils/exportfs/exportfs.c | 4 ++++ - 1 file changed, 4 insertions(+) - ---- nfs-utils-1.2.8.orig/utils/exportfs/exportfs.c -+++ nfs-utils-1.2.8/utils/exportfs/exportfs.c -@@ -345,6 +345,7 @@ unexportfs(char *arg, int verbose) - char *path; - char *hname = arg; - int htype; -+ int success = 0; - - if ((path = strchr(arg, ':')) != NULL) - *path++ = '\0'; -@@ -391,7 +392,10 @@ unexportfs(char *arg, int verbose) - #endif - exp->m_xtabent = 0; - exp->m_mayexport = 0; -+ success = 1; - } -+ if (!success) -+ xlog(L_ERROR, "Could not find %s to unexport.\n", arg); - - freeaddrinfo(ai); - } diff --git a/fedfs-lib-name.patch b/fedfs-lib-name.patch deleted file mode 100644 index 8d5c235..0000000 --- a/fedfs-lib-name.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 878972d60cb55f2bc6e04a0937f81407fbc308fe Mon Sep 17 00:00:00 2001 -From: Neil Brown -Date: Wed, 5 Mar 2014 14:55:46 +1100 -Subject: [PATCH] mountd: use SONAME fir libnfsjunct when loading with dlopen. - -The standard for loading shared libraries is to identify them by their -"soname" (Which "objdump -x $BINARY | grep SONAME" will report). -However mountd currently loads using the "linker name" which should only -be used when building new code. - -Future releases of fedfs-utils will define the soname in the include -file, so if that is defined, use it. If not, use the soname of the -first version: "libnfsjunct.so.0". - -This is a slight behavioural change. However all distros known to -package fedfs-utils will install "libnfsjunct.so.0" whenever they -install the old name of "libnfsjunct.so", and "make install" will -install both. So it should not be a noticeable change. - -Also only test the JP_API_VERSION if it is defined. As the version is -embedded in the soname, a secondary test is not needed. - -Cc: Chuck Lever -Signed-off-by: NeilBrown - ---- - utils/mountd/cache.c | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) - ---- nfs-utils-1.2.8.orig/utils/mountd/cache.c -+++ nfs-utils-1.2.8/utils/mountd/cache.c -@@ -1055,12 +1055,13 @@ static struct exportent *invoke_junction - __func__, error); - return NULL; - } -+#ifdef JP_API_VERSION - if (ops->jp_api_version != JP_API_VERSION) { - xlog(D_GENERAL, "%s: unrecognized junction API version: %u", - __func__, ops->jp_api_version); - return NULL; - } -- -+#endif - status = ops->jp_init(false); - if (status != JP_OK) { - xlog(D_GENERAL, "%s: failed to resolve %s: %s", -@@ -1107,7 +1108,11 @@ static struct exportent *lookup_junction - struct link_map *map; - void *handle; - -- handle = dlopen("libnfsjunct.so", RTLD_NOW); -+#ifdef JP_NFSPLUGIN_SONAME -+ handle = dlopen(JP_NFSPLUGIN_SONAME, RTLD_NOW); -+#else -+ handle = dlopen("libnfsjunct.so.0", RTLD_NOW); -+#endif - if (handle == NULL) { - xlog(D_GENERAL, "%s: dlopen: %s", __func__, dlerror()); - return NULL; diff --git a/gssd-mount-hang-fix.patch b/gssd-mount-hang-fix.patch deleted file mode 100644 index 9c6630e..0000000 --- a/gssd-mount-hang-fix.patch +++ /dev/null @@ -1,88 +0,0 @@ -From: Neil Brown -Date: Thu, 14 Nov 2013 11:50:38 +1100 -Subject: [PATCH] gssd: always reply to rpc-pipe requests from kernel. -References: bnc#833543 - -Sometimes gssd will open a new rpc-pipe but never read requests from it -or reply to them. This causes the kernel to wait forever for a reply. - -In particular, if a filesystem is mounted by IP, and the IP has no -hostname recorded in /etc/hosts or DNS, then gssd will not listen to -requests and the mount will hang indefinitely. - -The comment in process_clnt_dir() for the "fail_keep_client:" branch -suggests that it is for the case where we couldn't open some -subdirectories. However it is currently also taken if reverse DNS -lookup fails (as well as some other lookup failures). Those failures -should not be treated the same as failure-to-open directories. - -So this patch causes a failure from read_service_info() to *not* be -reported by process_clnt_dir_files. This ensures that insert_clnt_poll() -will be called and requests will be handled. - -In handle_gssd_upcall, the current error path (taken when the mech is -not "krb5") does not reply to the upcall. This is wrong. A reply is -always appropriate. The only replies which aren't treated as -transient errors are EACCES and EKEYEXPIRED, so we return the former. - -If read_service_info() fails then ->servicename will be NULL which will -cause process_krb5_upcall() (quite reasonably) to become confused. So -in that case we don't even try to process the up-call but just reply -with EACCES. - -As clp->servicename==NULL is no longer treated as fatal, it is not -appropraite to use it to test if read_service_info() has been already -called on a client. Instread test clp->prog. - -Finally, the error path of read_service_info() will close 'fd' if it -isn't -1, so when we close it, we should set fd to -1. - -Signed-off-by: NeilBrown - -diff --git a/utils/gssd/gssd_proc.c b/utils/gssd/gssd_proc.c -index b48d1637cd36..00b4bc779b7c 100644 ---- a/utils/gssd/gssd_proc.c -+++ b/utils/gssd/gssd_proc.c -@@ -256,6 +256,7 @@ read_service_info(char *info_file_name, char **servicename, char **servername, - if ((nbytes = read(fd, buf, INFOBUFLEN)) == -1) - goto fail; - close(fd); -+ fd = -1; - buf[nbytes] = '\0'; - - numfields = sscanf(buf,"RPC server: %127s\n" -@@ -403,11 +404,10 @@ process_clnt_dir_files(struct clnt_info * clp) - return -1; - snprintf(info_file_name, sizeof(info_file_name), "%s/info", - clp->dirname); -- if ((clp->servicename == NULL) && -- read_service_info(info_file_name, &clp->servicename, -- &clp->servername, &clp->prog, &clp->vers, -- &clp->protocol, (struct sockaddr *) &clp->addr)) -- return -1; -+ if (clp->prog == 0) -+ read_service_info(info_file_name, &clp->servicename, -+ &clp->servername, &clp->prog, &clp->vers, -+ &clp->protocol, (struct sockaddr *) &clp->addr); - return 0; - } - -@@ -1320,11 +1320,14 @@ handle_gssd_upcall(struct clnt_info *clp) - } - } - -- if (strcmp(mech, "krb5") == 0) -+ if (strcmp(mech, "krb5") == 0 && clp->servername) - process_krb5_upcall(clp, uid, clp->gssd_fd, target, service); -- else -- printerr(0, "WARNING: handle_gssd_upcall: " -- "received unknown gss mech '%s'\n", mech); -+ else { -+ if (clp->servername) -+ printerr(0, "WARNING: handle_gssd_upcall: " -+ "received unknown gss mech '%s'\n", mech); -+ do_error_downcall(clp->gssd_fd, uid, -EACCES); -+ } - - out: - free(lbuf); diff --git a/mountd-fix-bug-affecting-exports-of-dirs-with-64bit-.patch b/mountd-fix-bug-affecting-exports-of-dirs-with-64bit-.patch deleted file mode 100644 index 26785df..0000000 --- a/mountd-fix-bug-affecting-exports-of-dirs-with-64bit-.patch +++ /dev/null @@ -1,105 +0,0 @@ -Git-commit: b3a156fe96c6645ca5dbf4b75e9cff710218d920 -From: Neil Brown -Date: Mon, 21 Oct 2013 16:27:32 +1100 -Subject: [PATCH 1/2] mountd: fix bug affecting exports of dirs with 64bit - inode number. -References: bnc:841971 - -parse_fsid is currently truncating all inode numbers to -32bits, and assumes that 'int' is 32 bits (which it probably is, -but we shouldn't assume). - -So make the 'inode' field in 'struct parsed_fsid' a 64 bit field. -and only memcpy into variables or fields that have been declared -to a specific bit size. - -Signed-off-by: NeilBrown ---- - utils/mountd/cache.c | 25 ++++++++++++++----------- - 1 file changed, 14 insertions(+), 11 deletions(-) - ---- nfs-utils-1.2.8.orig/utils/mountd/cache.c -+++ nfs-utils-1.2.8/utils/mountd/cache.c -@@ -388,10 +388,10 @@ struct parsed_fsid { - int fsidtype; - /* We could use a union for this, but it would be more - * complicated; why bother? */ -- unsigned int inode; -+ uint64_t inode; - unsigned int minor; - unsigned int major; -- unsigned int fsidnum; -+ uint32_t fsidnum; - size_t uuidlen; - char *fhuuid; - }; -@@ -399,8 +399,8 @@ struct parsed_fsid { - static int parse_fsid(int fsidtype, int fsidlen, char *fsid, - struct parsed_fsid *parsed) - { -- unsigned int dev; -- unsigned long long inode64; -+ uint32_t dev; -+ uint32_t inode32; - - memset(parsed, 0, sizeof(*parsed)); - parsed->fsidtype = fsidtype; -@@ -409,7 +409,8 @@ static int parse_fsid(int fsidtype, int - if (fsidlen != 8) - return -1; - memcpy(&dev, fsid, 4); -- memcpy(&parsed->inode, fsid+4, 4); -+ memcpy(&inode32, fsid+4, 4); -+ parsed->inode = inode32; - parsed->major = ntohl(dev)>>16; - parsed->minor = ntohl(dev) & 0xFFFF; - break; -@@ -420,7 +421,7 @@ static int parse_fsid(int fsidtype, int - memcpy(&parsed->fsidnum, fsid, 4); - break; - -- case FSID_MAJOR_MINOR: /* 12 bytes: 4 major, 4 minor, 4 inode -+ case FSID_MAJOR_MINOR: /* 12 bytes: 4 major, 4 minor, 4 inode - * This format is never actually used but was - * an historical accident - */ -@@ -430,7 +431,8 @@ static int parse_fsid(int fsidtype, int - parsed->major = ntohl(dev); - memcpy(&dev, fsid+4, 4); - parsed->minor = ntohl(dev); -- memcpy(&parsed->inode, fsid+8, 4); -+ memcpy(&inode32, fsid+8, 4); -+ parsed->inode = inode32; - break; - - case FSID_ENCODE_DEV: /* 8 bytes: 4 byte packed device number, 4 inode */ -@@ -440,7 +442,8 @@ static int parse_fsid(int fsidtype, int - if (fsidlen != 8) - return -1; - memcpy(&dev, fsid, 4); -- memcpy(&parsed->inode, fsid+4, 4); -+ memcpy(&inode32, fsid+4, 4); -+ parsed->inode = inode32; - parsed->major = (dev & 0xfff00) >> 8; - parsed->minor = (dev & 0xff) | ((dev >> 12) & 0xfff00); - break; -@@ -448,7 +451,8 @@ static int parse_fsid(int fsidtype, int - case FSID_UUID4_INUM: /* 4 byte inode number and 4 byte uuid */ - if (fsidlen != 8) - return -1; -- memcpy(&parsed->inode, fsid, 4); -+ memcpy(&inode32, fsid, 4); -+ parsed->inode = inode32; - parsed->uuidlen = 4; - parsed->fhuuid = fsid+4; - break; -@@ -467,8 +471,7 @@ static int parse_fsid(int fsidtype, int - case FSID_UUID16_INUM: /* 8 byte inode number and 16 byte uuid */ - if (fsidlen != 24) - return -1; -- memcpy(&inode64, fsid, 8); -- parsed->inode = inode64; -+ memcpy(&parsed->inode, fsid, 8); - parsed->uuidlen = 16; - parsed->fhuuid = fsid+8; - break; diff --git a/nfs-utils-1.2.8.tar.bz2 b/nfs-utils-1.2.8.tar.bz2 deleted file mode 100644 index 128db52..0000000 --- a/nfs-utils-1.2.8.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1cc8f02a633eddbf0a1d93421f331479c4cdab4c5ab33b8bf8c7c369f9156ac6 -size 2747577 diff --git a/nfs-utils-1.3.0.tar.bz2 b/nfs-utils-1.3.0.tar.bz2 new file mode 100644 index 0000000..bb2db51 --- /dev/null +++ b/nfs-utils-1.3.0.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:25f1c974018c944347d74eebe89643e1004c822a6145153136b192d1acfaf60d +size 780749 diff --git a/nfs-utils.changes b/nfs-utils.changes index 495b317..2cfda95 100644 --- a/nfs-utils.changes +++ b/nfs-utils.changes @@ -1,3 +1,31 @@ +------------------------------------------------------------------- +Wed May 14 02:40:01 UTC 2014 - nfbrown@suse.com + +- New upstream version 1.3.0. + Includes all our bugfix patches except 1. + Adds assorted other bugfixes and improvements including + initial support for NFSv4.2 + Prepares the way for better systemd integration. + Discards useless programs gss_clnt_send_err and gss_destroy_creds + +- Removes: 0001-mountd-Fix-is_subdirectory-again.patch +- Removes: 0002-gssd-Fix-recent-fix-to-Avoid-DNS-reverse-resolution-.patch +- Removes: 0003-Fix-handling-of-preferred-realm-command-line-option.patch +- Removes: 0004-nfsiostat-restore-output-format.patch +- Removes: 0005-gssd-don-t-give-up-on-machine-credential-if-hostname.patch +- Removes: 0006-gssd-fixed-typo-in-machine-cred-name.patch +- Removes: skip-on-ENOENT.patch +- Removes: mountd-fix-bug-affecting-exports-of-dirs-with-64bit-.patch +- Removes: exportfs-exit-with-error-code-if-there-was-any-error.patch +- Removes: exportfs-report-failure-if-asked-to-unexport-somethi.patch +- Removes: gssd-mount-hang-fix.patch +- Removes: udp-fallback-fix.patch +- Removes: fedfs-lib-name.patch + +- 0001-nfsidmap-Keys-need-to-be-invalidated-instead-of-revo.patch + This upstream patch is currently reverted until we get a newer version + of keyutils. + ------------------------------------------------------------------- Tue May 6 00:51:39 UTC 2014 - nfbrown@suse.com diff --git a/nfs-utils.spec b/nfs-utils.spec index fea9674..82d06f8 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -41,7 +41,7 @@ Url: http://kernel.org/pub/linux/utils/nfs-utils/ Summary: Support Utilities for Kernel nfsd License: GPL-2.0+ Group: Productivity/Networking/NFS -Version: 1.2.8 +Version: 1.3.0 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build PreReq: %fillup_prereq %insserv_prereq @@ -62,34 +62,9 @@ Source11: idmapd.conf Source12: start-statd Source13: nfs-utils.rpmlintrc Patch0: nfs-utils-1.0.7-bind-syntax.patch -# PATCH-FIX-UPSTREAM 0001-mountd-Fix-is_subdirectory-again.patch upstream-bugfix nfbrown@suse.de -Patch1: 0001-mountd-Fix-is_subdirectory-again.patch -# PATCH-FIX-UPSTREAM 0002-gssd-Fix-recent-fix-to-Avoid-DNS-reverse-resolution-.patch upstream-bugfix nfbrown@suse.de -Patch2: 0002-gssd-Fix-recent-fix-to-Avoid-DNS-reverse-resolution-.patch -# PATCH-FIX-UPSTREAM 0003-Fix-handling-of-preferred-realm-command-line-option.patch upstream-bugfix nfbrown@suse.de -Patch3: 0003-Fix-handling-of-preferred-realm-command-line-option.patch -# PATCH-FIX-UPSTREAM 0004-nfsiostat-restore-output-format.patch upstream-bugfix nfbrown@suse.de -Patch4: 0004-nfsiostat-restore-output-format.patch -# PATCH-FIX-UPSTREAM 0005-gssd-don-t-give-up-on-machine-credential-if-hostname.patch upstream-bugfix nfbrown@suse.de -Patch5: 0005-gssd-don-t-give-up-on-machine-credential-if-hostname.patch -# PATCH-FIX-UPSTREAM 0006-gssd-fixed-typo-in-machine-cred-name.patch upstream-bugfix nfbrown@suse.de -Patch6: 0006-gssd-fixed-typo-in-machine-cred-name.patch -# PATCH-FIX-UPSTREAM skip-on-ENOENT.patch nfbrown@suse.de -Patch7: skip-on-ENOENT.patch -# PATCH-FIX-UPSTREAM mountd-fix-bug-affecting-exports-of-dirs-with-64bit-.patch nfbrown@suse.de -Patch8: mountd-fix-bug-affecting-exports-of-dirs-with-64bit-.patch -# PATCH-FIX-UPSTREAM exportfs-exit-with-error-code-if-there-was-any-error.patch nfbrown@suse.de -Patch9: exportfs-exit-with-error-code-if-there-was-any-error.patch -# PATCH-FIX_UPSTREAM exportfs-report-failure-if-asked-to-unexport-somethi.patch nfbrown@suse.de -Patch10: exportfs-report-failure-if-asked-to-unexport-somethi.patch -# PATCH-FIX-UPSTREAM gssd-mount-hang-fix.patch bnc#833543 nfbrown@suse.de -Patch11: gssd-mount-hang-fix.patch -# PATCH-FIX-UPSTREAM udp-fallback-fix.patch bnc#863749 nfbrown@suse.de -Patch12: udp-fallback-fix.patch -# PATCH-FIX-UPSTREAM fedfs-lib-name.patch nfbrown@suse.de -Patch13: fedfs-lib-name.patch # PATCH-FIX-UPSTREAM nfsdcltrack.sbin.patch nfbrown@suse.de -Patch14: nfsdcltrack.sbin.patch +Patch1: nfsdcltrack.sbin.patch +Patch2: 0001-nfsidmap-Keys-need-to-be-invalidated-instead-of-revo.patch Suggests: python-base @@ -143,19 +118,7 @@ This package contains additional NFS documentation. %setup -q -n nfs-utils-%{version} -a 1 %patch0 -p1 %patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 -%patch9 -p1 -%patch10 -p1 -%patch11 -p1 -%patch12 -p1 -%patch13 -p1 -%patch14 -p1 +%patch2 -p1 -R cp %{S:6} . %build @@ -282,8 +245,6 @@ fi /sbin/umount.nfs /sbin/umount.nfs4 /sbin/osd_login -/usr/sbin/gss_clnt_send_err -/usr/sbin/gss_destroy_creds %attr(0755,root,root) /usr/sbin/mountstats %attr(0755,root,root) /usr/sbin/nfsiostat /usr/sbin/nfsidmap diff --git a/skip-on-ENOENT.patch b/skip-on-ENOENT.patch deleted file mode 100644 index 6a2deef..0000000 --- a/skip-on-ENOENT.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 8becedab3982d4780dbc010decc1ac7eb9ce914f Mon Sep 17 00:00:00 2001 -From: Neil Brown -Date: Mon, 2 Sep 2013 14:54:16 +1000 -Subject: [PATCH] gssd: support error message if rpc_pipefs dir disappears. - -It is possible for a race to cause a name to appear when an rpc_pipefs -dir is scanned but to no longer be present when we try to open it. - -So if the error is ENOENT, don't complain. - -This is similar to - -commit 5ac9bcfd820f09af4d3f87f1f7346d896f70bc9a -Author: David Jeffery -Date: Wed Jan 16 15:21:55 2013 -0500 - - rpc.idmapd: Ignore open failures in dirscancb() - -which addressed a similar issue in idmapd. - -Signed-off-by: NeilBrown - -diff --git a/utils/gssd/gssd_proc.c b/utils/gssd/gssd_proc.c -index b7e2bbb..2d3dbec 100644 ---- a/utils/gssd/gssd_proc.c -+++ b/utils/gssd/gssd_proc.c -@@ -467,8 +467,9 @@ process_clnt_dir(char *dir, char *pdir) - } - sprintf(clp->dirname, "%s/%s", pdir, dir); - if ((clp->dir_fd = open(clp->dirname, O_RDONLY)) == -1) { -- printerr(0, "ERROR: can't open %s: %s\n", -- clp->dirname, strerror(errno)); -+ if (errno != ENOENT) -+ printerr(0, "ERROR: can't open %s: %s\n", -+ clp->dirname, strerror(errno)); - goto fail_destroy_client; - } - fcntl(clp->dir_fd, F_SETSIG, DNOTIFY_SIGNAL); diff --git a/udp-fallback-fix.patch b/udp-fallback-fix.patch deleted file mode 100644 index 104af67..0000000 --- a/udp-fallback-fix.patch +++ /dev/null @@ -1,36 +0,0 @@ -From: NeilBrown -Subject: Fix fallback from tcp to udp -References: bnc#863749 - -Protocol negotiation in mount.nfs does not correctly negotiate with a -server which only support NFSv3 and UDP. - -When mount.nfs attempts an NFSv4 mount and fails with ECONNREFUSED -it does not fall back to NFSv3, as this is not recognised as a -"does not support NFSv4" error. -However ECONNREFUSED is a clear indication that the server doesn't -support TCP, and ipso facto does not support NFSv4. -So ECONNREFUSED should trigger a fallback from v4 to v2/3. - -Once we allow that error, NFSv3 is attempted and mount.nfs talks to -rpcbind and discovers that UDP should be used for v3 and the mount -succeeds. - -Signed-off-by: NeilBrown -Reported-by: Carsten Ziepke ---- - utils/mount/stropts.c | 3 +++ - 1 file changed, 3 insertions(+) - ---- nfs-utils-1.2.8.orig/utils/mount/stropts.c -+++ nfs-utils-1.2.8/utils/mount/stropts.c -@@ -807,6 +807,9 @@ static int nfs_autonegotiate(struct nfsm - /* Linux servers prior to 2.6.25 may return - * EPERM when NFS version 4 is not supported. */ - goto fall_back; -+ case ECONNREFUSED: -+ /* UDP-Only server won't support v4 */ -+ goto fall_back; - default: - return result; - } From 83a4726236a17c9180bda1ff9f44a37a61e111c5bb1acdad96962d6ee3c0965d Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Tue, 3 Jun 2014 12:56:14 +0000 Subject: [PATCH 2/7] . OBS-URL: https://build.opensuse.org/package/show/Base:System/nfs-utils?expand=0&rev=121 --- nfs-utils.changes | 6 ++++++ nfs.init | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/nfs-utils.changes b/nfs-utils.changes index 2cfda95..ba041ce 100644 --- a/nfs-utils.changes +++ b/nfs-utils.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jun 3 12:55:16 UTC 2014 - werner@suse.de + +- Check if systemd is listen on local socket 111 to trigger the + start of the rpcbind.service on demand (bnc#860246) + ------------------------------------------------------------------- Wed May 14 02:40:01 UTC 2014 - nfbrown@suse.com diff --git a/nfs.init b/nfs.init index 2eecc40..190fadc 100644 --- a/nfs.init +++ b/nfs.init @@ -117,7 +117,9 @@ fi check_portmap() { # check if either portmap or rpcbind is running - if test -x /sbin/portmap && checkproc /sbin/portmap + if test -x /sbin/rpcinfo && /sbin/rpcinfo -a 0.0.0.0.0.111 -T tcp 100000 > /dev/null 2>&1 + then true + elif test -x /sbin/portmap && checkproc /sbin/portmap then true elif test -x /sbin/rpcbind && checkproc /sbin/rpcbind then true From 41c0ace2a48e7383343180a90ab6a3733555048369eb2ad7c3205250a3d67fa2 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Tue, 3 Jun 2014 13:55:45 +0000 Subject: [PATCH 3/7] . OBS-URL: https://build.opensuse.org/package/show/Base:System/nfs-utils?expand=0&rev=122 --- nfs-utils-1.3.0.tar.bz2 | 3 --- nfs-utils-1.3.0.tar.gz | 3 +++ nfs-utils.changes | 2 ++ nfs-utils.spec | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) delete mode 100644 nfs-utils-1.3.0.tar.bz2 create mode 100644 nfs-utils-1.3.0.tar.gz diff --git a/nfs-utils-1.3.0.tar.bz2 b/nfs-utils-1.3.0.tar.bz2 deleted file mode 100644 index bb2db51..0000000 --- a/nfs-utils-1.3.0.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:25f1c974018c944347d74eebe89643e1004c822a6145153136b192d1acfaf60d -size 780749 diff --git a/nfs-utils-1.3.0.tar.gz b/nfs-utils-1.3.0.tar.gz new file mode 100644 index 0000000..a85bb24 --- /dev/null +++ b/nfs-utils-1.3.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:17b6662df0fe55ef4e14e3c7c59a787dca677079a32abecf9900aa54569dc40e +size 1073445 diff --git a/nfs-utils.changes b/nfs-utils.changes index ba041ce..7134307 100644 --- a/nfs-utils.changes +++ b/nfs-utils.changes @@ -3,6 +3,8 @@ Tue Jun 3 12:55:16 UTC 2014 - werner@suse.de - Check if systemd is listen on local socket 111 to trigger the start of the rpcbind.service on demand (bnc#860246) +- There exists only nfs-utils-1.3.0.tar.gz at + http://kernel.org/pub/linux/utils/nfs-utils/1.3.0/ ------------------------------------------------------------------- Wed May 14 02:40:01 UTC 2014 - nfbrown@suse.com diff --git a/nfs-utils.spec b/nfs-utils.spec index 82d06f8..af54622 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -47,7 +47,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build PreReq: %fillup_prereq %insserv_prereq %{?systemd_requires} BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source0: http://kernel.org/pub/linux/utils/nfs-utils/%{version}/nfs-utils-%{version}.tar.bz2 +Source0: http://kernel.org/pub/linux/utils/nfs-utils/%{version}/nfs-utils-%{version}.tar.gz # Download does not work: # Source1: ftp://nfs.sourceforge.net/pub/nfs/nfs.doc.tar.bz2 Source1: nfs.doc.tar.bz2 From 73296a95409e0b59c40a5a03d7e9917e354c68990a1ef4591f60e7539c246eac Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Wed, 4 Jun 2014 02:05:53 +0000 Subject: [PATCH 4/7] - Remove 0001-nfsidmap-Keys-need-to-be-invalidated-instead-of-revo.patch Now that keyutils has been updated in Factory, this patch is no longer needed. OBS-URL: https://build.opensuse.org/package/show/Base:System/nfs-utils?expand=0&rev=123 --- nfs-utils.changes | 7 +++++++ nfs-utils.spec | 2 -- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/nfs-utils.changes b/nfs-utils.changes index 7134307..d2db557 100644 --- a/nfs-utils.changes +++ b/nfs-utils.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Jun 4 01:59:27 UTC 2014 - nfbrown@suse.com + +- Remove 0001-nfsidmap-Keys-need-to-be-invalidated-instead-of-revo.patch + Now that keyutils has been updated in Factory, this patch + is no longer needed. + ------------------------------------------------------------------- Tue Jun 3 12:55:16 UTC 2014 - werner@suse.de diff --git a/nfs-utils.spec b/nfs-utils.spec index af54622..9423749 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -64,7 +64,6 @@ Source13: nfs-utils.rpmlintrc Patch0: nfs-utils-1.0.7-bind-syntax.patch # PATCH-FIX-UPSTREAM nfsdcltrack.sbin.patch nfbrown@suse.de Patch1: nfsdcltrack.sbin.patch -Patch2: 0001-nfsidmap-Keys-need-to-be-invalidated-instead-of-revo.patch Suggests: python-base @@ -118,7 +117,6 @@ This package contains additional NFS documentation. %setup -q -n nfs-utils-%{version} -a 1 %patch0 -p1 %patch1 -p1 -%patch2 -p1 -R cp %{S:6} . %build From 9b8e2bda9da790d0170cd2ffaed4c7962349530cc4d812a917efd7fdbf8aa1d4 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Wed, 4 Jun 2014 10:57:58 +0000 Subject: [PATCH 5/7] Forgot to actually remove the patch which is nolonger needed OBS-URL: https://build.opensuse.org/package/show/Base:System/nfs-utils?expand=0&rev=124 --- ...ed-to-be-invalidated-instead-of-revo.patch | 68 ------------------- 1 file changed, 68 deletions(-) delete mode 100644 0001-nfsidmap-Keys-need-to-be-invalidated-instead-of-revo.patch diff --git a/0001-nfsidmap-Keys-need-to-be-invalidated-instead-of-revo.patch b/0001-nfsidmap-Keys-need-to-be-invalidated-instead-of-revo.patch deleted file mode 100644 index da63ba0..0000000 --- a/0001-nfsidmap-Keys-need-to-be-invalidated-instead-of-revo.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 2ae0763a618d30037ebb2520f6292f80d838a440 Mon Sep 17 00:00:00 2001 -From: Steve Dickson -Date: Tue, 25 Mar 2014 10:56:58 -0400 -Subject: [PATCH] nfsidmap: Keys need to be invalidated instead of revoked - -With some recent kernel changes to the key ring -for a key to be removed they need to be invalidated -instead of revoked. - -Signed-off-by: Steve Dickson ---- - utils/nfsidmap/nfsidmap.c | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -diff --git a/utils/nfsidmap/nfsidmap.c b/utils/nfsidmap/nfsidmap.c -index 2518ed6b022b..3f51b4d4ca1b 100644 ---- a/utils/nfsidmap/nfsidmap.c -+++ b/utils/nfsidmap/nfsidmap.c -@@ -166,7 +166,7 @@ static int keyring_clear(char *keyring) - /* - * Revoke a key - */ --static int key_revoke(char *keystr, int keymask) -+static int key_invalidate(char *keystr, int keymask) - { - FILE *fp; - char buf[BUFSIZ], *ptr; -@@ -200,7 +200,7 @@ static int key_revoke(char *keystr, int keymask) - - if (verbose) { - *(strchr(buf, '\n')) = '\0'; -- xlog_warn("revoking '%s'", buf); -+ xlog_warn("invalidating '%s'", buf); - } - /* - * The key is the first arugment in the string -@@ -208,8 +208,8 @@ static int key_revoke(char *keystr, int keymask) - *(strchr(buf, ' ')) = '\0'; - sscanf(buf, "%x", &key); - -- if (keyctl_revoke(key) < 0) { -- xlog_err("keyctl_revoke(0x%x) failed: %m", key); -+ if (keyctl_invalidate(key) < 0) { -+ xlog_err("keyctl_invalidate(0x%x) failed: %m", key); - fclose(fp); - return 1; - } -@@ -273,7 +273,7 @@ int main(int argc, char **argv) - } - } - -- if (rc = nfs4_init_name_mapping(PATH_IDMAPDCONF)) { -+ if ((rc = nfs4_init_name_mapping(PATH_IDMAPDCONF))) { - xlog_errno(rc, "Unable to create name to user id mappings."); - return 1; - } -@@ -281,7 +281,7 @@ int main(int argc, char **argv) - verbose = conf_get_num("General", "Verbosity", 0); - - if (keystr) { -- rc = key_revoke(keystr, keymask); -+ rc = key_invalidate(keystr, keymask); - return rc; - } - if (clearing) { --- -1.8.3.1.487.g3e7a5b4 - From cca6a29bd398115b12f17de347d9f02ad79b13f4064943fed0de37ca53f6fce0 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Tue, 10 Jun 2014 07:43:48 +0000 Subject: [PATCH 6/7] - Use start-statd and rpc-statd.service from upstream for running statd. Our start-statd doesn't work in a systemd environment (bnc#852984) - use .xz from upstream, that is what kernel.org prefers and it is smaller OBS-URL: https://build.opensuse.org/package/show/Base:System/nfs-utils?expand=0&rev=125 --- nfs-utils-1.3.0.tar.gz | 3 --- nfs-utils-1.3.0.tar.xz | 3 +++ nfs-utils.changes | 7 +++++++ nfs-utils.spec | 11 ++++++----- start-statd | 21 --------------------- start-statd.patch | 20 ++++++++++++++++++++ 6 files changed, 36 insertions(+), 29 deletions(-) delete mode 100644 nfs-utils-1.3.0.tar.gz create mode 100644 nfs-utils-1.3.0.tar.xz delete mode 100644 start-statd create mode 100644 start-statd.patch diff --git a/nfs-utils-1.3.0.tar.gz b/nfs-utils-1.3.0.tar.gz deleted file mode 100644 index a85bb24..0000000 --- a/nfs-utils-1.3.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:17b6662df0fe55ef4e14e3c7c59a787dca677079a32abecf9900aa54569dc40e -size 1073445 diff --git a/nfs-utils-1.3.0.tar.xz b/nfs-utils-1.3.0.tar.xz new file mode 100644 index 0000000..271cd08 --- /dev/null +++ b/nfs-utils-1.3.0.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ab8384d0e487ed6a18c5380d5df28015f7dd98680bf08f3247c97d9f7d99e56f +size 578960 diff --git a/nfs-utils.changes b/nfs-utils.changes index d2db557..df5d18b 100644 --- a/nfs-utils.changes +++ b/nfs-utils.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Jun 10 07:19:06 UTC 2014 - nfbrown@suse.com + +- Use start-statd and rpc-statd.service from upstream for running statd. + Our start-statd doesn't work in a systemd environment (bnc#852984) +- use .xz from upstream, that is what kernel.org prefers and it is smaller + ------------------------------------------------------------------- Wed Jun 4 01:59:27 UTC 2014 - nfbrown@suse.com diff --git a/nfs-utils.spec b/nfs-utils.spec index 9423749..9df5aa2 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -47,7 +47,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build PreReq: %fillup_prereq %insserv_prereq %{?systemd_requires} BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source0: http://kernel.org/pub/linux/utils/nfs-utils/%{version}/nfs-utils-%{version}.tar.gz +Source0: http://kernel.org/pub/linux/utils/nfs-utils/%{version}/nfs-utils-%{version}.tar.xz # Download does not work: # Source1: ftp://nfs.sourceforge.net/pub/nfs/nfs.doc.tar.bz2 Source1: nfs.doc.tar.bz2 @@ -59,12 +59,11 @@ Source6: README.NFSv4 Source7: fw-client Source8: fw-server Source11: idmapd.conf -Source12: start-statd Source13: nfs-utils.rpmlintrc Patch0: nfs-utils-1.0.7-bind-syntax.patch # PATCH-FIX-UPSTREAM nfsdcltrack.sbin.patch nfbrown@suse.de Patch1: nfsdcltrack.sbin.patch - +Patch2: start-statd.patch Suggests: python-base %description @@ -117,6 +116,7 @@ This package contains additional NFS documentation. %setup -q -n nfs-utils-%{version} -a 1 %patch0 -p1 %patch1 -p1 +%patch2 -p1 cp %{S:6} . %build @@ -142,7 +142,8 @@ done %install make install DESTDIR=$RPM_BUILD_ROOT -rm -f linux-nfs/Makefile* +install -d $RPM_BUILD_ROOT/%{_unitdir} +install -m 644 systemd/rpc-statd.service $RPM_BUILD_ROOT/%{_unitdir} # rc-script install -d $RPM_BUILD_ROOT/etc/init.d install -m 744 %{SOURCE3} $RPM_BUILD_ROOT/etc/init.d/nfsserver @@ -165,7 +166,6 @@ touch $RPM_BUILD_ROOT/var/lib/nfs/state mkdir -p $RPM_BUILD_ROOT/etc/sysconfig/SuSEfirewall2.d/services install -m 0644 %{SOURCE7} ${RPM_BUILD_ROOT}/etc/sysconfig/SuSEfirewall2.d/services/nfs-client install -m 0644 %{SOURCE8} ${RPM_BUILD_ROOT}/etc/sysconfig/SuSEfirewall2.d/services/nfs-kernel-server -install -m 755 %{S:12} $RPM_BUILD_ROOT/usr/sbin/start-statd install -m 644 utils/mount/nfsmount.conf $RPM_BUILD_ROOT/etc/nfsmount.conf # # hack to avoid automatic python dependency @@ -256,6 +256,7 @@ fi /usr/sbin/sm-notify /usr/sbin/start-statd /usr/sbin/blkmapd +%{_unitdir}/rpc-statd.service %{_mandir}/man5/nfsmount.conf.5.gz %{_mandir}/man5/nfs.5.gz %{_mandir}/man8/mount.nfs.8.gz diff --git a/start-statd b/start-statd deleted file mode 100644 index da42719..0000000 --- a/start-statd +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -p -# nfsmount calls this script when mounting a filesystem with locking -# enabled, but when statd does not seem to be running (based on -# /run/rpc.statd.pid). -# It should run run statd with whatever flags are apropriate for this -# site. -PATH=/sbin:/usr/sbin:/bin:/usr/bin -checkproc /usr/sbin/rpc.statd && exit 0 -. /etc/rc.status -. /etc/sysconfig/nfs -rc_reset -echo -n "Starting rpc.statd ..." -if ! rpcinfo -p localhost >/dev/null 2>/dev/null; then - echo -n " ${extd}portmapper not running${norm}" - rc_failed 1 - rc_status -v - rc_exit -fi -# TODO: write init script and call that one via /sbin/service instead -start_daemon /usr/sbin/rpc.statd --no-notify $STATD_OPTIONS -rc_status -v diff --git a/start-statd.patch b/start-statd.patch new file mode 100644 index 0000000..0b2b794 --- /dev/null +++ b/start-statd.patch @@ -0,0 +1,20 @@ +1/ use correct patch for systemctl +2/ use correct name for rpc-statd.service + +--- + utils/statd/start-statd | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- nfs-utils-1.3.0.orig/utils/statd/start-statd ++++ nfs-utils-1.3.0/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=/bin:/usr/bin:/sbin:/usr/sbin ++if systemctl start rpc-statd.service + then : + else + exec rpc.statd --no-notify From b5fa7a00714517ed4a3c1c97efd4693ee4ab601256debb7fd0a5132ab0a5506b Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Tue, 10 Jun 2014 09:37:22 +0000 Subject: [PATCH 7/7] - start-statd.patch - needed to make upstream start-statd work properly. OBS-URL: https://build.opensuse.org/package/show/Base:System/nfs-utils?expand=0&rev=126 --- nfs-utils.changes | 1 + nfs-utils.spec | 1 + 2 files changed, 2 insertions(+) diff --git a/nfs-utils.changes b/nfs-utils.changes index df5d18b..8ac2ca7 100644 --- a/nfs-utils.changes +++ b/nfs-utils.changes @@ -3,6 +3,7 @@ Tue Jun 10 07:19:06 UTC 2014 - nfbrown@suse.com - Use start-statd and rpc-statd.service from upstream for running statd. Our start-statd doesn't work in a systemd environment (bnc#852984) +- start-statd.patch - needed to make upstream start-statd work properly. - use .xz from upstream, that is what kernel.org prefers and it is smaller ------------------------------------------------------------------- diff --git a/nfs-utils.spec b/nfs-utils.spec index 9df5aa2..fb3a740 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -63,6 +63,7 @@ Source13: nfs-utils.rpmlintrc Patch0: nfs-utils-1.0.7-bind-syntax.patch # PATCH-FIX-UPSTREAM nfsdcltrack.sbin.patch nfbrown@suse.de Patch1: nfsdcltrack.sbin.patch +# PATCH-FIX-OPENSUSE start-statd.patch nfbrown@suse.de Patch2: start-statd.patch Suggests: python-base