From owner-svn-src-all@FreeBSD.ORG Mon Jun 15 14:44:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B237106564A; Mon, 15 Jun 2009 14:44:56 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D31418FC16; Mon, 15 Jun 2009 14:44:55 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5FEit5n092513; Mon, 15 Jun 2009 14:44:55 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5FEitbl092512; Mon, 15 Jun 2009 14:44:55 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200906151444.n5FEitbl092512@svn.freebsd.org> From: Rick Macklem Date: Mon, 15 Jun 2009 14:44:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194239 - head/sys/rpc/rpcsec_gss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2009 14:44:56 -0000 Author: rmacklem Date: Mon Jun 15 14:44:55 2009 New Revision: 194239 URL: http://svn.freebsd.org/changeset/base/194239 Log: Replace the global references to "hostid" in svc_rpcsec_gss.c to local variables set via the getcredhostid() function. I also changed the type of ci_hostid to "unsigned long" so that it matches what is returned by getcredhostid(). Although "struct svc_rpc_gss_clientid" goes on the wire during RPCSEC_GSS, it is just a variable # of opaque bytes to the client, so it doesn't matter how much storage ci_hostid uses. Approved by: kib (mentor) Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c ============================================================================== --- head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Mon Jun 15 13:48:31 2009 (r194238) +++ head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Mon Jun 15 14:44:55 2009 (r194239) @@ -65,12 +65,14 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include #include #include +#include #include #include @@ -121,7 +123,7 @@ enum svc_rpc_gss_client_state { #define SVC_RPC_GSS_SEQWINDOW 128 struct svc_rpc_gss_clientid { - uint32_t ci_hostid; + unsigned long ci_hostid; uint32_t ci_boottime; uint32_t ci_id; }; @@ -505,9 +507,11 @@ svc_rpc_gss_find_client(struct svc_rpc_g { struct svc_rpc_gss_client *client; struct svc_rpc_gss_client_list *list; + unsigned long hostid; rpc_gss_log_debug("in svc_rpc_gss_find_client(%d)", id->ci_id); + getcredhostid(curthread->td_ucred, &hostid); if (id->ci_hostid != hostid || id->ci_boottime != boottime.tv_sec) return (NULL); @@ -536,6 +540,7 @@ svc_rpc_gss_create_client(void) { struct svc_rpc_gss_client *client; struct svc_rpc_gss_client_list *list; + unsigned long hostid; rpc_gss_log_debug("in svc_rpc_gss_create_client()"); @@ -543,6 +548,7 @@ svc_rpc_gss_create_client(void) memset(client, 0, sizeof(struct svc_rpc_gss_client)); refcount_init(&client->cl_refs, 1); sx_init(&client->cl_lock, "GSS-client"); + getcredhostid(curthread->td_ucred, &hostid); client->cl_id.ci_hostid = hostid; client->cl_id.ci_boottime = boottime.tv_sec; client->cl_id.ci_id = svc_rpc_gss_next_clientid++;