Commit graph

21 commits

Author SHA1 Message Date
John Baldwin 3b887005b4 rpc.lockd: Explicitly cast enum nlm_stats values to enum nlm4_stats.
NLM 4 status values are a superset of the older NLM protocol so these
casts are safe while pacifying -Wenum-conversion warnings from GCC.

Reviewed by:	rmacklem
Differential Revision:	https://reviews.freebsd.org/D36816
2022-10-03 16:10:42 -07:00
Pedro F. Giffuni df57947f08 spdx: initial adoption of licensing ID tags.
The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.

Initially, only tag files that use BSD 4-Clause "Original" license.

RelNotes:	yes
Differential Revision:	https://reviews.freebsd.org/D13133
2017-11-18 14:26:50 +00:00
Xin LI df9abd97ac Check return value of seteuid() and bail out if we fail.
MFC after:	2 weeks
2017-06-19 07:02:52 +00:00
Don Lewis b6ecea3082 Actually use the loop interation limit so carefully computed on the
previous line to prevent buffer overflow.  This turns out to not be
important because the upstream xdr code already capped the object
size at the proper value.  Using the correct limit here looks a lot
less scary and should please Coverity.

Reported by:	Coverity
CID:		1199309, 1199310
MFC after:	1 week
2016-05-16 23:00:48 +00:00
Xin LI 29df5733c2 Use prototype. 2014-01-04 01:08:10 +00:00
Jun Kuriyama 2d914e9670 - Use svc_getrpccaller() rather than svc_getcaller() for using
xt_rtaddr member of SVCXPRT structure.  This allows to use IPv6
  address stored in "struct sockaddr_storage" in "struct netbuf".
- Output the reason of getnameinfo() error.

Reviewed by:	alfred
2005-02-03 22:21:19 +00:00
Stefan Farfeleder fbdef8fb8f Include <unistd.h> for {g,s}eteuid(). 2004-10-09 15:36:13 +00:00
Michael Reifenberger 3d81d1ad2e After talking to Colin,
apply the patch of bin/61718 (which should include/elimatate kern/61122 also).
It seems to fix a few annoying bugs.

PR:		bin/61718, kern/61122
Submitted by:	bg@sics.se ohartman@mail.physik.uni-mainz.de
2004-07-16 12:50:10 +00:00
Peter Pentchev c0f7cd1a2a Make rpc.lockd bind to a reserved port, since there are NFS clients
which ignore NLM requests not coming from a reserved port.

PR:		56500
Submitted by:	Jonathan Lennox <lennox@cs.columbia.edu>
MFC after:	1 week
2004-03-04 15:52:28 +00:00
Peter Wemm 75e40e4604 Make this compile cleanly. It passes WARNS=2, but I haven't checked
it is so on more platforms.
2003-10-26 06:10:44 +00:00
Robert Watson 1870b993d0 When receiving NLM_GRANTED_RES or NLM4_GRANTED_RES lock granted messages
from the NFS server, following contention on a lock by this or another
client, immediately notify the waiting process that the lock has been
granted via a wakeup.  Without this change, the client rpc.lockd will
not wakeup the waiting process until it next re-polls the lock (sometime
in the next ten seconds), which can lead to marked latency across all
potential lockers, as the lock is held by the client for the duration.

Approved by:	re (scottl)
Submitted by:	truckman
Reviewed by:	Andrew P. Lentvorski, Jr <bsder@allcaps.org>
2003-05-14 13:50:40 +00:00
Alfred Perlstein 7bb4bf8526 Const fix. 2002-03-22 20:00:10 +00:00
Alfred Perlstein efddf1388d constify log_from_addr() parameter. 2002-03-22 19:20:35 +00:00
Alfred Perlstein c4bc47ba6a Bring code to WARNS=3 level. Mostly fix unused variables. 2002-03-21 23:05:13 +00:00
Alfred Perlstein 33314abe2c Remove __P. 2002-03-21 22:52:45 +00:00
Alfred Perlstein 2663693cf8 Turn on NO_WERROR and set WARNS to 1.
Fix the WARNS 1 warnings except unused variables.

Add prototype for log_netobj().
Don't compare signed/unsigned.
Cast u_int64_t to 'unsigned long long' and print using %llu.
Fix constness of string arrays.
Use a cast to avoid an unused parameter in a signal handler.
alarm(2) can't fail, so don't check for it.
ANSI'ify some functions.
2001-11-13 11:24:23 +00:00
Alfred Perlstein a95a0d36d4 fix parameters to lock_answer().
Submitted by: Timo Geusch <freebsd@unix-consult.com>
2001-11-12 16:34:59 +00:00
Alfred Perlstein bad584e319 Implement partial-file NFS lock testing.
Submitted by: "Andrew P. Lentvorski" <andrewl@io.com>
2001-10-14 18:36:35 +00:00
Alfred Perlstein c20e578f5a Distinguish between rpc version numbers in the client cache to avoid
replying on the wrong port.
2001-04-28 04:26:32 +00:00
Alfred Perlstein 603c86672c Implement client side NFS locks.
Obtained from: BSD/os
Import Ok'd by: mckusick, jkh, motd on builder.freebsd.org
2001-04-17 20:45:23 +00:00
Alfred Perlstein 8360efbd6c Bring in a hybrid of SunSoft's transport-independent RPC (TI-RPC) and
associated changes that had to happen to make this possible as well as
bugs fixed along the way.

  Bring in required TLI library routines to support this.

  Since we don't support TLI we've essentially copied what NetBSD
  has done, adding a thin layer to emulate direct the TLI calls
  into BSD socket calls.

  This is mostly from Sun's tirpc release that was made in 1994,
  however some fixes were backported from the 1999 release (supposedly
  only made available after this porting effort was underway).

  The submitter has agreed to continue on and bring us up to the
  1999 release.

  Several key features are introduced with this update:
    Client calls are thread safe. (1999 code has server side thread
    safe)
    Updated, a more modern interface.

  Many userland updates were done to bring the code up to par with
  the recent RPC API.

  There is an update to the pthreads library, a function
  pthread_main_np() was added to emulate a function of Sun's threads
  library.

  While we're at it, bring in NetBSD's lockd, it's been far too
  long of a wait.

  New rpcbind(8) replaces portmap(8) (supporting communication over
  an authenticated Unix-domain socket, and by default only allowing
  set and unset requests over that channel). It's much more secure
  than the old portmapper.

  Umount(8), mountd(8), mount_nfs(8), nfsd(8) have also been upgraded
  to support TI-RPC and to support IPV6.

  Umount(8) is also fixed to unmount pathnames longer than 80 chars,
  which are currently truncated by the Kernel statfs structure.

Submitted by: Martin Blapp <mb@imp.ch>
Manpage review: ru
Secure RPC implemented by: wpaul
2001-03-19 12:50:13 +00:00