summaryrefslogtreecommitdiff
path: root/sbin/nfsd/nfsd.c
diff options
context:
space:
mode:
authorThordur I. Bjornsson <thib@cvs.openbsd.org>2007-05-27 21:14:42 +0000
committerThordur I. Bjornsson <thib@cvs.openbsd.org>2007-05-27 21:14:42 +0000
commit78d4c39c88259ae5aac171963c3b0721385a4b44 (patch)
tree211438e789adf43068bd05d8265843ad27e042b9 /sbin/nfsd/nfsd.c
parent85facf0ed7d20fd6e060f4b25b388cfe820f51a1 (diff)
cleanup the nfssvc() system call.
* Remove alot of dead kerberos code like the options for NFSSVC_AUTHIN and NFSSVC_AUTHFAIL wich where originally to get the kerberos auth info into the kernel. (that hasnt worked for long, if ever.) Also remove some helper functions and associated goo, however theres still alot of it left. * Remove NFSSVC_BIOD, biod's where replaced with kernel threads a long time ago. * NFSSVC_MNTD wich was is NQNFS leftover. Update the man page and nfsd(8). nfssvc(2) besides being special has only one user in the tree nfsd(8), therefore no library bumps are needed. (discussed with deraadt@). ok beck@, "go a head" deraadt@ Tested by ckuethe@
Diffstat (limited to 'sbin/nfsd/nfsd.c')
-rw-r--r--sbin/nfsd/nfsd.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/sbin/nfsd/nfsd.c b/sbin/nfsd/nfsd.c
index b963f55dbbb..14286e1159b 100644
--- a/sbin/nfsd/nfsd.c
+++ b/sbin/nfsd/nfsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfsd.c,v 1.26 2005/12/02 01:08:01 deraadt Exp $ */
+/* $OpenBSD: nfsd.c,v 1.27 2007/05/27 21:14:41 thib Exp $ */
/* $NetBSD: nfsd.c,v 1.19 1996/02/18 23:18:56 mycroft Exp $ */
/*
@@ -43,7 +43,7 @@ static const char copyright[] =
#if 0
static const char sccsid[] = "@(#)nfsd.c 8.9 (Berkeley) 3/29/95";
#else
-static const char rcsid[] = "$OpenBSD: nfsd.c,v 1.26 2005/12/02 01:08:01 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: nfsd.c,v 1.27 2007/05/27 21:14:41 thib Exp $";
#endif
#endif /* not lint */
@@ -120,7 +120,7 @@ main(int argc, char *argv[])
fd_set *ready, *sockbits;
size_t fd_size;
int ch, connect_type_cnt, i, maxsock = 0, msgsock;
- int nfsdcnt = DEFNFSDCNT, nfssvc_flag, on, reregister = 0, sock;
+ int nfsdcnt = DEFNFSDCNT, on, reregister = 0, sock;
int udpflag = 0, tcpflag = 0, tcpsock;
const char *errstr = NULL;
socklen_t len;
@@ -199,14 +199,10 @@ main(int argc, char *argv[])
}
setproctitle("server");
- nfssvc_flag = NFSSVC_NFSD;
nsd.nsd_nfsd = NULL;
- while (nfssvc(nfssvc_flag, &nsd) < 0) {
- if (errno != ENEEDAUTH) {
- syslog(LOG_ERR, "nfssvc: %m");
- return (1);
- }
- nfssvc_flag = NFSSVC_NFSD | NFSSVC_AUTHINFAIL;
+ if (nfssvc(NFSSVC_NFSD, &nsd) < 0) {
+ syslog(LOG_ERR, "nfssvc: %m");
+ return (1);
}
return (0);
}
@@ -323,7 +319,10 @@ main(int argc, char *argv[])
nfsdargs.sock = msgsock;
nfsdargs.name = (caddr_t)&inetpeer;
nfsdargs.namelen = sizeof(inetpeer);
- nfssvc(NFSSVC_ADDSOCK, &nfsdargs);
+ if (nfssvc(NFSSVC_ADDSOCK, &nfsdargs) < 0) {
+ syslog(LOG_ERR, "can't Add TCP socket");
+ return (1);
+ }
(void)close(msgsock);
}
}