1 .\" $NetBSD: nfssvc.2,v 1.24 2009/03/10 21:00:47 joerg Exp $
3 .\" Copyright (c) 1989, 1991, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" @(#)nfssvc.2 8.1 (Berkeley) 6/9/93
44 .Fn nfssvc "int flags" "void *argstructp"
48 function is used by the NFS daemons to pass information into and out
49 of the kernel and also to enter the kernel as a server daemon.
52 argument consists of several bits that show what action is to be taken
53 once in the kernel and the
55 points to one of three structures depending on which bits are set in
57 .Ss Calls used by Xr nfsd 8
60 is called with the flag
65 struct nfsd *nsd_nfsd; /* Pointer to in kernel nfsd struct */
66 uid_t nsd_uid; /* Effective uid mapped to cred */
67 u_long nsd_haddr; /* Ip address of client */
68 struct ucred nsd_cr; /* Cred. uid maps to */
69 int nsd_authlen; /* Length of auth string (ret) */
70 char *nsd_authstr; /* Auth string (ret) */
74 to enter the kernel as an
79 daemon receives a Kerberos authentication ticket, it will return from
85 will attempt to authenticate the ticket and generate a set of credentials
88 specified in the field nsd_uid.
89 This is done by first authenticating the Kerberos ticket and then mapping
90 the Kerberos principal to a local name and getting a set of credentials for
103 flags set to pass the credential mapping in nsd_cr into the
104 kernel to be cached on the server socket for that client.
105 If the authentication failed,
112 .Dv NFSSVC_AUTHINFAIL
113 to denote an authentication failure.
124 int sock; /* Socket to serve */
125 caddr_t name; /* Client address for connection based sockets */
126 int namelen; /* Length of name */
130 to pass a server side
132 socket into the kernel for servicing by the
135 .Ss Calls used by Xr mountd 8
141 .Dv NFSSVC_SETEXPORTSLIST
143 .Ft struct mountd_exports_list
144 object to atomically change the exports lists of a specific file system.
145 This structure has the following fields:
146 .Bl -tag -width ".Vt const char *mel_path"
147 .It Vt const char *mel_path
148 Path to the file system that will have its exports list replaced by the
149 one described in the other fields.
150 .It Vt size_t mel_nexports
151 Number of valid entries in the
154 If zero, the exports list will be cleared for the given file system.
155 .It Vt struct export_args mel_export[AF_MAX]
156 Set of exports to be used for the given file system.
161 does not return unless the server
162 is terminated by a signal when a value of 0 is returned.
163 Otherwise, \-1 is returned and the global variable
165 is set to specify the error.
169 This special error value is really used for authentication support,
170 particularly Kerberos, as explained above.
172 The caller is not the super-user.
180 function first appeared in
185 system call is designed specifically for the
187 support daemons and as such is specific to their requirements.
188 It should really return values to indicate the need for authentication
191 is not really an error.
192 Several fields of the argument structures are assumed to be valid and
193 sometimes to be unchanged from a previous call, such that
195 must be used with extreme care.