From 67a1db49aa00f8a23ead9ad995d86b047319542c Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Mon, 19 Aug 2013 14:32:01 -0400 Subject: [PATCH] Updated to latest upstream RC release: nfs-utils-1-2-9-rc4 Signed-off-by: Steve Dickson --- ...2-9-rc2.patch => nfs-utils-1-2-9-rc4.patch | 316 ++++++++++++++++++ nfs-utils.spec | 5 +- 2 files changed, 320 insertions(+), 1 deletion(-) rename nfs-utils-1-2-9-rc2.patch => nfs-utils-1-2-9-rc4.patch (56%) diff --git a/nfs-utils-1-2-9-rc2.patch b/nfs-utils-1-2-9-rc4.patch similarity index 56% rename from nfs-utils-1-2-9-rc2.patch rename to nfs-utils-1-2-9-rc4.patch index d82630f..ff965fc 100644 --- a/nfs-utils-1-2-9-rc2.patch +++ b/nfs-utils-1-2-9-rc4.patch @@ -1,3 +1,39 @@ +diff --git a/support/include/conffile.h b/support/include/conffile.h +index ce7aa21..05ea5d2 100644 +--- a/support/include/conffile.h ++++ b/support/include/conffile.h +@@ -54,7 +54,7 @@ extern int conf_end(int, int); + extern void conf_free_list(struct conf_list *); + extern struct sockaddr *conf_get_address(char *, char *); + extern struct conf_list *conf_get_list(char *, char *); +-extern struct conf_list *conf_get_tag_list(char *); ++extern struct conf_list *conf_get_tag_list(char *, char *); + extern int conf_get_num(char *, char *, int); + extern char *conf_get_str(char *, char *); + extern char *conf_get_section(char *, char *, char *); +diff --git a/support/include/nfs/nfs.h b/support/include/nfs/nfs.h +index 174c2dd..38db5b5 100644 +--- a/support/include/nfs/nfs.h ++++ b/support/include/nfs/nfs.h +@@ -15,6 +15,10 @@ + #define NFSD_MINVERS 2 + #define NFSD_MAXVERS 4 + ++#define NFS4_MINMINOR 1 ++#define NFS4_MAXMINOR 2 ++#define NFS4_VERDEFAULT 0x1 /* minor verion 1 */ ++ + struct nfs_fh_len { + int fh_size; + u_int8_t fh_handle[NFS3_FHSIZE]; +@@ -52,6 +56,7 @@ struct nfs_fh_old { + #define NFSCTL_UDPISSET(_cltbits) ((_cltbits) & NFSCTL_UDPBIT) + #define NFSCTL_TCPISSET(_cltbits) ((_cltbits) & NFSCTL_TCPBIT) + ++#define NFSCTL_VERDEFAULT (0xc) /* versions 3 and 4 */ + #define NFSCTL_VERSET(_cltbits, _v) ((_cltbits) |= (1 << ((_v) - 1))) + #define NFSCTL_UDPSET(_cltbits) ((_cltbits) |= NFSCTL_UDPBIT) + #define NFSCTL_TCPSET(_cltbits) ((_cltbits) |= NFSCTL_TCPBIT) diff --git a/support/include/nfsrpc.h b/support/include/nfsrpc.h index a0b80e1..1bfae7a 100644 --- a/support/include/nfsrpc.h @@ -14,6 +50,28 @@ index a0b80e1..1bfae7a 100644 * Contact a remote RPC service to discover whether it is responding * to requests. */ +diff --git a/support/nfs/conffile.c b/support/nfs/conffile.c +index 5015e94..c3434d5 100644 +--- a/support/nfs/conffile.c ++++ b/support/nfs/conffile.c +@@ -565,7 +565,7 @@ cleanup: + } + + struct conf_list * +-conf_get_tag_list(char *section) ++conf_get_tag_list(char *section, char *arg) + { + struct conf_list *list = 0; + struct conf_list_node *node; +@@ -579,6 +579,8 @@ conf_get_tag_list(char *section) + cb = LIST_FIRST(&conf_bindings[conf_hash (section)]); + for (; cb; cb = LIST_NEXT(cb, link)) { + if (strcasecmp (section, cb->section) == 0) { ++ if (arg != NULL && strcasecmp(arg, cb->arg) != 0) ++ continue; + list->cnt++; + node = calloc(1, sizeof *node); + if (!node) diff --git a/support/nfs/getport.c b/support/nfs/getport.c index 3331ad4..081594c 100644 --- a/support/nfs/getport.c @@ -44,6 +102,40 @@ index 3331ad4..081594c 100644 + return nfs_getport_ping((struct sockaddr *)(char *)&addr, sizeof(addr), + program, (rpcvers_t)1, IPPROTO_UDP); +} +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: diff --git a/utils/gssd/gssd.man b/utils/gssd/gssd.man index 1df75c5..ac13fd4 100644 --- a/utils/gssd/gssd.man @@ -128,6 +220,149 @@ index af1844c..b7e2bbb 100644 } switch (sa->sa_family) { +diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c +index 6275dd8..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]); +@@ -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) { +@@ -852,11 +854,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; +@@ -883,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, +@@ -1236,7 +1248,7 @@ gssd_refresh_krb5_machine_credential(char *hostname, + krb5_keytab kt = NULL;; + int retval = 0; + char *k5err = NULL; +- const char *svcnames[5] = { "$", "root", "nfs", "host", NULL }; ++ const char *svcnames[] = { "$", "root", "nfs", "host", NULL }; + + /* + * If a specific service name was specified, use it. +diff --git a/utils/idmapd/idmapd.c b/utils/idmapd/idmapd.c +index beba9c4..b6c6231 100644 +--- a/utils/idmapd/idmapd.c ++++ b/utils/idmapd/idmapd.c +@@ -502,7 +502,7 @@ nfsdcb(int UNUSED(fd), short which, void *data) + struct idmap_client *ic = data; + struct idmap_msg im; + u_char buf[IDMAP_MAXMSGSZ + 1]; +- size_t len; ++ ssize_t len; + ssize_t bsiz; + char *bp, typebuf[IDMAP_MAXMSGSZ], + buf1[IDMAP_MAXMSGSZ], authbuf[IDMAP_MAXMSGSZ], *p; +@@ -511,10 +511,14 @@ nfsdcb(int UNUSED(fd), short which, void *data) + if (which != EV_READ) + goto out; + +- if ((len = read(ic->ic_fd, buf, sizeof(buf))) <= 0) { ++ len = read(ic->ic_fd, buf, sizeof(buf)); ++ if (len == 0) ++ /* No upcall to read; not necessarily a problem: */ ++ return; ++ if (len < 0) { + xlog_warn("nfsdcb: read(%s) failed: errno %d (%s)", +- ic->ic_path, len?errno:0, +- len?strerror(errno):"End of File"); ++ ic->ic_path, errno, ++ strerror(errno)); + nfsdreopen_one(ic); + return; + } +diff --git a/utils/mount/configfile.c b/utils/mount/configfile.c +index 6f2ee75..68b9f93 100644 +--- a/utils/mount/configfile.c ++++ b/utils/mount/configfile.c +@@ -73,6 +73,8 @@ struct mnt_alias { + }; + int mnt_alias_sz = (sizeof(mnt_alias_tab)/sizeof(mnt_alias_tab[0])); + ++static int strict; ++ + /* + * See if the option is an alias, if so return the + * real mount option along with the argument type. +@@ -286,7 +288,7 @@ conf_parse_mntopts(char *section, char *arg, char *opts) + char *nvalue, *ptr; + int argtype; + +- list = conf_get_tag_list(section); ++ list = conf_get_tag_list(section, arg); + TAILQ_FOREACH(node, &list->fields, link) { + /* + * Do not overwrite options if already exists +@@ -310,7 +312,15 @@ conf_parse_mntopts(char *section, char *arg, char *opts) + if (strcasecmp(value, "false") == 0) { + if (argtype != MNT_NOARG) + snprintf(buf, BUFSIZ, "no%s", field); ++ else if (strcasecmp(field, "bg") == 0) ++ snprintf(buf, BUFSIZ, "fg"); ++ else if (strcasecmp(field, "fg") == 0) ++ snprintf(buf, BUFSIZ, "bg"); ++ else if (strcasecmp(field, "sloppy") == 0) ++ strict = 1; + } else if (strcasecmp(value, "true") == 0) { ++ if ((strcasecmp(field, "sloppy") == 0) && strict) ++ continue; + snprintf(buf, BUFSIZ, "%s", field); + } else { + nvalue = strdup(value); +@@ -345,6 +355,7 @@ char *conf_get_mntopts(char *spec, char *mount_point, + char *ptr, *server, *config_opts; + int optlen = 0; + ++ strict = 0; + SLIST_INIT(&head); + list_size = 0; + /* diff --git a/utils/mount/network.c b/utils/mount/network.c index 4be48cd..e2cdcaf 100644 --- a/utils/mount/network.c @@ -262,6 +497,87 @@ index 737927c..517aa62 100644 } struct parsed_fsid { +diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c +index e87c0a9..6db92f0 100644 +--- a/utils/nfsd/nfsd.c ++++ b/utils/nfsd/nfsd.c +@@ -99,8 +99,8 @@ main(int argc, char **argv) + char *p, *progname, *port; + char *haddr = NULL; + int socket_up = 0; +- int minorvers41 = 0; /* nfsv4 minor version */ +- unsigned int versbits = NFSCTL_ALLBITS; ++ int minorvers = NFS4_VERDEFAULT; /* nfsv4 minor version */ ++ unsigned int versbits = NFSCTL_VERDEFAULT; + unsigned int protobits = NFSCTL_ALLBITS; + unsigned int proto4 = 0; + unsigned int proto6 = 0; +@@ -160,11 +160,11 @@ main(int argc, char **argv) + case 4: + if (*p == '.') { + int i = atoi(p+1); +- if (i != 1) { ++ if (i > 2) { + fprintf(stderr, "%s: unsupported minor version\n", optarg); + exit(1); + } +- minorvers41 = -1; ++ NFSCTL_VERUNSET(minorvers, i); + break; + } + case 3: +@@ -181,11 +181,11 @@ main(int argc, char **argv) + case 4: + if (*p == '.') { + int i = atoi(p+1); +- if (i != 1) { ++ if (i > 2) { + fprintf(stderr, "%s: unsupported minor version\n", optarg); + exit(1); + } +- minorvers41 = 1; ++ NFSCTL_VERSET(minorvers, i); + break; + } + case 3: +@@ -282,7 +282,7 @@ main(int argc, char **argv) + * registered with rpcbind. Note that on older kernels w/o the right + * interfaces, these are a no-op. + */ +- nfssvc_setvers(versbits, minorvers41); ++ nfssvc_setvers(versbits, minorvers); + + error = nfssvc_set_sockets(AF_INET, proto4, haddr, port); + if (!error) +diff --git a/utils/nfsd/nfssvc.c b/utils/nfsd/nfssvc.c +index 683008e..8b85846 100644 +--- a/utils/nfsd/nfssvc.c ++++ b/utils/nfsd/nfssvc.c +@@ -269,7 +269,7 @@ nfssvc_set_sockets(const int family, const unsigned int protobits, + } + + void +-nfssvc_setvers(unsigned int ctlbits, int minorvers41) ++nfssvc_setvers(unsigned int ctlbits, int minorvers) + { + int fd, n, off; + char *ptr; +@@ -280,9 +280,12 @@ nfssvc_setvers(unsigned int ctlbits, int minorvers41) + if (fd < 0) + return; + +- if (minorvers41) +- off += snprintf(ptr+off, sizeof(buf) - off, "%c4.1", +- minorvers41 > 0 ? '+' : '-'); ++ for (n = NFS4_MINMINOR; n <= NFS4_MAXMINOR; n++) { ++ if (NFSCTL_VERISSET(minorvers, n)) ++ off += snprintf(ptr+off, sizeof(buf) - off, "+4.%d ", n); ++ else ++ off += snprintf(ptr+off, sizeof(buf) - off, "-4.%d ", n); ++ } + for (n = NFSD_MINVERS; n <= NFSD_MAXVERS; n++) { + if (NFSCTL_VERISSET(ctlbits, n)) + off += snprintf(ptr+off, sizeof(buf) - off, "+%d ", n); diff --git a/utils/nfsdcltrack/nfsdcltrack.man b/utils/nfsdcltrack/nfsdcltrack.man index 47007df..6940788 100644 --- a/utils/nfsdcltrack/nfsdcltrack.man diff --git a/nfs-utils.spec b/nfs-utils.spec index 9ba5940..5775010 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -36,7 +36,7 @@ Source51: nfs-server.preconfig Source52: nfs-server.postconfig %define nfs_configs %{SOURCE50} %{SOURCE51} %{SOURCE52} -Patch001: nfs-utils-1-2-9-rc3.patch +Patch001: nfs-utils-1-2-9-rc4.patch Patch100: nfs-utils-1.2.1-statdpath-man.patch Patch101: nfs-utils-1.2.1-exp-subtree-warn-off.patch @@ -304,6 +304,9 @@ fi %attr(4755,root,root) /sbin/umount.nfs4 %changelog +* Mon Aug 19 2013 Steve Dickson 1.2.8-4.0 +- Updated to latest upstream RC release: nfs-utils-1-2-9-rc4 + * Sat Aug 03 2013 Fedora Release Engineering - 1:1.2.8-4.0 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild