History log of /freebsd-10.1-release/usr.sbin/rpc.lockd/lock_proc.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 272461 02-Oct-2014 gjb

Copy stable/10@r272459 to releng/10.1 as part of
the 10.1-RELEASE process.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 141217 03-Feb-2005 kuriyama

- 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


# 136320 09-Oct-2004 stefanf

Include <unistd.h> for {g,s}eteuid().


# 132262 16-Jul-2004 mr

Forced commit to actually list the changes of bin/61718, as requested by sam.

The attached patch fixes a number of problems present in rpc.lockd.

1)

Nfslocklist_head.lf_first is overwritten because of an off-by-one-bug
that happens when clnt_cache_next_to_use is incorrectly incremented.

2)

'struct sockaddr *addr' inside 'struct file_lock' is set to point to
the result from svc_getrpccaller(). This value is malloc:ed inside the
rpc libraries and is free:ed when clnt_destroy() is called. Fix,
maintain a copy of the result.

3)

The loop inside retry_blockingfilelocklist() that uses 3 pointers ifl,
nfl, and pfl thrashes the list pointed to by
blockedlocklist_head.lf_first. Fix, use a simpler loop. The new loop
does not preserve list order but the order is immaterial anyways. See
also revison 1.6-1.7 and kern/61122.

4)

struct file_lock
char client_name[SM_MAXSTRLEN];

and

struct host
char name[SM_MAXSTRLEN];

Be careful to not create open (non 0 terminated) C strings and later
passing them to e.g syslog. Fix, make sure that the strings are always
terminated with 0. When at it, move the strings to the end of the
structs and make them variable length. This saves about 1000 bytes for
every malloc:ed struct.

5)

The newfl = malloc(sizeof(struct file_lock)) memory was never properly
bzero:ed.

Minor changes:

A)

Nlmtonlm4(0) made assumptions about struct layouts.

B)

Don't close stdout and stderr when debugging (-d option).

C)

Remove unused pid_t locker and int fd in struct file_lock.

D)

s/printf/debuglog/

E)

Remove redundant sleep(1) and call to debuglog().

Cheers,
Björn


# 132254 16-Jul-2004 mr

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


# 126607 04-Mar-2004 roam

Forced commit to note that last commit was...

Approved by: silence on -audit


# 126606 04-Mar-2004 roam

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


# 121558 26-Oct-2003 peter

Make this compile cleanly. It passes WARNS=2, but I haven't checked
it is so on more platforms.


# 114993 14-May-2003 rwatson

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>


# 92977 22-Mar-2002 alfred

Const fix.


# 92969 22-Mar-2002 alfred

constify log_from_addr() parameter.


# 92911 21-Mar-2002 alfred

Bring code to WARNS=3 level. Mostly fix unused variables.


# 92909 21-Mar-2002 alfred

Remove __P.


# 86319 13-Nov-2001 alfred

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.


# 86300 12-Nov-2001 alfred

fix parameters to lock_answer().

Submitted by: Timo Geusch <freebsd@unix-consult.com>


# 84923 14-Oct-2001 alfred

Implement partial-file NFS lock testing.

Submitted by: "Andrew P. Lentvorski" <andrewl@io.com>


# 76093 28-Apr-2001 alfred

Distinguish between rpc version numbers in the client cache to avoid
replying on the wrong port.


# 75631 17-Apr-2001 alfred

Implement client side NFS locks.

Obtained from: BSD/os
Import Ok'd by: mckusick, jkh, motd on builder.freebsd.org


# 74462 19-Mar-2001 alfred

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