Commit Graph

62 Commits

Author SHA1 Message Date
Doug Rabson
a9148abd9d Implement support for RPCSEC_GSS authentication to both the NFS client
and server. This replaces the RPC implementation of the NFS client and
server with the newer RPC implementation originally developed
(actually ported from the userland sunrpc code) to support the NFS
Lock Manager.  I have tested this code extensively and I believe it is
stable and that performance is at least equal to the legacy RPC
implementation.

The NFS code currently contains support for both the new RPC
implementation and the older legacy implementation inherited from the
original NFS codebase. The default is to use the new implementation -
add the NFS_LEGACYRPC option to fall back to the old code. When I
merge this support back to RELENG_7, I will probably change this so
that users have to 'opt in' to get the new code.

To use RPCSEC_GSS on either client or server, you must build a kernel
which includes the KGSSAPI option and the crypto device. On the
userland side, you must build at least a new libc, mountd, mount_nfs
and gssd. You must install new versions of /etc/rc.d/gssd and
/etc/rc.d/nfsd and add 'gssd_enable=YES' to /etc/rc.conf.

As long as gssd is running, you should be able to mount an NFS
filesystem from a server that requires RPCSEC_GSS authentication. The
mount itself can happen without any kerberos credentials but all
access to the filesystem will be denied unless the accessing user has
a valid ticket file in the standard place (/tmp/krb5cc_<uid>). There
is currently no support for situations where the ticket file is in a
different place, such as when the user logged in via SSH and has
delegated credentials from that login. This restriction is also
present in Solaris and Linux. In theory, we could improve this in
future, possibly using Brooks Davis' implementation of variant
symlinks.

Supporting RPCSEC_GSS on a server is nearly as simple. You must create
service creds for the server in the form 'nfs/<fqdn>@<REALM>' and
install them in /etc/krb5.keytab. The standard heimdal utility ktutil
makes this fairly easy. After the service creds have been created, you
can add a '-sec=krb5' option to /etc/exports and restart both mountd
and nfsd.

The only other difference an administrator should notice is that nfsd
doesn't fork to create service threads any more. In normal operation,
there will be two nfsd processes, one in userland waiting for TCP
connections and one in the kernel handling requests. The latter
process will create as many kthreads as required - these should be
visible via 'top -H'. The code has some support for varying the number
of service threads according to load but initially at least, nfsd uses
a fixed number of threads according to the value supplied to its '-n'
option.

Sponsored by:	Isilon Systems
MFC after:	1 month
2008-11-03 10:38:00 +00:00
Xin LI
487e86678e Previous revision was broken on SPARC, fix it by using more appropriate type.
Reported by:	tindebox
Pointy hat to:	delphij
2005-12-21 10:12:05 +00:00
Xin LI
6f229bd3ae Use size_t for length. 2005-12-21 02:25:59 +00:00
Robert Watson
3f7c86a8c3 Bump the default maximum on nfsd processes from 20 to 256. Real-world
measurements suggest that higher degrees of parallelism for large
numbers of clients help performance substantially.

Submitted by:	Eric Anderson <anderson at centtech dot com>
2005-01-23 21:34:00 +00:00
Ruslan Ermilov
a866e17077 Added the EXIT STATUS section where appropriate. 2005-01-17 07:44:44 +00:00
Xin LI
6f52836b84 ANSI'fy nfsd(8) and some minor changes to make it WARNS=6 clean.
This commit does not affect the code generated, as proven by md5'ing
resulting binaries.

Bump WARNS accordingly.

Compiled on:	sparc64, ia64, i386
Reviewed by:	alfred (but blame me if anything goes wrong :-)
2004-11-06 18:15:44 +00:00
Warner Losh
486c8cc4c6 Per letter dated July 22, 1999 remove 3rd clause of Berkeley derived software
(with permission of addtional copyright holders where appropriate)
2004-08-07 04:28:56 +00:00
Ruslan Ermilov
07bfccd71e Mechanically kill hard sentence breaks. 2004-07-02 23:13:00 +00:00
Simon L. B. Nielsen
e734927e56 Add a cross reference to exports(5). While exports is not directly
tied to nfsd(8), exports is the configuration file users will most
likely need to configure when dealing with a NFS server.

Submitted by:	Florian Hars <hars@bik-gmbh.de>
PR:		docs/64714
MFC after:	3 days
2004-03-30 20:43:07 +00:00
Robert Watson
0be1e825d6 Problem:
When an NFS server is port-scanned nfsd sometimes exits. This has
  happened 3 times the last few weeks.

  Nfsd has been written to exit when accept(2) fails. Unfortunately
  accept can sometimes make a "normal" return with errno ECONNABORTED
  and in this case nfsd exits prematurely.

Solution:

  Check for ECONNABORTED (and also EINTR, since nfsd uses signals)
  and continue.

Submitted by:	Bjoern Groenvall <bg@sics.se>
PR:		61084
2004-01-11 01:29:03 +00:00
David E. O'Brien
052238b16c style.Makefile(5) 2003-04-04 17:49:21 +00:00
Maxime Henrion
34053f6ffb Update manpage to match the code, vfsload() is not used
here since some time, kldload() is used instead.
2002-08-11 15:19:49 +00:00
Peter Wemm
b8815b31fb Bah, I forgot to commit this part of the nfssvc() cleanup. Sorry folks. 2002-07-25 06:18:22 +00:00
Hajimu UMEMOTO
fc99a00c7f use IPV6_V6ONLY instead of non standard IPV6_BINDV6ONLY.
MFC after:	1 week
2002-07-22 15:22:53 +00:00
Alexander Kabaev
4cc03f63d1 Initialize sockbits variable with FD_ZERO, to avoid passing a fd_set
with random garbage in lower bits corresponding to stdin, stdout and
stderr to select(2).

This fixes the problem with nfsd sometimes getting stuck in a tight
select(2) loop eating 100% CPU time.

Reviewed by:	iedowse
Approved by:	obrien
2002-07-22 14:01:44 +00:00
Philippe Charnier
e1205e80e5 The .Nm utility 2002-07-06 19:34:18 +00:00
Gordon Tetlow
3600cbb7c4 Fix spelling nit in error message. 2002-06-05 01:06:33 +00:00
Peter Wemm
37436e4075 Make this compile and not segfault on ia64. ptr = strdup("foo"); is
fatal if the declaration of strdup() isn't in scope.  The upper 32 bits
of the pointer are lost since it defaults to returning "int".  Fix some
warnings while here, including trying to make gcc-3.1 happy.
2002-05-01 06:49:43 +00:00
Pierre Beyssac
85554bf8ff Fix problem in macro definition breaking compiles with -DDEBUG.
PR:		bin/35773
Submitted by:	Thomas Quinot <thomas@cuivre.fr.eu.org>
2002-03-26 17:37:59 +00:00
David E. O'Brien
2d68bf45bf Default to WARNS=2.
Binary builds that cannot handle this must explicitly set WARNS=0.

Reviewed by:	mike
2001-12-04 02:19:58 +00:00
Ian Dowse
fef7dd5a5f When nfsd was started with only UDP servers, the master nfsd would
spin in a loop eating CPU time. This bug has existed since the
TI-RPC import. The problem is that we should only enter the select
loop if at least one TCP server was started.  Fix this by having
the master nfsd become a UDP server itself if there are no TCP
servers.

Also improve/correct the code for cleaning up slave nfsd processes
and unregistering with rpcbind when the master nfsd exits.

One issue that remains open is that if a slave nfsd dies, then all
nfsds will shut down. This is because nfssvc() in the master nfsd
returns 0 when the master nfsd receives a SIGCHLD.

Submitted by:	tmm
2001-10-16 21:55:53 +00:00
Peter Wemm
12f8604fde Deal with nfs server module changes for autoloading. 2001-09-20 02:18:06 +00:00
Peter Wemm
9119623471 Userland part of nfs client/server split and cleanup. 2001-09-18 23:34:44 +00:00
Ruslan Ermilov
d628d776c4 mdoc(7) police: utilize the new .Ex macro. 2001-08-15 09:09:47 +00:00
Dima Dorfman
7ebcc426ef Remove whitespace at EOL. 2001-07-15 07:53:42 +00:00
Ruslan Ermilov
5521ff5a4d mdoc(7) police: sort SEE ALSO xrefs (sort -b -f +2 -3 +1 -2). 2001-07-06 16:46:48 +00:00
Ruslan Ermilov
0a5779d45b - Backout botched attempt to introduce MANSECT feature.
- MAN[1-9] -> MAN.
2001-03-26 14:33:27 +00:00
Alfred Perlstein
e0a509bb08 Don't call daemon() and setup our signal handlers until after we check
and do the unregister/reregister work.

Don't call syslog in the unregister/reregister code as we haven't called
openlog() yet.

Be a more conservative about accepting errno values from socket(2),
only EPROTONOSUPPORT means that the kernel isn't supporting it
something like INET6.  The other possible errnos would be returned
if there was a mistake in the socket(2) call so remove them from the
list of "acceptable" return values.
2001-03-25 23:32:55 +00:00
Alfred Perlstein
69444aa31b Disable ipv6 when getnetconfigent("udp6"/"tcp6") fails.
Submitted by: Martin Blapp <mb@imp.ch>
2001-03-25 23:28:03 +00:00
Ruslan Ermilov
fe655281c5 Set the default manual section for sbin/ to 8. 2001-03-20 18:13:31 +00:00
Ruslan Ermilov
a24add3fb3 mdoc(7) police: fixes to the previous revision:
- fixed bad formatting
- avoid using German
- removed hard sentence break
2001-03-20 10:57:25 +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
Ruslan Ermilov
7c7fb079b9 mdoc(7) police: use the new features of the Nm macro. 2000-11-20 16:52:27 +00:00
Brian Somers
433add6ff5 Don't use libutil now that setproctitle() is in libc 2000-09-02 20:52:15 +00:00
Sheldon Hearn
ef8f7ac935 Remove single-space hard sentence breaks. These degrade the quality
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.
2000-03-01 11:27:47 +00:00
Mark Murray
f499a39621 Use libcrypto instead of libdes. 2000-02-24 21:01:54 +00:00
Matthew Dillon
2a2d4405a2 Thresh-out the nfs manual page references a bit
Reviewed by: Julian Elischer <julian@elischer.org>
2000-01-13 21:47:21 +00:00
Matthew Dillon
92fc2acf51 Give nfsd the ability to bind to specific IP addresses through the -h
option and add explicit option to bind to the wildcard address.  The
    default is to bind to the wildcard address when no -h option has been
    specified and thus backwards compatibility is maintained.

PR:		kern/13049
Reviewed by:	David Malone <dwmalone@maths.tcd.ie>
Submitted by:	Matt Dillon <dillon@freebsd.org>, David Malone <dwmalone@maths.tcd.ie>
1999-11-11 17:35:36 +00:00
Peter Wemm
7f3dea244c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
Nik Clayton
1ba1d54c41 Add $Id$ to these manpages.
Approved by:            bde
1999-07-12 20:04:59 +00:00
Guy Helmer
62fb100205 Update refs for KLD's and kldload.
Submitted by:	Nathan Ahlstrom <nrahlstr@winternet.com>
1999-04-01 01:42:28 +00:00
Philippe Charnier
9b4d716bbb Do not dot terminate syslog() string. Remove unused #includes. Add rcsid. -Wall. 1998-07-15 06:33:15 +00:00
Peter Wemm
732aba2af7 Don't give examples or use the depreciated usage to nfsd
PR: 5635
1998-05-01 13:45:04 +00:00
Bruce Evans
87f01287d2 Removed definition of _NEW_VFSCONF. The new vfsconf interface is now
the default.
1998-01-20 10:40:18 +00:00
John Polstra
3e83b874e1 Fix two missing arguments detected by "-Wformat". 1997-11-18 03:14:53 +00:00
Warner Losh
8d64695c7c compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
1997-03-29 03:33:12 +00:00
Peter Wemm
08966bd5fd Merge from Lite2 (use new getvfsbyname() interface) 1997-03-11 12:51:00 +00:00
Mike Pritchard
c0b0bcf4d3 Use the .Bx macro where appropriate. 1996-08-23 20:36:11 +00:00
Bruce Evans
52efa6c17d Default to udp if neither udp nor tcp is specified. The previous revision
was broken.  It forced udp in all cases except the extremely unusual case
argc == 0.
1996-05-01 03:13:45 +00:00
Marc G. Fournier
1e3a3c5e71 default to udp if no flags specified...closes PR#bin/759
- should this be documented in the man page?
1996-04-13 06:08:24 +00:00