2 * Copyright (c) 1992, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
5 * This code is derived from software contributed to Berkeley by
6 * Rick Macklem at The University of Guelph.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 4. Neither the name of the University nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 static const char copyright[] =
36 "@(#) Copyright (c) 1992, 1993, 1994\n\
37 The Regents of the University of California. All rights reserved.\n";
41 static char sccsid[] = "@(#)mount_nfs.c 8.11 (Berkeley) 5/4/95";
44 #include <sys/cdefs.h>
45 __FBSDID("$FreeBSD$");
47 #include <sys/param.h>
48 #include <sys/mount.h>
49 #include <sys/socket.h>
51 #include <sys/syslog.h>
54 #include <rpc/pmap_clnt.h>
55 #include <rpc/pmap_prot.h>
57 #include <nfs/rpcv2.h>
58 #include <nfs/nfsproto.h>
59 #include <nfsclient/nfs.h>
60 #include <nfsclient/nfsargs.h>
62 #include <arpa/inet.h>
80 #define ALTF_NOCONN 0x2
81 #define ALTF_DUMBTIMR 0x4
83 #define ALTF_NFSV3 0x20
84 #define ALTF_RDIRPLUS 0x40
85 #define ALTF_MNTUDP 0x80
86 #define ALTF_RESVPORT 0x100
87 #define ALTF_SEQPACKET 0x200
88 #define ALTF_SOFT 0x800
89 #define ALTF_TCP 0x1000
90 #define ALTF_PORT 0x2000
91 #define ALTF_NFSV2 0x4000
92 #define ALTF_ACREGMIN 0x8000
93 #define ALTF_ACREGMAX 0x10000
94 #define ALTF_ACDIRMIN 0x20000
95 #define ALTF_ACDIRMAX 0x40000
96 #define ALTF_NOLOCKD 0x80000
97 #define ALTF_NOINET4 0x100000
98 #define ALTF_NOINET6 0x200000
100 struct mntopt mopts[] = {
105 { "bg", 0, ALTF_BG, 1 },
106 { "conn", 1, ALTF_NOCONN, 1 },
107 { "dumbtimer", 0, ALTF_DUMBTIMR, 1 },
108 { "intr", 0, ALTF_INTR, 1 },
109 { "nfsv3", 0, ALTF_NFSV3, 1 },
110 { "rdirplus", 0, ALTF_RDIRPLUS, 1 },
111 { "mntudp", 0, ALTF_MNTUDP, 1 },
112 { "resvport", 0, ALTF_RESVPORT, 1 },
113 { "soft", 0, ALTF_SOFT, 1 },
114 { "tcp", 0, ALTF_TCP, 1 },
115 { "port=", 0, ALTF_PORT, 1 },
116 { "nfsv2", 0, ALTF_NFSV2, 1 },
117 { "acregmin=", 0, ALTF_ACREGMIN, 1 },
118 { "acregmax=", 0, ALTF_ACREGMAX, 1 },
119 { "acdirmin=", 0, ALTF_ACDIRMIN, 1 },
120 { "acdirmax=", 0, ALTF_ACDIRMAX, 1 },
121 { "lockd", 1, ALTF_NOLOCKD, 1 },
122 { "inet4", 1, ALTF_NOINET4, 1 },
123 { "inet6", 1, ALTF_NOINET6, 1 },
127 struct nfs_args nfsdefargs = {
130 sizeof (struct sockaddr_in),
143 0, /* was: NQ_DEFLEASE */
144 NFS_MAXDEADTHRESH, /* was: NQ_DEADTHRESH */
153 /* Table for af,sotype -> netid conversions. */
159 {"udp", AF_INET, SOCK_DGRAM},
160 {"tcp", AF_INET, SOCK_STREAM},
161 {"udp6", AF_INET6, SOCK_DGRAM},
162 {"tcp6", AF_INET6, SOCK_STREAM},
171 u_char nfh[NFSX_V3FHMAX];
179 int nfsproto = IPPROTO_UDP;
181 char *portspec = NULL; /* Server nfs port; NULL means look up via rpcbind. */
188 /* Return codes for nfs_tryproto. */
191 TRYRET_TIMEOUT, /* No response received. */
192 TRYRET_REMOTEERR, /* Error received from remote server. */
193 TRYRET_LOCALERR /* Local failure. */
196 int getnfsargs(char *, struct nfs_args *);
197 /* void set_rpc_maxgrouplist(int); */
198 struct netconfig *getnetconf_cached(const char *netid);
199 char *netidbytype(int af, int sotype);
200 void usage(void) __dead2;
201 int xdr_dir(XDR *, char *);
202 int xdr_fh(XDR *, struct nfhret *);
203 enum tryret nfs_tryproto(struct nfs_args *nfsargsp, struct addrinfo *ai,
204 char *hostp, char *spec, char **errstr);
205 enum tryret returncode(enum clnt_stat stat, struct rpc_err *rpcerr);
208 * Used to set mount flags with getmntopts. Call with dir=TRUE to
209 * initialize altflags from the current mount flags. Call with
210 * dir=FALSE to update mount flags with the new value of altflags after
211 * the call to getmntopts.
214 set_flags(int* altflags, int* nfsflags, int dir)
218 if (*nfsflags & NFSMNT_##nf) \
219 *altflags |= ALTF_##af; \
221 *altflags &= ~ALTF_##af; \
223 if (*altflags & ALTF_##af) \
224 *nfsflags |= NFSMNT_##nf; \
226 *nfsflags &= ~NFSMNT_##nf; \
252 struct nfs_args *nfsargsp;
253 struct nfs_args nfsargs;
254 int mntflags, altflags, num;
255 char *name, *p, *spec;
256 char mntpath[MAXPATHLEN];
260 nfsargs = nfsdefargs;
262 while ((c = getopt(argc, argv,
263 "23a:bcdD:g:I:iLlNo:PR:r:sTt:w:x:U")) != -1)
272 num = strtol(optarg, &p, 10);
274 errx(1, "illegal -a value -- %s", optarg);
275 nfsargsp->readahead = num;
276 nfsargsp->flags |= NFSMNT_READAHEAD;
282 nfsargsp->flags |= NFSMNT_NOCONN;
285 num = strtol(optarg, &p, 10);
287 errx(1, "illegal -D value -- %s", optarg);
288 nfsargsp->deadthresh = num;
289 nfsargsp->flags |= NFSMNT_DEADTHRESH;
292 nfsargsp->flags |= NFSMNT_DUMBTIMR;
296 num = strtol(optarg, &p, 10);
298 errx(1, "illegal -g value -- %s", optarg);
299 set_rpc_maxgrouplist(num);
300 nfsargsp->maxgrouplist = num;
301 nfsargsp->flags |= NFSMNT_MAXGRPS;
305 num = strtol(optarg, &p, 10);
307 errx(1, "illegal -I value -- %s", optarg);
308 nfsargsp->readdirsize = num;
309 nfsargsp->flags |= NFSMNT_READDIRSIZE;
312 nfsargsp->flags |= NFSMNT_INT;
315 nfsargsp->flags |= NFSMNT_NOLOCKD;
318 nfsargsp->flags |= NFSMNT_RDIRPLUS;
321 nfsargsp->flags &= ~NFSMNT_RESVPORT;
325 set_flags(&altflags, &nfsargsp->flags, TRUE);
327 altflags |= ALTF_NFSV2;
328 else if (mountmode == V3)
329 altflags |= ALTF_NFSV3;
330 getmntopts(optarg, mopts, &mntflags, &altflags);
331 set_flags(&altflags, &nfsargsp->flags, FALSE);
333 * Handle altflags which don't map directly to
336 if (altflags & ALTF_BG)
338 if (altflags & ALTF_NOINET4)
339 opflags |= OF_NOINET4;
340 if (altflags & ALTF_NOINET6)
341 opflags |= OF_NOINET6;
342 if (altflags & ALTF_MNTUDP)
344 if (altflags & ALTF_TCP) {
345 nfsargsp->sotype = SOCK_STREAM;
346 nfsproto = IPPROTO_TCP;
348 if (altflags & ALTF_PORT) {
350 * XXX Converting from a string to an int
351 * and back again is silly, and we should
352 * allow /etc/services names.
354 p = strstr(optarg, "port=");
356 asprintf(&portspec, "%d",
358 if (portspec == NULL)
363 if (altflags & ALTF_NFSV2)
365 if (altflags & ALTF_NFSV3)
367 if (altflags & ALTF_ACREGMIN) {
368 p = strstr(optarg, "acregmin=");
370 nfsargsp->acregmin = atoi(p + 9);
372 if (altflags & ALTF_ACREGMAX) {
373 p = strstr(optarg, "acregmax=");
375 nfsargsp->acregmax = atoi(p + 9);
377 if (altflags & ALTF_ACDIRMIN) {
378 p = strstr(optarg, "acdirmin=");
380 nfsargsp->acdirmin = atoi(p + 9);
382 if (altflags & ALTF_ACDIRMAX) {
383 p = strstr(optarg, "acdirmax=");
385 nfsargsp->acdirmax = atoi(p + 9);
389 /* obsolete for NFSMNT_RESVPORT, now default */
392 num = strtol(optarg, &p, 10);
394 errx(1, "illegal -R value -- %s", optarg);
398 num = strtol(optarg, &p, 10);
400 errx(1, "illegal -r value -- %s", optarg);
401 nfsargsp->rsize = num;
402 nfsargsp->flags |= NFSMNT_RSIZE;
405 nfsargsp->flags |= NFSMNT_SOFT;
408 nfsargsp->sotype = SOCK_STREAM;
409 nfsproto = IPPROTO_TCP;
412 num = strtol(optarg, &p, 10);
414 errx(1, "illegal -t value -- %s", optarg);
415 nfsargsp->timeo = num;
416 nfsargsp->flags |= NFSMNT_TIMEO;
419 num = strtol(optarg, &p, 10);
421 errx(1, "illegal -w value -- %s", optarg);
422 nfsargsp->wsize = num;
423 nfsargsp->flags |= NFSMNT_WSIZE;
426 num = strtol(optarg, &p, 10);
428 errx(1, "illegal -x value -- %s", optarg);
429 nfsargsp->retrans = num;
430 nfsargsp->flags |= NFSMNT_RETRANS;
451 /* The default is to keep retrying forever. */
453 if (!getnfsargs(spec, nfsargsp))
456 /* resolve the mountpoint with realpath(3) */
457 (void)checkpath(name, mntpath);
459 if (mount("nfs", mntpath, mntflags, nfsargsp))
460 err(1, "%s", mntpath);
466 getnfsargs(spec, nfsargsp)
468 struct nfs_args *nfsargsp;
470 struct addrinfo hints, *ai_nfs, *ai;
472 int ecode, speclen, remoteerr;
473 char *hostp, *delimp, *errstr;
475 static char nam[MNAMELEN + 1];
477 if ((delimp = strrchr(spec, ':')) != NULL) {
480 } else if ((delimp = strrchr(spec, '@')) != NULL) {
481 warnx("path@server syntax is deprecated, use server:path");
484 warnx("no <host>:<dirpath> nfs-name");
490 * If there has been a trailing slash at mounttime it seems
491 * that some mountd implementations fail to remove the mount
492 * entries from their mountlist while unmounting.
494 for (speclen = strlen(spec);
495 speclen > 1 && spec[speclen - 1] == '/';
497 spec[speclen - 1] = '\0';
498 if (strlen(hostp) + strlen(spec) + 1 > MNAMELEN) {
499 warnx("%s:%s: %s", hostp, spec, strerror(ENAMETOOLONG));
502 /* Make both '@' and ':' notations equal */
503 if (*hostp != '\0') {
505 memmove(nam, hostp, len);
507 memmove(nam + len + 1, spec, speclen);
508 nam[len + speclen + 1] = '\0';
512 * Handle an internet host address.
514 memset(&hints, 0, sizeof hints);
515 hints.ai_flags = AI_NUMERICHOST;
516 hints.ai_socktype = nfsargsp->sotype;
517 if (getaddrinfo(hostp, portspec, &hints, &ai_nfs) != 0) {
519 if ((ecode = getaddrinfo(hostp, portspec, &hints, &ai_nfs))
521 if (portspec == NULL)
522 errx(1, "%s: %s", hostp, gai_strerror(ecode));
524 errx(1, "%s:%s: %s", hostp, portspec,
525 gai_strerror(ecode));
530 ret = TRYRET_LOCALERR;
533 * Try each entry returned by getaddrinfo(). Note the
534 * occurence of remote errors by setting `remoteerr'.
537 for (ai = ai_nfs; ai != NULL; ai = ai->ai_next) {
538 if ((ai->ai_family == AF_INET6) &&
539 (opflags & OF_NOINET6))
541 if ((ai->ai_family == AF_INET) &&
542 (opflags & OF_NOINET4))
544 ret = nfs_tryproto(nfsargsp, ai, hostp, spec, &errstr);
545 if (ret == TRYRET_SUCCESS)
547 if (ret != TRYRET_LOCALERR)
549 if ((opflags & ISBGRND) == 0)
550 fprintf(stderr, "%s\n", errstr);
552 if (ret == TRYRET_SUCCESS)
555 /* Exit if all errors were local. */
560 * If retrycnt == 0, we are to keep retrying forever.
561 * Otherwise decrement it, and exit if it hits zero.
563 if (retrycnt != 0 && --retrycnt == 0)
566 if ((opflags & (BGRND | ISBGRND)) == BGRND) {
567 warnx("Cannot immediately mount %s:%s, backgrounding",
570 if (daemon(0, 0) != 0)
575 freeaddrinfo(ai_nfs);
576 nfsargsp->hostname = nam;
577 /* Add mounted file system to PATH_MOUNTTAB */
578 if (!add_mtab(hostp, spec))
579 warnx("can't update %s for %s:%s", PATH_MOUNTTAB, hostp, spec);
584 * Try to set up the NFS arguments according to the address
585 * family, protocol (and possibly port) specified in `ai'.
587 * Returns TRYRET_SUCCESS if successful, or:
588 * TRYRET_TIMEOUT The server did not respond.
589 * TRYRET_REMOTEERR The server reported an error.
590 * TRYRET_LOCALERR Local failure.
592 * In all error cases, *errstr will be set to a statically-allocated string
593 * describing the error.
596 nfs_tryproto(struct nfs_args *nfsargsp, struct addrinfo *ai, char *hostp,
597 char *spec, char **errstr)
599 static char errbuf[256];
600 struct sockaddr_storage nfs_ss;
601 struct netbuf nfs_nb;
602 struct nfhret nfhret;
604 struct rpc_err rpcerr;
606 struct netconfig *nconf, *nconf_mnt;
607 char *netid, *netid_mnt;
608 int doconnect, nfsvers, mntvers;
610 enum mountmode trymntmode;
612 trymntmode = mountmode;
616 if ((netid = netidbytype(ai->ai_family, nfsargsp->sotype)) == NULL) {
617 snprintf(errbuf, sizeof errbuf,
618 "af %d sotype %d not supported", ai->ai_family,
620 return (TRYRET_LOCALERR);
622 if ((nconf = getnetconf_cached(netid)) == NULL) {
623 snprintf(errbuf, sizeof errbuf, "%s: %s", netid, nc_sperror());
624 return (TRYRET_LOCALERR);
626 /* The RPCPROG_MNT netid may be different. */
631 if ((netid_mnt = netidbytype(ai->ai_family, SOCK_DGRAM))
633 snprintf(errbuf, sizeof errbuf,
634 "af %d sotype SOCK_DGRAM not supported",
636 return (TRYRET_LOCALERR);
638 if ((nconf_mnt = getnetconf_cached(netid_mnt)) == NULL) {
639 snprintf(errbuf, sizeof errbuf, "%s: %s", netid_mnt,
641 return (TRYRET_LOCALERR);
646 if (trymntmode == V2) {
654 if (portspec != NULL) {
655 /* `ai' contains the complete nfsd sockaddr. */
656 nfs_nb.buf = ai->ai_addr;
657 nfs_nb.len = nfs_nb.maxlen = ai->ai_addrlen;
659 /* Ask the remote rpcbind. */
660 nfs_nb.buf = &nfs_ss;
661 nfs_nb.len = nfs_nb.maxlen = sizeof nfs_ss;
663 if (!rpcb_getaddr(RPCPROG_NFS, nfsvers, nconf, &nfs_nb,
665 if (rpc_createerr.cf_stat == RPC_PROGVERSMISMATCH &&
670 snprintf(errbuf, sizeof errbuf, "[%s] %s:%s: %s",
672 clnt_spcreateerror("RPCPROG_NFS"));
673 return (returncode(rpc_createerr.cf_stat,
674 &rpc_createerr.cf_error));
678 /* Check that the server (nfsd) responds on the port we have chosen. */
679 clp = clnt_tli_create(RPC_ANYFD, nconf, &nfs_nb, RPCPROG_NFS, nfsvers,
682 snprintf(errbuf, sizeof errbuf, "[%s] %s:%s: %s", netid,
683 hostp, spec, clnt_spcreateerror("nfsd: RPCPROG_NFS"));
684 return (returncode(rpc_createerr.cf_stat,
685 &rpc_createerr.cf_error));
687 if (nfsargsp->sotype == SOCK_DGRAM &&
688 !(nfsargsp->flags & NFSMNT_NOCONN)) {
690 * Use connect(), to match what the kernel does. This
691 * catches cases where the server responds from the
692 * wrong source address.
695 if (!clnt_control(clp, CLSET_CONNECT, (char *)&doconnect)) {
697 snprintf(errbuf, sizeof errbuf,
698 "[%s] %s:%s: CLSET_CONNECT failed", netid, hostp,
700 return (TRYRET_LOCALERR);
706 stat = clnt_call(clp, NFSPROC_NULL, (xdrproc_t)xdr_void, NULL,
707 (xdrproc_t)xdr_void, NULL,
709 if (stat != RPC_SUCCESS) {
710 if (stat == RPC_PROGVERSMISMATCH && trymntmode == ANY) {
715 clnt_geterr(clp, &rpcerr);
716 snprintf(errbuf, sizeof errbuf, "[%s] %s:%s: %s", netid,
717 hostp, spec, clnt_sperror(clp, "NFSPROC_NULL"));
719 return (returncode(stat, &rpcerr));
723 /* Send the RPCMNT_MOUNT RPC to get the root filehandle. */
726 clp = clnt_tp_create(hostp, RPCPROG_MNT, mntvers, nconf_mnt);
728 snprintf(errbuf, sizeof errbuf, "[%s] %s:%s: %s", netid_mnt,
729 hostp, spec, clnt_spcreateerror("RPCMNT: clnt_create"));
730 return (returncode(rpc_createerr.cf_stat,
731 &rpc_createerr.cf_error));
733 clp->cl_auth = authsys_create_default();
734 nfhret.auth = RPCAUTH_UNIX;
735 nfhret.vers = mntvers;
736 stat = clnt_call(clp, RPCMNT_MOUNT, (xdrproc_t)xdr_dir, spec,
737 (xdrproc_t)xdr_fh, &nfhret,
739 auth_destroy(clp->cl_auth);
740 if (stat != RPC_SUCCESS) {
741 if (stat == RPC_PROGVERSMISMATCH && trymntmode == ANY) {
746 clnt_geterr(clp, &rpcerr);
747 snprintf(errbuf, sizeof errbuf, "[%s] %s:%s: %s", netid_mnt,
748 hostp, spec, clnt_sperror(clp, "RPCPROG_MNT"));
750 return (returncode(stat, &rpcerr));
754 if (nfhret.stat != 0) {
755 snprintf(errbuf, sizeof errbuf, "[%s] %s:%s: %s", netid_mnt,
756 hostp, spec, strerror(nfhret.stat));
757 return (TRYRET_REMOTEERR);
761 * Store the filehandle and server address in nfsargsp, making
762 * sure to copy any locally allocated structures.
764 nfsargsp->addrlen = nfs_nb.len;
765 nfsargsp->addr = malloc(nfsargsp->addrlen);
766 nfsargsp->fhsize = nfhret.fhsize;
767 nfsargsp->fh = malloc(nfsargsp->fhsize);
768 if (nfsargsp->addr == NULL || nfsargsp->fh == NULL)
770 bcopy(nfs_nb.buf, nfsargsp->addr, nfsargsp->addrlen);
771 bcopy(nfhret.nfh, nfsargsp->fh, nfsargsp->fhsize);
774 nfsargsp->flags |= NFSMNT_NFSV3;
776 nfsargsp->flags &= ~NFSMNT_NFSV3;
778 return (TRYRET_SUCCESS);
783 * Catagorise a RPC return status and error into an `enum tryret'
787 returncode(enum clnt_stat stat, struct rpc_err *rpcerr)
791 return (TRYRET_TIMEOUT);
792 case RPC_PMAPFAILURE:
793 case RPC_PROGNOTREGISTERED:
794 case RPC_PROGVERSMISMATCH:
795 /* XXX, these can be local or remote. */
798 return (TRYRET_REMOTEERR);
799 case RPC_SYSTEMERROR:
800 switch (rpcerr->re_errno) {
802 return (TRYRET_TIMEOUT);
806 return (TRYRET_REMOTEERR);
812 return (TRYRET_LOCALERR);
816 * Look up a netid based on an address family and socket type.
817 * `af' is the address family, and `sotype' is SOCK_DGRAM or SOCK_STREAM.
819 * XXX there should be a library function for this.
822 netidbytype(int af, int sotype) {
825 for (p = nc_protos; p->netid != NULL; p++) {
826 if (af != p->af || sotype != p->sotype)
834 * Look up a netconfig entry based on a netid, and cache the result so
835 * that we don't need to remember to call freenetconfigent().
837 * Otherwise it behaves just like getnetconfigent(), so nc_*error()
841 getnetconf_cached(const char *netid) {
842 static struct nc_entry {
843 struct netconfig *nconf;
844 struct nc_entry *next;
847 struct netconfig *nconf;
849 for (p = head; p != NULL; p = p->next)
850 if (strcmp(netid, p->nconf->nc_netid) == 0)
853 if ((nconf = getnetconfigent(netid)) == NULL)
855 if ((p = malloc(sizeof(*p))) == NULL)
865 * xdr routines for mount rpc's
872 return (xdr_string(xdrsp, &dirp, RPCMNT_PATHLEN));
881 long auth, authcnt, authfnd = 0;
883 if (!xdr_u_long(xdrsp, &np->stat))
889 np->fhsize = NFSX_V2FH;
890 return (xdr_opaque(xdrsp, (caddr_t)np->nfh, NFSX_V2FH));
892 if (!xdr_long(xdrsp, &np->fhsize))
894 if (np->fhsize <= 0 || np->fhsize > NFSX_V3FHMAX)
896 if (!xdr_opaque(xdrsp, (caddr_t)np->nfh, np->fhsize))
898 if (!xdr_long(xdrsp, &authcnt))
900 for (i = 0; i < authcnt; i++) {
901 if (!xdr_long(xdrsp, &auth))
903 if (auth == np->auth)
907 * Some servers, such as DEC's OSF/1 return a nil authenticator
908 * list to indicate RPCAUTH_UNIX.
910 if (!authfnd && (authcnt > 0 || np->auth != RPCAUTH_UNIX))
920 (void)fprintf(stderr, "%s\n%s\n%s\n%s\n",
921 "usage: mount_nfs [-23bcdiLlNPsTU] [-a maxreadahead] [-D deadthresh]",
922 " [-g maxgroups] [-I readdirsize] [-o options] [-R retrycnt]",
923 " [-r readsize] [-t timeout] [-w writesize] [-x retrans]",