2003-08-07 14:04:22 +04:00
|
|
|
/* $NetBSD: umount.c,v 1.29 2003/08/07 10:04:41 agc Exp $ */
|
1995-03-18 17:54:19 +03:00
|
|
|
|
1993-03-21 12:45:37 +03:00
|
|
|
/*-
|
1994-06-08 23:33:47 +04:00
|
|
|
* Copyright (c) 1980, 1989, 1993
|
|
|
|
* The Regents of the University of California. All rights reserved.
|
1993-03-21 12:45:37 +03:00
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
2003-08-07 14:04:22 +04:00
|
|
|
* 3. Neither the name of the University nor the names of its contributors
|
1993-03-21 12:45:37 +03:00
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
1997-09-15 15:33:59 +04:00
|
|
|
#include <sys/cdefs.h>
|
1993-03-21 12:45:37 +03:00
|
|
|
#ifndef lint
|
1997-09-15 15:33:59 +04:00
|
|
|
__COPYRIGHT("@(#) Copyright (c) 1980, 1989, 1993\n\
|
|
|
|
The Regents of the University of California. All rights reserved.\n");
|
1993-03-21 12:45:37 +03:00
|
|
|
#endif /* not lint */
|
|
|
|
|
|
|
|
#ifndef lint
|
1995-03-18 17:54:19 +03:00
|
|
|
#if 0
|
1997-09-16 16:24:05 +04:00
|
|
|
static char sccsid[] = "@(#)umount.c 8.8 (Berkeley) 5/8/95";
|
1995-03-18 17:54:19 +03:00
|
|
|
#else
|
2003-08-07 14:04:22 +04:00
|
|
|
__RCSID("$NetBSD: umount.c,v 1.29 2003/08/07 10:04:41 agc Exp $");
|
1995-03-18 17:54:19 +03:00
|
|
|
#endif
|
1993-03-21 12:45:37 +03:00
|
|
|
#endif /* not lint */
|
|
|
|
|
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <sys/mount.h>
|
|
|
|
#include <sys/time.h>
|
|
|
|
#include <sys/socket.h>
|
1994-06-08 23:33:47 +04:00
|
|
|
|
1993-03-21 12:45:37 +03:00
|
|
|
#include <netdb.h>
|
|
|
|
#include <rpc/rpc.h>
|
|
|
|
#include <rpc/pmap_clnt.h>
|
|
|
|
#include <rpc/pmap_prot.h>
|
|
|
|
#include <nfs/rpcv2.h>
|
|
|
|
|
1994-04-14 07:25:14 +04:00
|
|
|
#include <err.h>
|
1993-03-21 12:45:37 +03:00
|
|
|
#include <fstab.h>
|
|
|
|
#include <stdio.h>
|
1994-04-14 07:25:14 +04:00
|
|
|
#include <stdlib.h>
|
1994-06-08 23:33:47 +04:00
|
|
|
#include <string.h>
|
1994-04-14 07:25:14 +04:00
|
|
|
#include <unistd.h>
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1997-05-22 02:26:38 +04:00
|
|
|
typedef enum { MNTANY, MNTON, MNTFROM } mntwhat;
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1998-04-17 05:19:42 +04:00
|
|
|
int fake, fflag, verbose, raw;
|
1994-06-08 23:33:47 +04:00
|
|
|
char *nfshost;
|
2000-06-20 04:45:24 +04:00
|
|
|
struct addrinfo *nfshost_ai = NULL;
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1997-09-16 16:24:05 +04:00
|
|
|
int checkvfsname __P((const char *, char **));
|
|
|
|
char *getmntname __P((char *, mntwhat, char **));
|
|
|
|
char **makevfslist __P((char *));
|
1997-09-15 15:33:59 +04:00
|
|
|
int main __P((int, char *[]));
|
2000-06-20 04:45:24 +04:00
|
|
|
int namematch __P((struct addrinfo *));
|
|
|
|
int sacmp __P((struct sockaddr *, struct sockaddr *));
|
1997-09-16 16:24:05 +04:00
|
|
|
int selected __P((int));
|
|
|
|
int umountfs __P((char *, char **));
|
1994-06-08 23:33:47 +04:00
|
|
|
void usage __P((void));
|
|
|
|
int xdr_dir __P((XDR *, char *));
|
1994-04-14 07:25:14 +04:00
|
|
|
|
|
|
|
int
|
1993-03-21 12:45:37 +03:00
|
|
|
main(argc, argv)
|
|
|
|
int argc;
|
1994-06-08 23:33:47 +04:00
|
|
|
char *argv[];
|
1993-03-21 12:45:37 +03:00
|
|
|
{
|
1997-09-16 16:24:05 +04:00
|
|
|
int all, ch, errs, mnts;
|
|
|
|
char **typelist = NULL;
|
|
|
|
struct statfs *mntbuf;
|
2000-06-20 04:45:24 +04:00
|
|
|
struct addrinfo hints;
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1994-06-08 23:33:47 +04:00
|
|
|
/* Start disks transferring immediately. */
|
1993-03-21 12:45:37 +03:00
|
|
|
sync();
|
1994-06-08 23:33:47 +04:00
|
|
|
|
|
|
|
all = 0;
|
1998-04-17 05:19:42 +04:00
|
|
|
while ((ch = getopt(argc, argv, "AaFfRh:t:v")) != -1)
|
1994-06-08 23:33:47 +04:00
|
|
|
switch (ch) {
|
1997-09-16 16:24:05 +04:00
|
|
|
case 'A':
|
1994-06-08 23:33:47 +04:00
|
|
|
case 'a':
|
|
|
|
all = 1;
|
|
|
|
break;
|
|
|
|
case 'F':
|
|
|
|
fake = 1;
|
1993-03-21 12:45:37 +03:00
|
|
|
break;
|
|
|
|
case 'f':
|
|
|
|
fflag = MNT_FORCE;
|
|
|
|
break;
|
1997-09-16 16:24:05 +04:00
|
|
|
case 'h': /* -h implies -A. */
|
2000-06-06 11:09:14 +04:00
|
|
|
all = 1;
|
1994-06-08 23:33:47 +04:00
|
|
|
nfshost = optarg;
|
1993-03-21 12:45:37 +03:00
|
|
|
break;
|
1998-04-17 05:19:42 +04:00
|
|
|
case 'R':
|
|
|
|
raw = 1;
|
|
|
|
break;
|
1993-03-21 12:45:37 +03:00
|
|
|
case 't':
|
1995-01-30 20:20:06 +03:00
|
|
|
if (typelist != NULL)
|
|
|
|
errx(1, "only one -t option may be specified.");
|
1997-09-16 16:24:05 +04:00
|
|
|
typelist = makevfslist(optarg);
|
1993-03-21 12:45:37 +03:00
|
|
|
break;
|
1994-06-08 23:33:47 +04:00
|
|
|
case 'v':
|
1995-01-30 20:20:06 +03:00
|
|
|
verbose = 1;
|
1993-03-21 12:45:37 +03:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
usage();
|
|
|
|
/* NOTREACHED */
|
|
|
|
}
|
|
|
|
argc -= optind;
|
|
|
|
argv += optind;
|
|
|
|
|
1998-04-17 05:19:42 +04:00
|
|
|
if ((argc == 0 && !all) || (argc != 0 && all) || (all && raw))
|
1993-03-21 12:45:37 +03:00
|
|
|
usage();
|
1994-06-08 23:33:47 +04:00
|
|
|
|
|
|
|
/* -h implies "-t nfs" if no -t flag. */
|
|
|
|
if ((nfshost != NULL) && (typelist == NULL))
|
1997-09-16 16:24:05 +04:00
|
|
|
typelist = makevfslist("nfs");
|
2000-06-20 04:45:24 +04:00
|
|
|
|
|
|
|
if (nfshost != NULL) {
|
|
|
|
memset(&hints, 0, sizeof hints);
|
|
|
|
getaddrinfo(nfshost, NULL, &hints, &nfshost_ai);
|
|
|
|
}
|
1994-06-08 23:33:47 +04:00
|
|
|
|
1997-09-16 16:24:05 +04:00
|
|
|
errs = 0;
|
2000-06-06 11:09:14 +04:00
|
|
|
if (all) {
|
1997-09-16 16:24:05 +04:00
|
|
|
if ((mnts = getmntinfo(&mntbuf, MNT_NOWAIT)) == 0) {
|
|
|
|
warn("getmntinfo");
|
|
|
|
errs = 1;
|
|
|
|
}
|
|
|
|
for (errs = 0, mnts--; mnts > 0; mnts--) {
|
|
|
|
if (checkvfsname(mntbuf[mnts].f_fstypename, typelist))
|
|
|
|
continue;
|
|
|
|
if (umountfs(mntbuf[mnts].f_mntonname, typelist) != 0)
|
|
|
|
errs = 1;
|
|
|
|
}
|
2000-06-06 11:09:14 +04:00
|
|
|
} else {
|
1994-06-08 23:33:47 +04:00
|
|
|
for (errs = 0; *argv != NULL; ++argv)
|
1997-09-16 16:24:05 +04:00
|
|
|
if (umountfs(*argv, typelist) != 0)
|
1994-06-08 23:33:47 +04:00
|
|
|
errs = 1;
|
1997-09-16 16:24:05 +04:00
|
|
|
}
|
1993-03-21 12:45:37 +03:00
|
|
|
exit(errs);
|
|
|
|
}
|
|
|
|
|
1994-04-14 07:25:14 +04:00
|
|
|
int
|
1997-09-16 16:24:05 +04:00
|
|
|
umountfs(name, typelist)
|
1993-03-21 12:45:37 +03:00
|
|
|
char *name;
|
1997-09-16 16:24:05 +04:00
|
|
|
char **typelist;
|
1993-03-21 12:45:37 +03:00
|
|
|
{
|
1994-06-08 23:33:47 +04:00
|
|
|
enum clnt_stat clnt_stat;
|
|
|
|
struct stat sb;
|
2000-06-20 04:45:24 +04:00
|
|
|
struct timeval try;
|
1994-06-08 23:33:47 +04:00
|
|
|
CLIENT *clp;
|
1997-09-16 16:24:05 +04:00
|
|
|
char *type, *delimp, *hostp, *mntpt, rname[MAXPATHLEN];
|
1997-05-22 02:26:38 +04:00
|
|
|
mntwhat what;
|
2000-06-20 04:45:24 +04:00
|
|
|
struct addrinfo *ai, hints;
|
1994-06-08 23:33:47 +04:00
|
|
|
|
1997-09-15 15:33:59 +04:00
|
|
|
delimp = NULL;
|
1994-06-08 23:33:47 +04:00
|
|
|
|
1998-04-17 05:19:42 +04:00
|
|
|
if (raw) {
|
|
|
|
mntpt = name;
|
|
|
|
} else {
|
1994-06-08 23:33:47 +04:00
|
|
|
|
1998-04-17 05:19:42 +04:00
|
|
|
if (realpath(name, rname) == NULL) {
|
|
|
|
warn("%s", rname);
|
1997-05-22 02:26:38 +04:00
|
|
|
return (1);
|
|
|
|
}
|
1998-04-17 05:19:42 +04:00
|
|
|
|
|
|
|
what = MNTANY;
|
|
|
|
mntpt = name = rname;
|
|
|
|
|
|
|
|
if (stat(name, &sb) == 0) {
|
|
|
|
if (S_ISBLK(sb.st_mode))
|
|
|
|
what = MNTON;
|
|
|
|
else if (S_ISDIR(sb.st_mode))
|
|
|
|
what = MNTFROM;
|
1993-03-21 12:45:37 +03:00
|
|
|
}
|
1998-04-17 05:19:42 +04:00
|
|
|
|
|
|
|
switch (what) {
|
|
|
|
case MNTON:
|
1997-09-16 16:24:05 +04:00
|
|
|
if ((mntpt = getmntname(name, MNTON, &type)) == NULL) {
|
1997-05-22 01:47:07 +04:00
|
|
|
warnx("%s: not currently mounted", name);
|
|
|
|
return (1);
|
|
|
|
}
|
1998-04-17 05:19:42 +04:00
|
|
|
break;
|
|
|
|
case MNTFROM:
|
|
|
|
if ((name = getmntname(mntpt, MNTFROM, &type)) == NULL) {
|
|
|
|
warnx("%s: not currently mounted", mntpt);
|
|
|
|
return (1);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
if ((name = getmntname(mntpt, MNTFROM, &type)) == NULL) {
|
|
|
|
name = rname;
|
|
|
|
if ((mntpt = getmntname(name, MNTON, &type)) == NULL) {
|
|
|
|
warnx("%s: not currently mounted", name);
|
|
|
|
return (1);
|
|
|
|
}
|
|
|
|
}
|
1993-03-21 12:45:37 +03:00
|
|
|
}
|
|
|
|
|
1998-04-17 05:19:42 +04:00
|
|
|
if (checkvfsname(type, typelist))
|
|
|
|
return (1);
|
1994-06-08 23:33:47 +04:00
|
|
|
|
2000-06-20 04:45:24 +04:00
|
|
|
memset(&hints, 0, sizeof hints);
|
|
|
|
ai = NULL;
|
1998-04-17 05:19:42 +04:00
|
|
|
if (!strncmp(type, MOUNT_NFS, MFSNAMELEN)) {
|
|
|
|
if ((delimp = strchr(name, '@')) != NULL) {
|
|
|
|
hostp = delimp + 1;
|
|
|
|
*delimp = '\0';
|
2000-06-20 04:45:24 +04:00
|
|
|
getaddrinfo(hostp, NULL, &hints, &ai);
|
1998-04-17 05:19:42 +04:00
|
|
|
*delimp = '@';
|
2000-06-20 04:45:24 +04:00
|
|
|
} else if ((delimp = strrchr(name, ':')) != NULL) {
|
1998-04-17 05:19:42 +04:00
|
|
|
*delimp = '\0';
|
|
|
|
hostp = name;
|
2000-06-20 04:45:24 +04:00
|
|
|
getaddrinfo(hostp, NULL, &hints, &ai);
|
1998-04-17 05:19:42 +04:00
|
|
|
name = delimp + 1;
|
|
|
|
*delimp = ':';
|
|
|
|
}
|
1997-09-16 16:24:05 +04:00
|
|
|
}
|
1993-03-21 12:45:37 +03:00
|
|
|
|
2000-06-20 04:45:24 +04:00
|
|
|
if (!namematch(ai))
|
1998-04-17 05:19:42 +04:00
|
|
|
return (1);
|
|
|
|
}
|
1997-09-16 16:24:05 +04:00
|
|
|
|
1995-01-30 20:20:06 +03:00
|
|
|
if (verbose)
|
1994-06-08 23:33:47 +04:00
|
|
|
(void)printf("%s: unmount from %s\n", name, mntpt);
|
|
|
|
if (fake)
|
1993-03-21 12:45:37 +03:00
|
|
|
return (0);
|
1994-06-08 23:33:47 +04:00
|
|
|
|
|
|
|
if (unmount(mntpt, fflag) < 0) {
|
|
|
|
warn("%s", mntpt);
|
|
|
|
return (1);
|
1993-03-21 12:45:37 +03:00
|
|
|
}
|
|
|
|
|
1999-08-02 06:40:38 +04:00
|
|
|
if (!raw && !strncmp(type, MOUNT_NFS, MFSNAMELEN) &&
|
2000-06-20 04:45:24 +04:00
|
|
|
(ai != NULL) && !(fflag & MNT_FORCE)) {
|
1993-03-21 12:45:37 +03:00
|
|
|
*delimp = '\0';
|
2000-06-20 04:45:24 +04:00
|
|
|
clp = clnt_create(hostp, RPCPROG_MNT, RPCMNT_VER1, "udp");
|
|
|
|
if (clp == NULL) {
|
1993-03-21 12:45:37 +03:00
|
|
|
clnt_pcreateerror("Cannot MNT PRC");
|
|
|
|
return (1);
|
|
|
|
}
|
2000-06-20 04:45:24 +04:00
|
|
|
clp->cl_auth = authsys_create_default();
|
1993-03-21 12:45:37 +03:00
|
|
|
try.tv_sec = 20;
|
|
|
|
try.tv_usec = 0;
|
1994-06-08 23:33:47 +04:00
|
|
|
clnt_stat = clnt_call(clp,
|
|
|
|
RPCMNT_UMOUNT, xdr_dir, name, xdr_void, (caddr_t)0, try);
|
1993-03-21 12:45:37 +03:00
|
|
|
if (clnt_stat != RPC_SUCCESS) {
|
|
|
|
clnt_perror(clp, "Bad MNT RPC");
|
|
|
|
return (1);
|
|
|
|
}
|
|
|
|
auth_destroy(clp->cl_auth);
|
|
|
|
clnt_destroy(clp);
|
|
|
|
}
|
1994-06-08 23:33:47 +04:00
|
|
|
return (0);
|
1993-03-21 12:45:37 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
char *
|
|
|
|
getmntname(name, what, type)
|
|
|
|
char *name;
|
1994-06-08 23:33:47 +04:00
|
|
|
mntwhat what;
|
1997-09-16 16:24:05 +04:00
|
|
|
char **type;
|
1993-03-21 12:45:37 +03:00
|
|
|
{
|
1997-09-16 16:24:05 +04:00
|
|
|
static struct statfs *mntbuf;
|
|
|
|
static int mntsize;
|
|
|
|
int i;
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1997-09-16 16:24:05 +04:00
|
|
|
if (mntbuf == NULL &&
|
|
|
|
(mntsize = getmntinfo(&mntbuf, MNT_NOWAIT)) == 0) {
|
1994-06-08 23:33:47 +04:00
|
|
|
warn("getmntinfo");
|
|
|
|
return (NULL);
|
1993-03-21 12:45:37 +03:00
|
|
|
}
|
1997-11-01 15:54:45 +03:00
|
|
|
for (i = mntsize - 1; i >= 0; i--) {
|
1994-06-08 23:33:47 +04:00
|
|
|
if ((what == MNTON) && !strcmp(mntbuf[i].f_mntfromname, name)) {
|
|
|
|
if (type)
|
1997-09-16 16:24:05 +04:00
|
|
|
*type = mntbuf[i].f_fstypename;
|
1993-03-21 12:45:37 +03:00
|
|
|
return (mntbuf[i].f_mntonname);
|
|
|
|
}
|
1994-06-08 23:33:47 +04:00
|
|
|
if ((what == MNTFROM) && !strcmp(mntbuf[i].f_mntonname, name)) {
|
|
|
|
if (type)
|
1997-09-16 16:24:05 +04:00
|
|
|
*type = mntbuf[i].f_fstypename;
|
1993-03-21 12:45:37 +03:00
|
|
|
return (mntbuf[i].f_mntfromname);
|
|
|
|
}
|
|
|
|
}
|
1994-06-08 23:33:47 +04:00
|
|
|
return (NULL);
|
1993-03-21 12:45:37 +03:00
|
|
|
}
|
|
|
|
|
1994-04-14 07:25:14 +04:00
|
|
|
int
|
2000-06-20 04:45:24 +04:00
|
|
|
sacmp(struct sockaddr *sa1, struct sockaddr *sa2)
|
1993-03-21 12:45:37 +03:00
|
|
|
{
|
2000-06-20 04:45:24 +04:00
|
|
|
void *p1, *p2;
|
|
|
|
int len;
|
|
|
|
|
|
|
|
if (sa1->sa_family != sa2->sa_family)
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
switch (sa1->sa_family) {
|
|
|
|
case AF_INET:
|
|
|
|
p1 = &((struct sockaddr_in *)sa1)->sin_addr;
|
|
|
|
p2 = &((struct sockaddr_in *)sa2)->sin_addr;
|
|
|
|
len = 4;
|
|
|
|
break;
|
|
|
|
case AF_INET6:
|
|
|
|
p1 = &((struct sockaddr_in6 *)sa1)->sin6_addr;
|
|
|
|
p2 = &((struct sockaddr_in6 *)sa2)->sin6_addr;
|
|
|
|
len = 16;
|
|
|
|
if (((struct sockaddr_in6 *)sa1)->sin6_scope_id !=
|
|
|
|
((struct sockaddr_in6 *)sa2)->sin6_scope_id)
|
|
|
|
return 1;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return 1;
|
|
|
|
}
|
1994-06-08 23:33:47 +04:00
|
|
|
|
2000-06-20 04:45:24 +04:00
|
|
|
return memcmp(p1, p2, len);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
namematch(ai)
|
|
|
|
struct addrinfo *ai;
|
|
|
|
{
|
|
|
|
struct addrinfo *aip;
|
1993-03-21 12:45:37 +03:00
|
|
|
|
2000-06-20 04:45:24 +04:00
|
|
|
if (nfshost == NULL || nfshost_ai == NULL)
|
1994-06-08 23:33:47 +04:00
|
|
|
return (1);
|
|
|
|
|
2000-06-20 04:45:24 +04:00
|
|
|
while (ai != NULL) {
|
|
|
|
aip = nfshost_ai;
|
|
|
|
while (aip != NULL) {
|
|
|
|
if (sacmp(ai->ai_addr, aip->ai_addr) == 0)
|
|
|
|
return 1;
|
|
|
|
aip = aip->ai_next;
|
1993-03-21 12:45:37 +03:00
|
|
|
}
|
2000-06-20 04:45:24 +04:00
|
|
|
ai = ai->ai_next;
|
1993-03-21 12:45:37 +03:00
|
|
|
}
|
2000-06-20 04:45:24 +04:00
|
|
|
|
|
|
|
return 0;
|
1993-03-21 12:45:37 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* xdr routines for mount rpc's
|
|
|
|
*/
|
1994-04-14 07:25:14 +04:00
|
|
|
int
|
1993-03-21 12:45:37 +03:00
|
|
|
xdr_dir(xdrsp, dirp)
|
|
|
|
XDR *xdrsp;
|
|
|
|
char *dirp;
|
|
|
|
{
|
|
|
|
return (xdr_string(xdrsp, &dirp, RPCMNT_PATHLEN));
|
|
|
|
}
|
1994-06-08 23:33:47 +04:00
|
|
|
|
|
|
|
void
|
|
|
|
usage()
|
|
|
|
{
|
|
|
|
(void)fprintf(stderr,
|
|
|
|
"usage: %s\n %s\n",
|
1998-04-17 05:19:42 +04:00
|
|
|
"umount [-fvFR] [-t fstypelist] special | node",
|
1997-12-18 10:11:48 +03:00
|
|
|
"umount -a[fvF] [-h host] [-t fstypelist]");
|
1994-06-08 23:33:47 +04:00
|
|
|
exit(1);
|
|
|
|
}
|