1 .\" Copyright (c) 1989, 1991, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. Neither the name of the University nor the names of its contributors
13 .\" may be used to endorse or promote products derived from this software
14 .\" without specific prior written permission.
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" @(#)nfssvc.2 8.1 (Berkeley) 6/9/93
29 .\" $FreeBSD: src/lib/libc/sys/nfssvc.2,v 1.8.2.6 2002/12/29 16:35:34 schweikh Exp $
47 .Fn nfssvc "int flags" "void *argstructp"
51 function is used by the NFS daemons to pass information into and out
52 of the kernel and also to enter the kernel as a server daemon.
55 argument consists of several bits that show what action is to be taken
56 once in the kernel and the
58 points to one of three structures depending on which bits are set in
73 to enter the kernel as a block I/O server daemon.
81 flag, optionally or'd with the flags
85 along with a pointer to a
88 char *ncd_dirp; /* Mount dir path */
89 uid_t ncd_authuid; /* Effective uid */
90 int ncd_authtype; /* Type of authenticator */
91 int ncd_authlen; /* Length of authenticator string */
92 u_char *ncd_authstr; /* Authenticator string */
93 int ncd_verflen; /* and the verifier */
95 NFSKERBKEY_T ncd_key; /* Session key */
100 The initial call has only the
102 flag set to specify service for the mount point.
103 If the mount point is using Kerberos, then the
105 daemon will return from
111 whenever the client side requires an ``rcmd''
112 authentication ticket for the user.
114 will attempt to get the Kerberos ticket, and if successful will call
120 after filling the ticket into the
123 setting the ncd_authlen and ncd_authtype
124 fields of the nfsd_cargs structure.
127 failed to get the ticket,
129 will be called with the flags
133 .Dv NFSSVC_AUTHINFAIL
134 to denote a failed authentication attempt.
138 is called with the flag
142 struct nfsd_srvargs {
143 struct nfsd *nsd_nfsd; /* Pointer to in kernel nfsd struct */
144 uid_t nsd_uid; /* Effective uid mapped to cred */
145 u_int32_t nsd_haddr; /* Ip address of client */
146 struct ucred nsd_cr; /* Cred. uid maps to */
147 int nsd_authlen; /* Length of auth string (ret) */
148 u_char *nsd_authstr; /* Auth string (ret) */
149 int nsd_verflen; /* and the verifier */
151 struct timeval nsd_timestamp; /* timestamp from verifier */
152 u_int32_t nsd_ttl; /* credential ttl (sec) */
153 NFSKERBKEY_T nsd_key; /* Session key */
157 to enter the kernel as an
162 daemon receives a Kerberos authentication ticket, it will return from
170 will attempt to authenticate the ticket and generate a set of credentials
171 on the server for the ``user id'' specified in the field nsd_uid.
172 This is done by first authenticating the Kerberos ticket and then mapping
173 the Kerberos principal to a local name and getting a set of credentials for
186 flags set to pass the credential mapping in nsd_cr into the
187 kernel to be cached on the server socket for that client.
188 If the authentication failed,
195 .Dv NFSSVC_AUTHINFAIL
196 to denote an authentication failure.
207 int sock; /* Socket to serve */
208 caddr_t name; /* Client address for connection based sockets */
209 int namelen;/* Length of name */
213 to pass a server side
215 socket into the kernel for servicing by the
221 does not return unless the server
222 is terminated by a signal when a value of 0 is returned.
223 Otherwise, -1 is returned and the global variable
225 is set to specify the error.
229 This special error value
230 is really used for authentication support, particularly Kerberos,
233 The caller is not the super-user.
242 function first appeared in
247 system call is designed specifically for the
249 support daemons and as such is specific to their requirements.
250 It should really return values to indicate the need for authentication
253 is not really an error.
254 Several fields of the argument structures are assumed to be valid and
255 sometimes to be unchanged from a previous call, such that
257 must be used with extreme care.