Commit Graph

93 Commits

Author SHA1 Message Date
rillig 6f4965e060 usr.sbin: remove unnecessary CONSTCOND, lint no longer needs it
Since 2021-01-31, lint no longer requires a CONSTCOND comment in a
do-while-0 statement since this is a common code pattern, especially in
statement-like macros.

sed -i -E 's,} while \(/\* ?CONSTCOND ?\*/ ?0\),} while (0),' */*.[ch]
2021-11-27 22:30:25 +00:00
christos 74f5524807 Revert previous, don't write to the parent too early because it can exit
before the child is ready to serve. The child will write in daemon2_detach()
when it is ready.
While here:
- return EXIT_{SUCCESS,FAILURE)
- check syscall error against -1
2020-09-17 12:48:12 +00:00
gson 57091f5040 Fix indentation 2020-08-26 13:35:12 +00:00
gson 460a8a88e0 Remove trailing whitespace 2020-08-26 13:33:42 +00:00
gson 69570b99d6 Remove superfluous empty line 2020-08-26 13:32:56 +00:00
kamil aa97815be0 Include explicitly <rump/rump_syscallshotgun.h> for previous indirect users
via <rump/rump.h>.
2020-06-17 00:16:21 +00:00
christos dd41e8f2d0 Don't exit if we have udp only sockets, instead wait for all the workers
to terminate.
2016-08-23 13:10:12 +00:00
christos e405703132 PR/51437: Hauke Fath: write a byte to the socket so that nfsd -u does not die. 2016-08-22 16:08:51 +00:00
christos 5cbe00119b Expose debugging 2016-03-17 15:25:46 +00:00
christos 813c1f3886 Rump-ify. 2015-12-23 18:41:54 +00:00
joerg 7d8085e8a5 Typo 2015-09-12 13:50:55 +00:00
christos bc9d1499ae Memset the whole cfg array, not piecemeal because otherwise you'll end
up with random data depending on the options set.
XXX: pullup 7
2014-12-05 19:24:41 +00:00
gson da700ef1b2 When daemonizing, delay the parent exit until the daemon is
ready to provide service.  Fixes one of the race conditions
of PR misc/48282.
2014-03-29 13:50:53 +00:00
joerg dcdf3b2d8d Fix memset usage. 2012-08-15 00:16:06 +00:00
christos c3c4374a7d use freeaddrinfo() 2012-08-14 08:23:30 +00:00
wiz b8117286a3 Sort descriptions. Fix macro. Move example to new EXAMPLES section. Add EXIT STATUS section 2012-08-13 08:39:28 +00:00
christos eff766617d Let nfsd behave like all other programs: tries to use both inet4 and inet6
by default and both udp and tcp: -4 uses only inet4, -6 uses only inet6,
-t uses only tcp, -u uses only udp. For compatibility, we detect old option
usage, we warn, and DTRT.
2012-08-13 08:19:11 +00:00
joerg 8138b1d050 static + ANSIfy + __dead 2011-08-30 20:07:31 +00:00
christos 0283f36219 PR/42486: Ed Ravin nfsd sometimes exits prematurely during port-scan fix
from freebsd bin 61084 applied (preserving errno properly). The accept
code should be merged.
2009-12-21 05:06:55 +00:00
pooka 2d18baefd2 Silly-rename child to worker (no pun intended .. maybe).
nfsd is threading these days.
2008-11-21 07:48:35 +00:00
pooka c02ede9188 use varargs macro to make -DDDEBUG compile 2008-11-21 07:42:30 +00:00
lukem 9c1945664c Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
2008-07-21 13:36:57 +00:00
yamt 8e73684fa1 update. 2008-03-17 09:57:11 +00:00
yamt 7c034e5b2c remove MAXNFSDCNT. 2008-03-17 09:52:26 +00:00
ad 60df1d7038 The ISO stuff has never worked, remove it. 2008-02-27 16:39:17 +00:00
yamt 0fc9d7ee0d after switching to threads:
- g/c SIGCHLD handler.
- pthread_setname_np rather than setproctitle.

the patch provided by Andrew Doran.
2007-07-11 04:59:19 +00:00
yamt cebe06e8e7 use pthread_create instead of fork. 2007-07-10 13:52:51 +00:00
tls 4147a3c54a Add new Makefile knob, USE_FORT, which extends USE_SSP by turning on the
FORTIFY_SOURCE feature of libssp, thus checking the size of arguments to
various string and memory copy and set functions (as well as a few system
calls and other miscellany) where known at function entry.  RedHat has
evidently built all "core system packages" with this option for some time.

This option should be used at the top of Makefiles (or Makefile.inc where
this is used for subdirectories) but after any setting of LIB.

This is only useful for userland code, and cannot be used in libc or in
any code which includes the libc internals, because it overrides certain
libc functions with macros.  Some effort has been made to make USE_FORT=yes
work correctly for a full-system build by having the bsd.sys.mk logic
disable the feature where it should not be used (libc, libssp iteself,
the kernel) but no attempt has been made to build the entire system with
USE_FORT and doing so will doubtless expose numerous bugs and misfeatures.

Adjust the system build so that all programs and libraries that are setuid,
directly handle network data (including serial comm data), perform
authentication, or appear likely to have (or have a history of having)
data-driven bugs (e.g. file(1)) are built with USE_FORT=yes by default,
with the exception of libc, which cannot use USE_FORT and thus uses
only USE_SSP by default.  Tested on i386 with no ill results; USE_FORT=no
per-directory or in a system build will disable if desired.
2007-05-28 12:06:17 +00:00
elad 1232ea27c4 PR/18906: roskens at elfin dot net: misc. select() to poll() updates.
Adapted to -current by myself, thanks for the patch!
2006-10-07 17:27:57 +00:00
hubertf a357c40934 In two TCP error cases, say that it's TCP, not UDP.
Pointed out by pee- on IRCnet #NetBSD.
2006-08-25 11:59:30 +00:00
mrg 0c37c63edc change (mostly) int to socklen_t. GCC 4 doesn't like that int and
socklen_t are different signness.
2006-05-09 20:18:05 +00:00
dogcow 028f696b68 Since KerberosIV has gone away, so should NFSKERB. 2006-03-23 15:37:02 +00:00
yamt f79b461ad5 update MAXNFSDCNT and bump date. 2006-01-01 17:03:54 +00:00
lukem 68b1911850 appease gcc -Wuninitialized 2005-06-02 06:54:02 +00:00
jonathan 52315e5149 Increase userspace (/usr/sbin/nfsd) limit on nfsd count from 20 to 1024.
Jason Thorpe suggests removing the limit altogether; anyone who needs
more than 1024 nfsds can still do "nfsd -n 1024" multiple times, and
this provides _some_ saftey-net against nfsd (issued by root) from
eating all the avaiable process slots.
2003-12-06 03:01:16 +00:00
wiz 47190e80b8 Consistently use 'RFC 1234' instead of 'RFC1234' or 'RFC-1234'.
From jmc@openbsd.
2003-09-07 16:22:20 +00:00
agc 326b2259b7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22366, verified by myself.
2003-08-07 11:25:11 +00:00
itojun adeab29eca include des.h, not kerberosIV/des.h 2003-07-23 20:31:18 +00:00
perry e774a083b5 exeeds->exceeds, from PR misc/20741 (Igor Sobrado) 2003-03-31 01:14:14 +00:00
mycroft 29ac8aa531 Fix PR 18391, from Geoff Wing. 2002-09-24 17:32:03 +00:00
mycroft aae6c28cf9 null commit 2002-09-23 12:44:34 +00:00
itojun f46e921837 poll.h, not sys/poll.h 2002-09-23 03:36:03 +00:00
mycroft 39f9b8328c Set fd of unused pollfd entries to -1. 2002-09-20 19:48:58 +00:00
mycroft c2748cb222 select() -> poll() 2002-09-20 06:02:25 +00:00
ross 2a76afae02 Generate <>& symbolically. I'm avoiding .../dist/... directories for now. 2002-02-08 01:36:18 +00:00
wiz a2d753e3ef Whitespace nits. 2002-01-19 11:44:57 +00:00
itojun c878544aa7 s/IPV6_BINDV6ONLY/IPV6_V6ONLY/ to follow changes made yesterday. 2001-10-16 01:51:26 +00:00
cgd d594ce939b comment or delete text after CPP directives. 2001-01-16 02:50:27 +00:00
lukem e4099568d7 minor knf 2001-01-11 07:58:04 +00:00
lukem 7890e93e47 remove unnecessary ":" in openlog ident 2001-01-11 01:43:10 +00:00