summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrmacklem <rmacklem@FreeBSD.org>2009-06-15 14:44:55 +0000
committerrmacklem <rmacklem@FreeBSD.org>2009-06-15 14:44:55 +0000
commit91a5303162c14343bc9885558396339dd973b93b (patch)
tree90b91c6e5121e5658a06462aed70b6d9ddb9eb8e
parentc4234dfc7eb9855be96c4fc7f7b6ab1dc5274b13 (diff)
downloadFreeBSD-src-91a5303162c14343bc9885558396339dd973b93b.zip
FreeBSD-src-91a5303162c14343bc9885558396339dd973b93b.tar.gz
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)
-rw-r--r--sys/rpc/rpcsec_gss/svc_rpcsec_gss.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c b/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
index eb9314b..9653c91 100644
--- a/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
+++ b/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
@@ -65,12 +65,14 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/jail.h>
#include <sys/kernel.h>
#include <sys/kobj.h>
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/mutex.h>
+#include <sys/proc.h>
#include <sys/sx.h>
#include <sys/ucred.h>
@@ -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_gss_clientid *id)
{
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++;
OpenPOWER on IntegriCloud