|
NAMEnfssvc —
NFS services
LIBRARYStandard C Library (libc, -lc)SYNOPSIS#include <sys/param.h>
#include <sys/mount.h>
#include <sys/time.h>
#include <nfs/rpcv2.h>
#include <nfsserver/nfs.h>
#include <unistd.h>
int
DESCRIPTIONThenfssvc () system call is used by the NFS daemons to
pass information into and out of the kernel and also to enter the kernel as a
server daemon. The flags argument consists of several
bits that show what action is to be taken once in the kernel and the
argstructp points to one of three structures depending
on which bits are set in flags.
On the client side,
nfsiod(8)
calls struct nfsd_cargs { char *ncd_dirp; /* Mount dir path */ uid_t ncd_authuid; /* Effective uid */ int ncd_authtype; /* Type of authenticator */ int ncd_authlen; /* Length of authenticator string */ u_char *ncd_authstr; /* Authenticator string */ int ncd_verflen; /* and the verifier */ u_char *ncd_verfstr; NFSKERBKEY_T ncd_key; /* Session key */ }; structure. The initial call has only the
On the server side, struct nfsd_srvargs { struct nfsd *nsd_nfsd; /* Pointer to in kernel nfsd struct */ uid_t nsd_uid; /* Effective uid mapped to cred */ uint32_t nsd_haddr; /* Ip address of client */ struct ucred nsd_cr; /* Cred. uid maps to */ int nsd_authlen; /* Length of auth string (ret) */ u_char *nsd_authstr; /* Auth string (ret) */ int nsd_verflen; /* and the verifier */ u_char *nsd_verfstr; struct timeval nsd_timestamp; /* timestamp from verifier */ uint32_t nsd_ttl; /* credential ttl (sec) */ NFSKERBKEY_T nsd_key; /* Session key */ }; to enter the kernel as an
nfsd(8)
daemon. Whenever an
nfsd(8)
daemon receives a Kerberos authentication ticket, it will return from
The master
nfsd(8)
server daemon calls struct nfsd_args { int sock; /* Socket to serve */ caddr_t name; /* Client address for connection based sockets */ int namelen;/* Length of name */ }; to pass a server side NFS socket into the kernel for servicing by the nfsd(8) daemons. RETURN VALUESNormallynfssvc () 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 errno is set to specify
the error.
ERRORSSEE ALSOmount_nfs(8), nfsd(8), nfsiod(8)HISTORYThenfssvc () system call first appeared in
4.4BSD.
BUGSThenfssvc () system call is designed specifically for
the NFS support daemons and as such is specific to their requirements. It
should really return values to indicate the need for authentication support,
since 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 nfssvc ()
must be used with extreme care.
Visit the GSP FreeBSD Man Page Interface. |