Commit Graph

26 Commits

Author SHA1 Message Date
delphij
81f3df5d47 Use prototype. 2014-01-04 01:08:10 +00:00
delphij
884daaab74 Fix build:
- Use %ll instead of %q for explicit long long casts;
 - Use %j instead of %q in XFS and cast to intmax_t.

Tested with:	make universe
2012-05-23 06:49:50 +00:00
uqs
415a3a9b96 Spelling fixes for usr.sbin/ 2011-12-30 10:58:14 +00:00
rmacklem
e7d319e53e Fix the include path for nfs_lock.h.
MFC after:	2 weeks
2010-07-24 22:16:14 +00:00
dfr
ec9ddec04c Don't use sys/nfs/rpcv2.h - it is part of the old kernel RPC implementation
and will be removed.
2009-06-24 18:42:21 +00:00
maxim
94f32e8aed o Style previous. 2006-08-17 05:55:20 +00:00
thomas
99c9166015 Use setproctitle(3) to provide identification of the client and server
processes created by rpc.lockd.

MFC after:	1 week
2006-08-16 18:33:35 +00:00
rodrigc
af2f8fd25c Move call to ignore SIGPIPE signals before calling fork(),
so that both parent and child processes ignore this signal.

PR:             bin/97768
Submitted by:   Gea-Suan Lin <gslin at csie dot nctu dot edu dot tw>
MFC after:      3 days
2006-05-27 02:37:37 +00:00
rodrigc
1e9b50e704 Ignore SIGPIPE signals on write() failures.
We already check for write() failures and handle EPIPE.
Failure to handle SIGPIPE was resulting in rpc.lockd terminating.

PR:		bin/97768
Reported by:	Gea-Suan Lin <gslin at csie dot nctu dot edu dot tw>
MFC after:	1 day
2006-05-25 22:12:05 +00:00
harti
1e3942d92f When a user is in more than 16 groups the call to authunix_create() will
result in abort() beeing called. This is because there is a limit of
the number of groups in the RPC which is 16. When the actual number of
groups is too large it results in xdr_array() returning an error which,
in turn, authunix_create() handles by just calling abort().

Fix this by passing only the first 16 groups to authunix_create().
2005-11-17 12:19:19 +00:00
charnier
80a7e91a6f Add FBSDID. Add missing prototypes. Remove unused variables. Give variable
an initial value to silent compiler.
2005-05-20 13:01:47 +00:00
cognet
e71ce99b94 Consumers of nfslockdans() seems to think it should return 0 on success, so
make it so.
2005-03-16 23:55:48 +00:00
phk
797ee56603 Userland change corresponding to the change in kernel/userland communication
for NFS locking.
2004-12-06 08:32:09 +00:00
peter
edafc1a965 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
rwatson
ac48fcc177 When getting back an NLM DENIED response for a requested lock from the
server, map it to EAGAIN locally rather than EACCES.  The NLM spec
indicates the DENIED corresponds to lock contention, not a permission
failure.  This fixes O_EXLOCK/O_SHLOCK with O_NONBLOCK, which would
previously give a permission error, which in turn fixes things
like mailq(8) and lockf(1) over NFS.

Approved by:	scottl (re)
Reviewed by:	truckman, Andrew P Lentvorski, Jr. <bsder@allcaps.org>
Idea from:	truckman
2003-05-15 03:19:30 +00:00
alfred
6d7e27aceb Remove a case of exposing 'struct ucred' to userspace. Use a struct xucred
for LOCKD_MSG instead.

Requested by: rwatson
2002-08-15 21:52:22 +00:00
alfred
df766765ba Add IPv6 support.
Submitted by: Jean-Luc Richier <Jean-Luc.Richier@imag.fr>
2002-07-15 19:40:23 +00:00
alfred
24f78bbde0 Fixup for WARNS. 2001-11-12 16:29:45 +00:00
alfred
7d1e070d0f Drop privs while servicing kernel lock requests.
Restore umask used before FIFO creation.
If opening the FIFO fails, exit.
Properly check the return value of open (use == -1 instead of < 0).
2001-11-11 23:40:10 +00:00
alfred
bf67173885 leverage fixed fifo implementation (rev 1.56 of
src/sys/fs/fifofs/fifo_vnops.c) to serve locks better, my previous
workaround for lack of decent fifo system wasn't cutting it,
particularly the kernel would send a message down the fifo and
immediately close it, this would lead to delayed unlock requests
being seen by the lockd causing all sorts of badness.

Basically, don't reopen the fifo, just select(2) on it.
2001-11-08 10:37:32 +00:00
alfred
318979eef2 use syslog rather than printf so we can see what's going on in debug mode 2001-11-08 10:34:21 +00:00
alfred
5464293209 style fixes, fix line wrap and function declaration 2001-11-08 10:33:41 +00:00
peter
68a5e33921 Userland part of nfs client/server split and cleanup. 2001-09-18 23:34:44 +00:00
alfred
026a60d792 Fix compiling without -O, some dead code was using non-existant functions,
make the code not automatically dead but actually use the debug level
in order to determine if output is needed.  Fix non-existant from_addr()
by #define'ing it to inet_ntoa().

Remove hardcoded -g from Makefile.

Reported by: "John W. De Boskey" <jwd@bsdwins.com>
Tested by: "John W. De Boskey" <jwd@bsdwins.com>
2001-04-25 18:40:38 +00:00
alfred
9b2d5fc044 remove debug code left in by accident 2001-04-18 21:41:27 +00:00
alfred
f0669d6c9e 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