Commit Graph

102 Commits

Author SHA1 Message Date
lukem c4b7a9e794 bsd.own.mk: rename GCC_NO_* to CC_WNO_*
Rename compiler-warning-disable variables from
	GCC_NO_warning
to
	CC_WNO_warning
where warning is the full warning name as used by the compiler.

GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
2023-06-03 09:09:01 +00:00
nia 25b32e0991 rpcbind(8): restore previous behaviour. Wait instead of breaking from
the loop if svc_fdset_getmax fails.

thanks rin.
2021-10-30 11:41:45 +00:00
nia 43d0286d06 rpcbind(8): Use reallocarr, fix reallocation logic.
In my_svc_run(), only update the fd count _after_ the allocation
succeeds (which may be after waiting in the loop). This function
previously tried to go to a label that doesn't exist. I wonder why
GCC didn't catch this before but does now.
2021-10-30 11:04:48 +00:00
mrg 6274000239 avoid potential uninitialised variable use. 2021-04-13 05:58:45 +00:00
christos f525b84e77 - Enable WARMSTART
- Pass fd to libwrap
- Add blocklist
From Greg A. Woods

- Tidy up debugging
2021-03-07 00:23:06 +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
mrg de11d87641 introduce some common variables for use in GCC warning disables:
GCC_NO_FORMAT_TRUNCATION    -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION  -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW    -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE   -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints.  many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
2019-10-13 07:28:04 +00:00
christos 159a288f78 Don't pass an uinitialized pm_prot to rpcinfo. It expects 0 for local,
so give it 0.
2019-05-13 14:29:41 +00:00
roy 4a48321724 Fix building rpcbind with MKYP=no
We add enough of the YP headers to security.c so the security checks
can remain as is.
2019-04-24 10:27:49 +00:00
christos a964285a66 - fix wrong size allocation that triggers buffer overflow
- remove unneeded casts and assertions
XXX: pullup-8
2019-01-23 20:46:18 +00:00
christos 5794a3e6bf check strdup results too
include the function name in out of memory messages
2019-01-03 19:26:50 +00:00
christos 05d4f66d89 Handle memory allocations and error exit codes consistently. 2019-01-03 19:04:21 +00:00
christos b766bbedd5 don't lock for RUMP 2017-08-21 17:01:04 +00:00
christos 39c7ca3b3a fix path to the warmstart file. 2017-08-17 07:45:24 +00:00
ginsbach b683e9a94a Fix compile warnings.
(Restore changes clobbered by merge of FreeBSD changes. Hi christos!)
2017-08-17 00:08:10 +00:00
ginsbach 16400a904e Revert accidently committed enabling WARMSTART. 2017-08-17 00:06:00 +00:00
ginsbach 5f912a847a Write the "warm start" file to /var/run rather than /tmp.
(Restore changes clobbered by merge of FreeBSD changes. Hi christos!)
2017-08-16 23:38:16 +00:00
wiz 8b8f265dcd Use today's date. Sort options. Remove superfluous Tn macro. Wording improvement. 2017-08-16 18:23:03 +00:00
christos 6f43c19b6f fix typo, date, document -L 2017-08-16 14:22:58 +00:00
christos 34b7ffd922 merge FreeBSD changes:
- fixes CVE-2015-7236
- adds -h hostip to bind, -6 for only ipv6 access, -a for abort gracefully
- documents -w (warmstart)
XXX: should fix warmstart file to go to /var/run instead of /tmp
2017-08-16 08:44:40 +00:00
ginsbach 19bce2a53d Fix compile warnings. 2017-08-06 01:55:21 +00:00
ginsbach 17894e71a8 Write the "warm start" file to /var/run rather than /tmp. 2017-08-06 01:02:44 +00:00
christos 0b0b181ad5 Limit size of buffer:
https://github.com/guidovranken/rpcbomb/blob/master/rpcbind_patch.txt
XXX: pullup-7
2017-05-03 21:28:00 +00:00
christos a21a8a4ef3 CID 1338514: Check NULL returns 2015-11-10 18:04:51 +00:00
christos 1e8cf51077 merge RUMP changes. 2015-11-08 16:36:28 +00:00
christos f4ad1a1253 use EXIT_SUCCESS/EXIT_FAILURE consistently. 2015-05-09 21:22:18 +00:00
dholland d4f9fa9c7c perror -> warn 2015-05-09 18:32:04 +00:00
dholland c0ca3685e5 check setrlimit too 2015-05-09 18:22:37 +00:00
christos 7a74e96fe5 CID 1009289: Check getrlimit 2015-05-09 13:10:50 +00:00
christos e3f5a174fd CID 1018907: Freeifaddrs 2015-03-11 15:57:12 +00:00
christos 0a77b69ab6 fix unused variable warnings. 2013-10-19 17:16:37 +00:00
christos 94a96ec4ae use new scopeid functions 2013-10-19 17:16:25 +00:00
plunky 9f61b80465 NULL does not need a cast 2011-08-31 16:24:54 +00:00
joerg bec77c5f43 Use __dead 2011-08-31 13:32:36 +00:00
pooka 8a0861f462 remove unnecessary superuser check -- bind will fail if bind fails 2011-03-14 12:03:45 +00:00
lukem d877c4c3c0 Enable WARNS=4 by default, except for:
cpuctl  dumplfs  hprop  ipf  iprop-log  kadmin  kcm  kdc  kdigest
	kimpersonate  kstash  ktutil  makefs  ndbootd  ntp  pppd  quot
	racoon  racoonctl  rtadvd  sntp  sup  tcpdchk  tcpdmatch  tcpdump
	traceroute  traceroute6  user  veriexecgen  wsmoused  zic
(Mostly third-party applications)
2009-04-22 15:23:01 +00:00
joerg afe5a26320 Fix preamble 2009-03-11 13:59:33 +00:00
lukem 3cafe960ea fix -Wsign-compare issues 2009-01-18 10:10:47 +00:00
snj cf5b9ad4fa Xref netconfig(5). Requested by Martin S. Weber in PR bin/39605. 2008-10-19 21:18:22 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
christos 019362ec2a - unlink the warmstart file first and then open it exclusively.
(From Brian Ginsbach)
- ifdef the whole file #ifdef WARMSTART to save space.
2007-10-12 21:24:01 +00:00
dsl b504fee486 Depracate ND_DEBUG and BIND_DEBUG in favour of RPCBIND_DEBUG.
Add commented out entries for RPCBIND_DEBUG and SVC_RUN_DEBUG in Makefile.
2007-08-27 19:53:32 +00:00
dsl 3d3a92a528 This code has been broken for ~ 20 years!
Initialise the 'fromlen' parameter for recvfrom() prior to the call, instead
of passing in a 'random' value off the stack.
This should fix the problems with ypbind on current.
I suspect the old kernel was not objecting to -ve buffer lengths.
2007-08-27 19:51:50 +00:00
christos 2219d66ee7 PR/36440: Martin Husemann: rpcbind complains about non-errors.
Don't complain about EAFNOSUPPORT.
2007-06-04 18:00:51 +00:00
tls 36a21907e2 Since Christos cleaned up the use of libc internals here, we can switch
these from USE_SSP to USE_FORT as they should be.
2007-05-28 18:12:06 +00:00
christos 599840187d get rid of libc cruft. requested by tls 2007-05-28 14:49:15 +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
christos 724513abed deal with namespace pollution caused by tcpd. 2007-05-16 14:42:07 +00:00
christos 5b9bddf888 PR/36319: Michael van Elst: rpcinfo -p requires root privileges
Explicitly chmod 777 the local socket.
2007-05-13 21:19:56 +00:00
christos de327a0164 - WARNS = 4
- De __P
- While starting up, send messages to stderr not syslog.
- Fix error messages
- Don't play with umask and forget to restore it on error
2007-05-13 20:03:46 +00:00