From a49d769e8825e99878bb002b4dbef2ad4e2c5b92 Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Sun, 4 Nov 2007 19:20:33 +0000 Subject: [PATCH] Garbage collect now-unused nfsrv_setcred() -- it's not only unused, but also a purveyor of unfortunate (and now unsupported) direct frobbing of struct ucred. MFC after: 3 days --- sys/nfsserver/nfs.h | 1 - sys/nfsserver/nfs_srvsubs.c | 17 ----------------- 2 files changed, 18 deletions(-) diff --git a/sys/nfsserver/nfs.h b/sys/nfsserver/nfs.h index 72e12044b60c..2604e90c92ab 100644 --- a/sys/nfsserver/nfs.h +++ b/sys/nfsserver/nfs.h @@ -347,7 +347,6 @@ void nfsrv_cleancache(void); void nfsrv_init(int); int nfsrv_errmap(struct nfsrv_descript *, int); void nfsrvw_sort(gid_t *, int); -void nfsrv_setcred(struct ucred *, struct ucred *); void nfsrv_wakenfsd(struct nfssvc_sock *slp); int nfsrv_writegather(struct nfsrv_descript **, struct nfssvc_sock *, struct thread *, struct mbuf **); diff --git a/sys/nfsserver/nfs_srvsubs.c b/sys/nfsserver/nfs_srvsubs.c index 380df3a23f42..e0ecb682d677 100644 --- a/sys/nfsserver/nfs_srvsubs.c +++ b/sys/nfsserver/nfs_srvsubs.c @@ -1265,23 +1265,6 @@ nfsrvw_sort(gid_t *list, int num) } } -/* - * copy credentials making sure that the result can be compared with bcmp(). - */ -void -nfsrv_setcred(struct ucred *incred, struct ucred *outcred) -{ - int i; - - bzero((caddr_t)outcred, sizeof (struct ucred)); - refcount_init(&outcred->cr_ref, 1); - outcred->cr_uid = incred->cr_uid; - outcred->cr_ngroups = incred->cr_ngroups; - for (i = 0; i < incred->cr_ngroups; i++) - outcred->cr_groups[i] = incred->cr_groups[i]; - nfsrvw_sort(outcred->cr_groups, outcred->cr_ngroups); -} - /* * Helper functions for macros. */