Commit Graph

69 Commits

Author SHA1 Message Date
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
kamil bffacbd197 Stop defining _rpcsvcdirty in bss and data
_rpcsvcdirty is already defined in the generated code from rpcgen(1).

Detected during the build with Address Sanitizer (MKSANITIZER).
2019-08-15 08:34:19 +00:00
sevan 421949a31f ansify - drop the K&R style prototypes & implementations. 2018-01-23 21:06:24 +00:00
chs 6347f22e62 this file uses the <sys/queue.h> macros so it should include
that header itself, rather than relying on getting it indirectly
by including some other header (which will soon be changed
to not do that anymore).
2017-06-08 03:25:03 +00:00
dholland 666bec36a3 Fix another conditional with wrong (missing) parens. 2016-03-12 02:07:44 +00:00
dholland 5488f4aae3 Clean up gcc warnings. 2016-03-12 02:06:32 +00:00
dholland 48fa59d156 Remove trailing whitespace 2016-03-12 02:02:00 +00:00
dholland 49f907c597 Fix operator precedence in complex conditional by separating out the
assignment part. PR 50954 from David Binderman. While here, separate
out the assignment in all the other similar conditionals too.
2016-03-12 02:01:23 +00:00
wiz 2ea831cdd8 Fix typo in syslog message.
From Edgar Fuß in PR 46950.
2012-09-13 11:09:41 +00:00
wiz 5c9a0052ca Sync usage with manpage. End it with a newline. 2012-08-13 12:37:18 +00:00
wiz a0b9ae45e4 Sort options in SYNOPSIS. New sentence, new line. Improve descriptions.
Use more markup. Sort option descriptions. Add arguments to option descriptions.
Punctuation nits.
2012-08-13 12:37:05 +00:00
pgoyette f283cd004e Add -4 and -6 options to rpd.lockd for consistent control over the
protocols to which it listens.  As discussed on tech-userlevel.
2012-08-13 12:22:21 +00:00
tron dd5f61399d Fix broken IPv6 support. My Mac OS X Lion NFS client now happily
talks to my NetBSD 6.0_BETA2 NFS server over IPv6.
2012-06-18 20:30:32 +00:00
plunky 87d4f6076b Apply casts to cases where xdrproc_t is expected but is not
strictly passed, for example because the second argument is
a different kind of pointer.
2011-08-30 17:06:20 +00:00
christos 6b6eea3c51 allow comparing v2 and v3 filehandles. 2009-11-19 22:27:26 +00:00
bouyer 6d07b400dc Remove closes 3 & 4 from my licence. Lots of thanks to Soren Jacobsen
for the booring work !
2009-10-19 18:41:07 +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
christos 0c27a0cd54 fix dev_t format. 2008-12-29 03:38:26 +00:00
perry 8b0f9554ff convert __attribute__s to applicable cdefs.h macros 2007-12-15 19:44:37 +00:00
christos ceaa3a4f21 - pass lint (not completely)
- KNF
- ansify
- use %m instead of "%s, strerror(errno)" in syslog messages
2007-11-04 23:12:50 +00:00
tron e6cd63ecaf Fix off-by-one error accessing "clnt_cache_addr" array which causes heap
corruption. This will hopefully fix PR bin/37236.
2007-11-04 19:59:54 +00:00
christos 5f2b082001 PR/37236: Matthias Scheler: Mac OS X NFS client frequently crashes rpc.lockd(8)
on NetBSD. Use calloc to allocate the lock as suggested in the PR.
2007-10-27 18:41:54 +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
martin e06a3327c9 Typo 2006-08-09 14:12:47 +00:00
yamt a52757bf4c deal with variable sized file handles. 2006-08-08 13:10:05 +00:00
martin b4cb63a646 Make filehandles opaque to userland 2006-07-31 16:34:42 +00:00
martin a3b5baed42 Fix alignement problems for fhandle_t, exposed by gcc4.1.
While touching all vptofh/fhtovp functions, get rid of VFS_MAXFIDSIZ,
version the getfh(2) syscall and explicitly pass the size available in
the filehandle from userland.

Discussed on tech-kern, with lots of help from yamt (thanks!).
2006-07-13 12:00:24 +00:00
christos c4ee9f6d2e 64 bit inode changes 2005-08-19 02:07:18 +00:00
lukem 677504d9ca Test the correct pointer 'rfl' rather than an uninitialized 'fl' when
determining whether the lock was a LOCK_V4 or not.
Detected with gcc -Wuninitialized.
2005-06-02 09:30:27 +00:00
bouyer 7b066791c8 Remove references to University of California from my copyright notices. 2003-10-05 17:48:49 +00:00
bouyer d6242d4312 We can't keep a reference to the value returned by svc_getrpccaller().
Instead malloc() some memory and copy the sockaddr returned there.
Fix a bug where after a blocked lock gets granted, the grant message would
be sent to the wrong machine (or possibly to a completely bogus address).

While there, add a NULL check for the return value of another malloc().
2003-06-19 11:13:06 +00:00
yamt f9cc84c69d getlock: detect duplicated locks slightly correctly.
XXX how should we do for byte range lock?
2003-03-16 09:05:56 +00:00
yamt acc9d6c0f9 for lock/unlock requests, log svid as well as client name. 2003-03-16 06:55:47 +00:00
yamt 3f4a2b19c2 fix a typo in the previous. 2003-03-14 14:10:00 +00:00
yamt c5c265a7aa use strlcpy instead of strncpy. 2003-03-14 14:08:44 +00:00
yamt f947a8c4c1 use LIST_FOREACH macro. 2003-03-14 14:03:00 +00:00
yamt 44f53bece1 for fork'ed children, use _exit instead of exit. 2003-03-14 13:53:08 +00:00
yamt 3337a32246 - protect from pid reusing.
- fix a null dereference on the error.
2003-03-14 13:46:23 +00:00
simonb 276fd1665c The Double-Semi-Colon Police. 2003-01-20 05:29:53 +00:00
sommerfeld 8f6f405641 Use <bsd.rpc.mk> 2003-01-05 19:24:06 +00:00
fvdl d4f83aa2bb Use a non-blocking SVC for TCP connections. 2002-11-08 00:14:50 +00:00
wiz 5db23d2c5d enouth -> enough. 2002-07-26 01:00:39 +00:00
grant eda9e509bb sweep of errx/warnx, remove unnecessary trailing \n 2002-07-20 08:40:16 +00:00
wiz 4b20971f01 Spell acquire with a 'c'. 2002-07-10 23:16:32 +00:00
wiz 146392e159 Sort sections. 2002-02-02 01:42:45 +00:00
oster 4a785b3509 Fix a memory leak: when unlocking make sure we release the memory associated
with the lock begin removed!

Reviewed by thorpej.
2001-10-23 19:54:53 +00:00
wiz 0a600be867 receive, not recieve 2001-06-12 15:17:10 +00:00
wiz 14dbdf5518 Negative exit code cleanup: Replace exit(-x) with exit(x).
As seen on tech-userlevel.
2001-04-06 11:13:45 +00:00
enami 6bc7e18094 Don't try to deallocate an object pointed by NULL pointer. Instead,
deallocate the right one.
2000-11-21 03:47:41 +00:00
is d8302e2d73 More format string cleanups by sommerfeld. 2000-10-11 20:23:46 +00:00