Fully exterminate nfsd_srvargs and nfsd_cargs. They were either unused
or giant NOP's. There was a credential in srvargs that was giving rwatson some heartburn. :-)
This commit is contained in:
parent
317aee9760
commit
28cc58165d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=100641
@ -99,29 +99,6 @@ struct nfsd_args {
|
||||
int namelen; /* Length of name */
|
||||
};
|
||||
|
||||
struct nfsd_srvargs {
|
||||
struct nfsd *nsd_nfsd; /* Pointer to in kernel nfsd struct */
|
||||
uid_t nsd_uid; /* Effective uid mapped to cred */
|
||||
u_int32_t nsd_haddr; /* Ip address of client */
|
||||
struct xucred nsd_cr; /* Cred. uid maps to */
|
||||
u_int nsd_authlen; /* Length of auth string (ret) */
|
||||
u_char *nsd_authstr; /* Auth string (ret) */
|
||||
u_int nsd_verflen; /* and the verfier */
|
||||
u_char *nsd_verfstr;
|
||||
struct timeval nsd_timestamp; /* timestamp from verifier */
|
||||
u_int32_t nsd_ttl; /* credential ttl (sec) */
|
||||
};
|
||||
|
||||
struct nfsd_cargs {
|
||||
char *ncd_dirp; /* Mount dir path */
|
||||
uid_t ncd_authuid; /* Effective uid */
|
||||
int ncd_authtype; /* Type of authenticator */
|
||||
u_int ncd_authlen; /* Length of authenticator string */
|
||||
u_char *ncd_authstr; /* Authenticator string */
|
||||
u_int ncd_verflen; /* and the verifier */
|
||||
u_char *ncd_verfstr;
|
||||
};
|
||||
|
||||
/*
|
||||
* XXX to allow amd to include nfs.h without nfsproto.h
|
||||
*/
|
||||
|
@ -103,7 +103,7 @@ SYSCTL_INT(_vfs_nfsrv, OID_AUTO, gatherdelay_v3, CTLFLAG_RW,
|
||||
static int nfssvc_addsock(struct file *, struct sockaddr *,
|
||||
struct thread *);
|
||||
static void nfsrv_zapsock(struct nfssvc_sock *slp);
|
||||
static int nfssvc_nfsd(struct nfsd_srvargs *, caddr_t, struct thread *);
|
||||
static int nfssvc_nfsd(caddr_t, struct thread *);
|
||||
|
||||
/*
|
||||
* NFS server system calls
|
||||
@ -135,7 +135,6 @@ nfssvc(struct thread *td, struct nfssvc_args *uap)
|
||||
struct file *fp;
|
||||
struct sockaddr *nam;
|
||||
struct nfsd_args nfsdarg;
|
||||
struct nfsd_srvargs nfsd_srvargs, *nsd = &nfsd_srvargs;
|
||||
int error;
|
||||
|
||||
mtx_lock(&Giant);
|
||||
@ -172,10 +171,7 @@ nfssvc(struct thread *td, struct nfssvc_args *uap)
|
||||
error = nfssvc_addsock(fp, nam, td);
|
||||
fdrop(fp, td);
|
||||
} else if (uap->flag & NFSSVC_NFSD) {
|
||||
error = copyin(uap->argp, (caddr_t)nsd, sizeof (*nsd));
|
||||
if (error)
|
||||
return (error);
|
||||
error = nfssvc_nfsd(nsd, uap->argp, td);
|
||||
error = nfssvc_nfsd(uap->argp, td);
|
||||
} else {
|
||||
error = ENXIO;
|
||||
}
|
||||
@ -282,11 +278,11 @@ nfssvc_addsock(struct file *fp, struct sockaddr *mynam, struct thread *td)
|
||||
* until it is killed by a signal.
|
||||
*/
|
||||
static int
|
||||
nfssvc_nfsd(struct nfsd_srvargs *nsd, caddr_t argp, struct thread *td)
|
||||
nfssvc_nfsd(caddr_t argp, struct thread *td)
|
||||
{
|
||||
int siz;
|
||||
struct nfssvc_sock *slp;
|
||||
struct nfsd *nfsd = nsd->nsd_nfsd;
|
||||
struct nfsd *nfsd;
|
||||
struct nfsrv_descript *nd = NULL;
|
||||
struct mbuf *m, *mreq;
|
||||
int error = 0, cacherep, s, sotype, writes_todo;
|
||||
@ -297,15 +293,12 @@ nfssvc_nfsd(struct nfsd_srvargs *nsd, caddr_t argp, struct thread *td)
|
||||
cacherep = RC_DOIT;
|
||||
writes_todo = 0;
|
||||
#endif
|
||||
if (nfsd == NULL) {
|
||||
nsd->nsd_nfsd = nfsd = (struct nfsd *)
|
||||
malloc(sizeof (struct nfsd), M_NFSD, M_WAITOK | M_ZERO);
|
||||
s = splnet();
|
||||
nfsd->nfsd_td = td;
|
||||
TAILQ_INSERT_TAIL(&nfsd_head, nfsd, nfsd_chain);
|
||||
nfs_numnfsd++;
|
||||
} else
|
||||
s = splnet();
|
||||
nfsd = (struct nfsd *)
|
||||
malloc(sizeof (struct nfsd), M_NFSD, M_WAITOK | M_ZERO);
|
||||
s = splnet();
|
||||
nfsd->nfsd_td = td;
|
||||
TAILQ_INSERT_TAIL(&nfsd_head, nfsd, nfsd_chain);
|
||||
nfs_numnfsd++;
|
||||
|
||||
/*
|
||||
* Loop getting rpc requests until SIGKILL.
|
||||
@ -538,7 +531,6 @@ nfssvc_nfsd(struct nfsd_srvargs *nsd, caddr_t argp, struct thread *td)
|
||||
TAILQ_REMOVE(&nfsd_head, nfsd, nfsd_chain);
|
||||
splx(s);
|
||||
free((caddr_t)nfsd, M_NFSD);
|
||||
nsd->nsd_nfsd = NULL;
|
||||
if (--nfs_numnfsd == 0)
|
||||
nfsrv_init(TRUE); /* Reinitialize everything */
|
||||
return (error);
|
||||
|
Loading…
Reference in New Issue
Block a user