SOURCES: nfs-utils-CITI_NFS4.patch - updated from http://www.citi.umich.edu...

qboosh qboosh at pld-linux.org
Fri Jul 18 22:12:35 CEST 2008


Author: qboosh                       Date: Fri Jul 18 20:12:35 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- updated from http://www.citi.umich.edu/projects/nfsv4/linux/nfs-utils-patches/1.1.2-1/nfs-utils-1.1.2-CITI_NFS4_ALL-1.dif

---- Files affected:
SOURCES:
   nfs-utils-CITI_NFS4.patch (1.6 -> 1.7) 

---- Diffs:

================================================================
Index: SOURCES/nfs-utils-CITI_NFS4.patch
diff -u SOURCES/nfs-utils-CITI_NFS4.patch:1.6 SOURCES/nfs-utils-CITI_NFS4.patch:1.7
--- SOURCES/nfs-utils-CITI_NFS4.patch:1.6	Sat Nov  3 13:46:37 2007
+++ SOURCES/nfs-utils-CITI_NFS4.patch	Fri Jul 18 22:12:30 2008
@@ -2,278 +2,72 @@
 
 The complete set of CITI nfs-utils patches rolled into one patch.
 
-Changes since 1.1.0-CITI_NFS4_ALL-2:
+Changes since 1.1.1-CITI_NFS4_ALL-1:
 
- * Update to nfs-utils-1.1.1
+ * Update to nfs-utils-1.1.2
 
- * Patch from Steve Langasek <vorlon at debian.org> and
-   Steinar H. Gunderson <sesse at debian.org> fixing segfault problem on
-   64-bit platforms introduced by the xlog cleanup (re-using va_list).
+ * Patch from Olga Kornievskaia to read port number from the info
+   file to support non-standard ports.
 
+ * Patch to include the "other" DES encryption types when negotiating
+   a context.
 
+ * Patch originally from Vince Busam <vbusam at google.com> to support looking
+   in multiple directories for credential caches to use when creating
+   a context.
 
+ * A TEMPORARY patch to read a krb5_info file to determine which
+   encryption types the kernel gss_krb5 code supports.
+
+ * A patch to send down a new context format for encryption types
+   other than DES.
 
 ---
 
--nfs-utils-1.1.1-kwc/aclocal.m4                  |  569 +++--------
--nfs-utils-1.1.1-kwc/config.guess                |   34 
--nfs-utils-1.1.1-kwc/config.sub                  |   24 
--nfs-utils-1.1.1-kwc/configure                   | 1195 ++++++++++--------------
--nfs-utils-1.1.1-kwc/ltmain.sh                   |  147 +-
- nfs-utils-1.1.1-kwc/support/nfs/xlog.c          |    8 
- nfs-utils-1.1.1-kwc/utils/gssd/context.h        |    6 
- nfs-utils-1.1.1-kwc/utils/gssd/context_lucid.c  |  391 +++++++
- nfs-utils-1.1.1-kwc/utils/gssd/context_mit.c    |  256 ++++-
- nfs-utils-1.1.1-kwc/utils/gssd/gssd.c           |    8 
- nfs-utils-1.1.1-kwc/utils/gssd/gssd.h           |    3 
- nfs-utils-1.1.1-kwc/utils/gssd/gssd_main_loop.c |   20 
- nfs-utils-1.1.1-kwc/utils/gssd/gssd_proc.c      |  119 +-
- nfs-utils-1.1.1-kwc/utils/gssd/krb5_util.c      |  231 +++-
- nfs-utils-1.1.1-kwc/utils/gssd/krb5_util.h      |    2 
- nfs-utils-1.1.1-kwc/utils/gssd/svcgssd_proc.c   |   84 +
- 16 files changed, 1786 insertions(+), 1311 deletions(-)
+ utils/gssd/context.h       |    6 -
+ utils/gssd/context_lucid.c |  132 +++++++++++++++++++---
+ utils/gssd/context_mit.c   |  134 +++++++++++++++++-----
+ utils/gssd/err_util.c      |    5 
+ utils/gssd/err_util.h      |    1 
+ utils/gssd/gssd.c          |   13 ++
+ utils/gssd/gssd.h          |    4 
+ utils/gssd/gssd.man        |    6 -
+ utils/gssd/gssd_proc.c     |   25 +++-
+ utils/gssd/krb5_util.c     |  263 ++++++++++++++++++++++++++++++++++-----------
+ utils/gssd/krb5_util.h     |    5 
+ 11 files changed, 473 insertions(+), 121 deletions(-)
 
-diff -puN support/nfs/xlog.c~CITI_NFS4_ALL support/nfs/xlog.c
---- nfs-utils-1.1.1/support/nfs/xlog.c~CITI_NFS4_ALL	2007-10-23 14:17:18.316202000 -0400
-+++ nfs-utils-1.1.1-kwc/support/nfs/xlog.c	2007-10-23 14:17:18.385133000 -0400
-@@ -133,9 +133,13 @@ xlog_enabled(int fac)
- void
- xlog_backend(int kind, const char *fmt, va_list args)
- {
-+	va_list args2;
-+
- 	if (!(kind & (L_ALL)) && !(logging && (kind & logmask)))
- 		return;
- 
-+	va_copy(args2, args);
-+
- 	if (log_syslog) {
- 		switch (kind) {
- 		case L_FATAL:
-@@ -172,10 +176,12 @@ xlog_backend(int kind, const char *fmt, 
- 		fprintf(stderr, "%s: ", log_name);
- #endif
- 
--		vfprintf(stderr, fmt, args);
-+		vfprintf(stderr, fmt, args2);
- 		fprintf(stderr, "\n");
- 	}
+diff -puN utils/gssd/gssd.h~CITI_NFS4_ALL utils/gssd/gssd.h
+--- nfs-utils-1.1.2/utils/gssd/gssd.h~CITI_NFS4_ALL	2008-04-30 14:49:15.862200000 -0400
++++ nfs-utils-1.1.2-kwc/utils/gssd/gssd.h	2008-04-30 14:49:17.073538000 -0400
+@@ -50,6 +50,7 @@
+ #define GSSD_DEFAULT_KEYTAB_FILE		"/etc/krb5.keytab"
+ #define GSSD_SERVICE_NAME			"nfs"
+ #define GSSD_SERVICE_NAME_LEN			3
++#define GSSD_MAX_CCACHE_SEARCH			16
  
-+	va_end(args2);
-+
- 	if (kind == L_FATAL)
- 		exit(1);
- }
-diff -puN utils/gssd/svcgssd_proc.c~CITI_NFS4_ALL utils/gssd/svcgssd_proc.c
---- nfs-utils-1.1.1/utils/gssd/svcgssd_proc.c~CITI_NFS4_ALL	2007-10-23 14:17:18.488030000 -0400
-+++ nfs-utils-1.1.1-kwc/utils/gssd/svcgssd_proc.c	2007-10-23 14:17:18.505013000 -0400
-@@ -51,6 +51,7 @@
- #include "gss_util.h"
- #include "err_util.h"
- #include "context.h"
-+#include "gss_oids.h"
+ /*
+  * The gss mechanisms that we can handle
+@@ -61,7 +62,7 @@ enum {AUTHTYPE_KRB5, AUTHTYPE_SPKM3, AUT
+ extern char			pipefs_dir[PATH_MAX];
+ extern char			pipefs_nfsdir[PATH_MAX];
+ extern char			keytabfile[PATH_MAX];
+-extern char			ccachedir[PATH_MAX];
++extern char			*ccachesearch[];
+ extern int			use_memcache;
+ extern int			root_uses_machine_creds;
  
- extern char * mech2file(gss_OID mech);
- #define SVCGSSD_CONTEXT_CHANNEL "/proc/net/rpc/auth.rpcsec.context/channel"
-@@ -66,8 +67,30 @@ struct svc_cred {
+@@ -80,6 +81,7 @@ struct clnt_info {
+ 	int			krb5_poll_index;
+ 	int			spkm3_fd;
+ 	int			spkm3_poll_index;
++	int			port;
  };
  
- 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))) {
-+			printerr(0, "ERROR: get_krb5_hostbased_name failed "
-+				 "to allocate %d bytes\n", name.length);
-+			goto out_err;
-+		}
-+		/* read in name and instance and replace '/' with '@' */
-+		sscanf(name.value, "%[^@]", sname);
-+		p = strchr(sname, '/');
-+		p[0] = '@';
-+	}
-+	*hostbased_name = sname;
-+	return 0;
-+out_err:
-+	return -1;
-+}
-+
-+static int
- do_svc_downcall(gss_buffer_desc *out_handle, struct svc_cred *cred,
--		gss_OID mech, gss_buffer_desc *context_token)
-+		gss_OID mech, gss_buffer_desc *context_token,
-+		char *client_name)
- {
- 	FILE *f;
- 	int i;
-@@ -91,8 +114,9 @@ do_svc_downcall(gss_buffer_desc *out_han
- 	qword_printint(f, cred->cr_gid);
- 	qword_printint(f, cred->cr_ngroups);
- 	printerr(2, "mech: %s, hndl len: %d, ctx len %d, timeout: %d, "
--		 "uid: %d, gid: %d, num aux grps: %d:\n",
-+		 "clnt: %s, uid: %d, gid: %d, num aux grps: %d:\n",
- 		 fname, out_handle->length, context_token->length, 0x7fffffff,
-+		 client_name ? client_name : "<null>",
- 		 cred->cr_uid, cred->cr_gid, cred->cr_ngroups);
- 	for (i=0; i < cred->cr_ngroups; i++) {
- 		qword_printint(f, cred->cr_groups[i]);
-@@ -100,6 +124,8 @@ do_svc_downcall(gss_buffer_desc *out_han
- 	}
- 	qword_print(f, fname);
- 	qword_printhex(f, context_token->value, context_token->length);
-+	if (client_name)
-+		qword_print(f, client_name);
- 	err = qword_eol(f);
- 	fclose(f);
- 	return err;
-@@ -294,6 +320,45 @@ print_hexl(const char *description, unsi
- }
- #endif
- 
-+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;
-+
-+	/* get the client name and for service principals only
-+	 * add it after the context (service name used for
-+	 * authenticating callbacks) */
-+	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) { /* be certain name.length+1 doesn'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 to
-+	 * NT_HOSTBASED_SERVICE */
-+	if (g_OID_equal(&krb5oid, mech)) {
-+		if (!get_krb5_hostbased_name(name, &cname))
-+			*hostbased_name = cname;
-+	}
-+	/* For SPKM3, do ??? */
-+	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
-@@ -320,6 +385,7 @@ handle_nullreq(FILE *f) {
- 	static char		*lbuf = NULL;
- 	static int		lbuflen = 0;
- 	static char		*cp;
-+	char			*hostbased_name = NULL;
- 
- 	printerr(1, "handling null request\n");
- 
-@@ -385,8 +451,12 @@ handle_nullreq(FILE *f) {
- 		gss_release_name(&ignore_min_stat, &client_name);
- 		goto out_err;
- 	}
--	gss_release_name(&ignore_min_stat, &client_name);
--
-+	if (get_hostbased_client_name(client_name, mech, &hostbased_name)) {
-+		/* get_hostbased_client_name() prints error msg */
-+		maj_stat = GSS_S_BAD_NAME; /* XXX ? */
-+		gss_release_name(&ignore_min_stat, &client_name);
-+		goto out_err;
-+	}
- 
- 	/* Context complete. Pass handle_seq in out_handle to use
- 	 * for context lookup in the kernel. */
-@@ -400,12 +470,14 @@ handle_nullreq(FILE *f) {
- 		printerr(0, "WARNING: handle_nullreq: "
- 			    "serialize_context_for_kernel failed\n");
- 		maj_stat = GSS_S_FAILURE;
-+		gss_release_name(&ignore_min_stat, &client_name);
- 		goto out_err;
- 	}
- 	/* We no longer need the gss context */
- 	gss_delete_sec_context(&ignore_min_stat, &ctx, &ignore_out_tok);
- 
--	do_svc_downcall(&out_handle, &cred, mech, &ctx_token);
-+	do_svc_downcall(&out_handle, &cred, mech, &ctx_token, hostbased_name);
-+	gss_release_name(&ignore_min_stat, &client_name);
- continue_needed:
- 	send_response(f, &in_handle, &in_tok, maj_stat, min_stat,
- 			&out_handle, &out_tok);
-@@ -414,6 +486,8 @@ out:
- 		free(ctx_token.value);
- 	if (out_tok.value != NULL)
- 		gss_release_buffer(&ignore_min_stat, &out_tok);
-+	if (hostbased_name)
-+		free(hostbased_name);
- 	printerr(1, "finished handling null request\n");
- 	return;
- 
-diff -puN utils/gssd/gssd_main_loop.c~CITI_NFS4_ALL utils/gssd/gssd_main_loop.c
---- nfs-utils-1.1.1/utils/gssd/gssd_main_loop.c~CITI_NFS4_ALL	2007-10-23 14:17:18.606911000 -0400
-+++ nfs-utils-1.1.1-kwc/utils/gssd/gssd_main_loop.c	2007-10-23 14:17:18.878793000 -0400
-@@ -98,7 +98,7 @@ gssd_run()
- {
- 	int			ret;
- 	struct sigaction	dn_act;
--	int			fd;
-+	int			fd, fd_cb;
- 
- 	/* Taken from linux/Documentation/dnotify.txt: */
- 	dn_act.sa_sigaction = dir_notify_handler;
-@@ -114,6 +114,19 @@ gssd_run()
- 	fcntl(fd, F_SETSIG, DNOTIFY_SIGNAL);
- 	fcntl(fd, F_NOTIFY, DN_CREATE|DN_DELETE|DN_MODIFY|DN_MULTISHOT);
- 
-+	if ((fd_cb = open(pipefs_nfscbdir, O_RDONLY)) == -1) {
-+		/* could be an older kernel or a newer one doing NFS 4.1 */
-+		if (errno != ENOENT)
-+			printerr(0, "WARNING: failed to open %s: %s\n",
-+				 pipefs_nfscbdir, strerror(errno));
-+		/* ignore processing callback directory */
-+		memset(pipefs_nfscbdir, '\0', sizeof(pipefs_nfscbdir));
-+	} else {
-+		fcntl(fd_cb, F_SETSIG, DNOTIFY_SIGNAL);
-+		fcntl(fd_cb, F_NOTIFY,
-+			DN_CREATE|DN_DELETE|DN_MODIFY|DN_MULTISHOT);
-+	}
-+
- 	init_client_list();
- 
- 	printerr(1, "beginning poll\n");
-@@ -121,8 +134,7 @@ gssd_run()
- 		while (dir_changed) {
- 			dir_changed = 0;
- 			if (update_client_list()) {
--				printerr(0, "ERROR: couldn't update "
--					 "client list\n");
-+				/* Error msg is already printed */
- 				exit(1);
- 			}
- 		}
-@@ -141,5 +153,7 @@ gssd_run()
- 		}
- 	}
- 	close(fd);
-+	if (fd_cb != -1)
-+		close(fd_cb);
- 	return;
- }
+ void init_client_list(void);
 diff -puN utils/gssd/gssd_proc.c~CITI_NFS4_ALL utils/gssd/gssd_proc.c
---- nfs-utils-1.1.1/utils/gssd/gssd_proc.c~CITI_NFS4_ALL	2007-10-23 14:17:18.662855000 -0400
-+++ nfs-utils-1.1.1-kwc/utils/gssd/gssd_proc.c	2007-10-23 14:17:19.021793000 -0400
+--- nfs-utils-1.1.2/utils/gssd/gssd_proc.c~CITI_NFS4_ALL	2008-04-30 14:49:15.986076000 -0400
++++ nfs-utils-1.1.2-kwc/utils/gssd/gssd_proc.c	2008-04-30 14:49:17.167444000 -0400
 @@ -102,7 +102,7 @@ int pollsize;  /* the size of pollaray (
  /* XXX buffer problems: */
  static int
@@ -283,90 +77,36 @@
  #define INFOBUFLEN 256
  	char		buf[INFOBUFLEN];
  	static char	dummy[128];
-@@ -112,6 +112,9 @@ read_service_info(char *info_file_name, 
+@@ -112,6 +112,8 @@ read_service_info(char *info_file_name, 
  	char		program[16];
  	char		version[16];
  	char		protoname[16];
-+	char		princname[128];
 +	char		cb_port[128];
 +	char		*p;
  	in_addr_t	inaddr;
  	int		fd = -1;
  	struct hostent	*ent = NULL;
-@@ -136,19 +139,33 @@ read_service_info(char *info_file_name, 
- 		   service, program, version,
- 		   address,
- 		   protoname);
--
- 	if (numfields == 5) {
- 		strcpy(protoname, "tcp");
- 	} else if (numfields != 6) {
+@@ -143,6 +145,10 @@ read_service_info(char *info_file_name, 
  		goto fail;
  	}
  
-+	princname[0] = '\0';
-+	if ((p = strstr(buf, "principal name:")) != NULL)
-+		sscanf(p, "principal name: %127s\n", princname);
 +	cb_port[0] = '\0';
 +	if ((p = strstr(buf, "port")) != NULL)
 +		sscanf(p, "port: %127s\n", cb_port);
 +
  	/* check service, program, and version */
--	if(memcmp(service, "nfs", 3)) return -1;
-+	if (memcmp(service, "nfs", 3))
-+		return -1;
+ 	if(memcmp(service, "nfs", 3)) return -1;
  	*prog = atoi(program + 1); /* skip open paren */
- 	*vers = atoi(version);
--	if((*prog != 100003) || ((*vers != 2) && (*vers != 3) && (*vers != 4)))
--		goto fail;
-+
-+	if (strlen(service) == 3 && !memcmp(service, "nfs", 3)) {
-+		if ((*prog != 100003) || ((*vers != 2) && (*vers != 3) &&
-+		    (*vers != 4)))
-+			goto fail;
-+	} else if (!memcmp(service, "nfs4_cb", 7)) {
-+		if (*vers != 1)
-+			goto fail;
-+	}
- 
- 	/* create service name */
- 	inaddr = inet_addr(address);
-@@ -159,7 +176,12 @@ read_service_info(char *info_file_name, 
- 	if (!(*servername = calloc(strlen(ent->h_name) + 1, 1)))
+@@ -163,6 +169,8 @@ read_service_info(char *info_file_name, 
+ 	if (!(*servicename = calloc(strlen(buf) + 1, 1)))
  		goto fail;
- 	memcpy(*servername, ent->h_name, strlen(ent->h_name));
--	snprintf(buf, INFOBUFLEN, "%s@%s", service, ent->h_name);
-+	if (princname[0] != '\0')
-+		printerr(2, "info file contains princname=%s\n", princname);
-+
-+	snprintf(buf, INFOBUFLEN, "nfs@%s", ent->h_name);
+ 	memcpy(*servicename, buf, strlen(buf));
 +	if (cb_port[0] != '\0')
 +		*port = atoi(cb_port);
- 	if (!(*servicename = calloc(strlen(buf) + 1, 1)))
+ 
+ 	if (!(*protocol = strdup(protoname)))
  		goto fail;
- 	memcpy(*servicename, buf, strlen(buf));
-@@ -219,9 +241,9 @@ out:
- static int
- process_clnt_dir_files(struct clnt_info * clp)
- {
--	char	kname[32];
--	char	sname[32];
--	char	info_file_name[32];
-+	char	kname[PATH_MAX];
-+	char	sname[PATH_MAX];
-+	char	info_file_name[PATH_MAX];
- 
- 	if (clp->krb5_fd == -1) {
- 		snprintf(kname, sizeof(kname), "%s/krb5", clp->dirname);
-@@ -231,14 +253,14 @@ process_clnt_dir_files(struct clnt_info 
- 		snprintf(sname, sizeof(sname), "%s/spkm3", clp->dirname);
- 		clp->spkm3_fd = open(sname, O_RDWR);
- 	}
--	if((clp->krb5_fd == -1) && (clp->spkm3_fd == -1))
-+	if ((clp->krb5_fd == -1) && (clp->spkm3_fd == -1))
- 		return -1;
- 	snprintf(info_file_name, sizeof(info_file_name), "%s/info",
- 			clp->dirname);
+@@ -238,7 +246,7 @@ process_clnt_dir_files(struct clnt_info 
  	if ((clp->servicename == NULL) &&
  	     read_service_info(info_file_name, &clp->servicename,
  				&clp->servername, &clp->prog, &clp->vers,
@@ -375,141 +115,7 @@
  		return -1;
  	return 0;
  }
-@@ -288,17 +310,17 @@ insert_clnt_poll(struct clnt_info *clp)
- }
- 
- static void
--process_clnt_dir(char *dir)
-+process_clnt_dir(char *dir, char *pdir)
- {
- 	struct clnt_info *	clp;
- 
- 	if (!(clp = insert_new_clnt()))
- 		goto fail_destroy_client;
- 
--	if (!(clp->dirname = calloc(strlen(dir) + 1, 1))) {
-+	if (!(clp->dirname = calloc(strlen(dir) + strlen(pdir) + 1, 1))) {
- 		goto fail_destroy_client;
- 	}
--	memcpy(clp->dirname, dir, strlen(dir));
-+	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));
-@@ -342,16 +364,24 @@ init_client_list(void)
-  * directories, since the DNOTIFY could have been in there.
-  */
- static void
--update_old_clients(struct dirent **namelist, int size)
-+update_old_clients(struct dirent **namelist, int size, char *pdir)
- {
- 	struct clnt_info *clp;
- 	void *saveprev;
- 	int i, stillhere;
-+	char fname[PATH_MAX];
- 
- 	for (clp = clnt_list.tqh_first; clp != NULL; clp = clp->list.tqe_next) {
-+		/* only compare entries in the global list that are from the
-+		 * same pipefs parent directory as "pdir"
-+		 */
-+		if (strncmp(clp->dirname, pdir, strlen(pdir)) != 0) break;
-+
- 		stillhere = 0;
- 		for (i=0; i < size; i++) {
--			if (!strcmp(clp->dirname, namelist[i]->d_name)) {
-+			snprintf(fname, sizeof(fname), "%s/%s",
-+				 pdir, namelist[i]->d_name);
-+			if (strcmp(clp->dirname, fname) == 0) {
- 				stillhere = 1;
- 				break;
- 			}
-@@ -372,47 +402,72 @@ update_old_clients(struct dirent **namel
- 
- /* Search for a client by directory name, return 1 if found, 0 otherwise */
- static int
--find_client(char *dirname)
-+find_client(char *dirname, char *pdir)
- {
- 	struct clnt_info	*clp;
-+	char fname[PATH_MAX];
- 
--	for (clp = clnt_list.tqh_first; clp != NULL; clp = clp->list.tqe_next)
--		if (!strcmp(clp->dirname, dirname))
-+	for (clp = clnt_list.tqh_first; clp != NULL; clp = clp->list.tqe_next) {
-+		snprintf(fname, sizeof(fname), "%s/%s", pdir, dirname);
-+		if (strcmp(clp->dirname, fname) == 0)
- 			return 1;
-+	}
- 	return 0;
- }
- 
--/* Used to read (and re-read) list of clients, set up poll array. */
--int
--update_client_list(void)
-+static int
-+process_pipedir(char *pipe_name)
- {
- 	struct dirent **namelist;
- 	int i, j;
- 
--	if (chdir(pipefs_nfsdir) < 0) {
-+	if (chdir(pipe_name) < 0) {
- 		printerr(0, "ERROR: can't chdir to %s: %s\n",
--			 pipefs_nfsdir, strerror(errno));
-+			 pipe_name, strerror(errno));
- 		return -1;
- 	}
- 
--	j = scandir(pipefs_nfsdir, &namelist, NULL, alphasort);
-+	j = scandir(pipe_name, &namelist, NULL, alphasort);
- 	if (j < 0) {
- 		printerr(0, "ERROR: can't scandir %s: %s\n",
--			 pipefs_nfsdir, strerror(errno));
-+			 pipe_name, strerror(errno));
- 		return -1;
- 	}
--	update_old_clients(namelist, j);
-+
-+	update_old_clients(namelist, j, pipe_name);
- 	for (i=0; i < j; i++) {
- 		if (i < FD_ALLOC_BLOCK
- 				&& !strncmp(namelist[i]->d_name, "clnt", 4)
--				&& !find_client(namelist[i]->d_name))
--			process_clnt_dir(namelist[i]->d_name);
-+				&& !find_client(namelist[i]->d_name, pipe_name))
-+			process_clnt_dir(namelist[i]->d_name, pipe_name);
- 		free(namelist[i]);
- 	}
- 
- 	free(namelist);
-+
- 	return 0;
- }
-+/* Used to read (and re-read) list of clients, set up poll array. */
-+int
-+update_client_list(void)
-+{
-+	int retval = -1;
-+
-+	retval = process_pipedir(pipefs_nfsdir);
-+	if (retval)
-+		printerr(0, "ERROR: processing %s\n", pipefs_nfsdir);
-+
-+	/* if we successfully processed nfsdir and callback directory exists
-+	 * process any events in the callback directory
-+	 */
-+	if (retval == 0 && pipefs_nfscbdir[0] != '\0') {
-+		retval = process_pipedir(pipefs_nfscbdir);
-+		if (retval)
-+			printerr(0, "ERROR: processing %s\n", pipefs_nfscbdir);
-+	}
-+
-+	return retval;
-+}
- 
- static int
- do_downcall(int k5_fd, uid_t uid, struct authgss_private_data *pd,
-@@ -587,6 +642,8 @@ int create_auth_rpc_client(struct clnt_i
+@@ -587,6 +595,8 @@ int create_auth_rpc_client(struct clnt_i
  			 clp->servername, uid);
  		goto out_fail;
  	}
@@ -518,86 +124,35 @@
  	if (a->ai_protocol == IPPROTO_TCP) {
  		if ((rpc_clnt = clnttcp_create(
  					(struct sockaddr_in *) a->ai_addr,
-@@ -677,7 +734,7 @@ handle_krb5_upcall(struct clnt_info *clp
+@@ -675,6 +685,7 @@ handle_krb5_upcall(struct clnt_info *clp
+ 	gss_buffer_desc		token;
+ 	char			**credlist = NULL;
  	char			**ccname;
++	char			**dirname;
  	int			create_resp = -1;
  
--	printerr(1, "handling krb5 upcall\n");
-+	printerr(1, "handling krb5 upcall (%s)\n", clp->dirname);
- 
- 	token.length = 0;
- 	token.value = NULL;
-@@ -787,7 +844,7 @@ handle_spkm3_upcall(struct clnt_info *cl
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/nfs-utils-CITI_NFS4.patch?r1=1.6&r2=1.7&f=u



More information about the pld-cvs-commit mailing list