p to enter the kernel as an .Xr nfsd 8 daemon. Whenever an .Xr nfsd 8 daemon receives a Kerberos authentication ticket, it will return from .Fn nfssvc with errno set to .Er ENEEDAUTH . The .Xr nfsd 8 will attempt to authenticate the ticket and generate a set of credentials on the server for the .Dq user id specified in the field nsd_uid. This is done by first authenticating the Kerberos ticket and then mapping the Kerberos principal to a local name and getting a set of credentials for that user via .Xr getpwnam 3 and .Xr getgrouplist 3 . If successful, the .Xr nfsd 8 will call .Fn nfssvc with the .Dv NFSSVC_NFSD and .Dv NFSSVC_AUTHIN flags set to pass the credential mapping in nsd_cr into the kernel to be cached on the server socket for that client. If the authentication failed, .Xr nfsd 8 calls .Fn nfssvc with the flags .Dv NFSSVC_NFSD and .Dv NFSSVC_AUTHINFAIL to denote an authentication failure.
p The master .Xr nfsd 8 server daemon calls .Fn nfssvc with the flag .Dv NFSSVC_ADDSOCK and a pointer to a d -literal struct nfsd_args { int sock; /* Socket to serve */ caddr_t name; /* Client address for connection based sockets */ int namelen; /* Length of name */ }; .Ed
p to pass a server side .Tn NFS socket into the kernel for servicing by the .Xr nfsd 8 daemons. .Ss Calls used by Xr mountd 8 The .Xr mountd 8 server daemon calls .Fn nfssvc with the flag .Dv NFSSVC_REPLACEEXPORTSLIST and a pointer to a .Ft struct mountd_exports_list object to atomically replace the exports lists of a specific file system. This structure has the following fields: l -tag -width ".Vt const char *mel_path" t Vt const char *mel_path Path to the file system that will have its exports list replaced by the one described in the other fields. t Vt size_t mel_nexports Number of valid entries in the .Vt mel_export field. If zero, the exports list will be cleared for the given file system. t Vt struct export_args mel_export[AF_MAX] Set of exports to be used for the given file system. .El .Sh RETURN VALUES Usually .Nm does not return unless the server is terminated by a signal when a value of 0 is returned. Otherwise, -1 is returned and the global variable .Va errno is set to specify the error. .Sh ERRORS l -tag -width Er t Bq Er ENEEDAUTH This special error value is really used for authentication support, particularly Kerberos, as explained above. t Bq Er EPERM The caller is not the super-user. .El .Sh SEE ALSO .Xr mount_nfs 8 , .Xr nfsd 8 .Sh HISTORY The .Nm function first appeared in x 4.4 . .Sh BUGS The .Nm system call is designed specifically for the .Tn NFS support daemons and as such is specific to their requirements. It should really return values to indicate the need for authentication support, since .Er ENEEDAUTH is not really an error. Several fields of the argument structures are assumed to be valid and sometimes to be unchanged from a previous call, such that .Nm must be used with extreme care.