diff options
author | Jared Yanovich <jaredy@cvs.openbsd.org> | 2005-04-08 20:09:39 +0000 |
---|---|---|
committer | Jared Yanovich <jaredy@cvs.openbsd.org> | 2005-04-08 20:09:39 +0000 |
commit | 4aa08f3abdbaffdf78a844c44ade693cf7daea1f (patch) | |
tree | a1ea02a53fc7d6f64ba752eab0f4a0f1acc90dad /sbin | |
parent | 6ae197dff1cae3924cfab9868d086c0e749e49de (diff) |
Sync with recent realpath(3) changes: on failure, don't use the second
argument "resolved", since it is undefined.
ok and help millert, otto
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/mount/mount.c | 8 | ||||
-rw-r--r-- | sbin/mount_ados/mount_ados.c | 6 | ||||
-rw-r--r-- | sbin/mount_cd9660/mount_cd9660.c | 6 | ||||
-rw-r--r-- | sbin/mount_ext2fs/mount_ext2fs.c | 6 | ||||
-rw-r--r-- | sbin/mount_fdesc/mount_fdesc.c | 6 | ||||
-rw-r--r-- | sbin/mount_ffs/mount_ffs.c | 6 | ||||
-rw-r--r-- | sbin/mount_kernfs/mount_kernfs.c | 6 | ||||
-rw-r--r-- | sbin/mount_lfs/mount_lfs.c | 6 | ||||
-rw-r--r-- | sbin/mount_msdos/mount_msdos.c | 6 | ||||
-rw-r--r-- | sbin/mount_nfs/mount_nfs.c | 4 | ||||
-rw-r--r-- | sbin/mount_ntfs/mount_ntfs.c | 4 | ||||
-rw-r--r-- | sbin/mount_null/mount_null.c | 6 | ||||
-rw-r--r-- | sbin/mount_portal/mount_portal.c | 6 | ||||
-rw-r--r-- | sbin/mount_procfs/mount_procfs.c | 6 | ||||
-rw-r--r-- | sbin/mount_udf/mount_udf.c | 4 | ||||
-rw-r--r-- | sbin/mount_umap/mount_umap.c | 6 | ||||
-rw-r--r-- | sbin/mount_union/mount_union.c | 6 | ||||
-rw-r--r-- | sbin/mount_xfs/mount_xfs.c | 4 | ||||
-rw-r--r-- | sbin/mountd/mountd.c | 12 |
19 files changed, 59 insertions, 55 deletions
diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c index 39355330db6..b6ecf946516 100644 --- a/sbin/mount/mount.c +++ b/sbin/mount/mount.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount.c,v 1.37 2004/11/13 21:45:50 miod Exp $ */ +/* $OpenBSD: mount.c,v 1.38 2005/04/08 20:09:36 jaredy Exp $ */ /* $NetBSD: mount.c,v 1.24 1995/11/18 03:34:29 cgd Exp $ */ /* @@ -40,7 +40,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)mount.c 8.19 (Berkeley) 4/19/94"; #else -static char rcsid[] = "$OpenBSD: mount.c,v 1.37 2004/11/13 21:45:50 miod Exp $"; +static char rcsid[] = "$OpenBSD: mount.c,v 1.38 2005/04/08 20:09:36 jaredy Exp $"; #endif #endif /* not lint */ @@ -216,7 +216,7 @@ main(int argc, char * const argv[]) usage(); if (realpath(*argv, mntpath) == NULL) - err(1, "realpath %s", mntpath); + err(1, "realpath %s", *argv); if (hasopt(options, "update")) { if ((mntbuf = getmntpt(mntpath)) == NULL) errx(1, @@ -348,7 +348,7 @@ mountfs(const char *vfstype, const char *spec, const char *name, char *optbuf, execname[MAXPATHLEN], mntpath[MAXPATHLEN]; if (realpath(name, mntpath) == NULL) { - warn("realpath %s", mntpath); + warn("realpath %s", name); return (1); } diff --git a/sbin/mount_ados/mount_ados.c b/sbin/mount_ados/mount_ados.c index 188fd57a55e..0cc1178e7c3 100644 --- a/sbin/mount_ados/mount_ados.c +++ b/sbin/mount_ados/mount_ados.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_ados.c,v 1.12 2003/07/03 22:41:40 tedu Exp $ */ +/* $OpenBSD: mount_ados.c,v 1.13 2005/04/08 20:09:36 jaredy Exp $ */ /* $NetBSD: mount_ados.c,v 1.5 1996/04/13 01:30:59 jtc Exp $ */ /* @@ -32,7 +32,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: mount_ados.c,v 1.12 2003/07/03 22:41:40 tedu Exp $"; +static char rcsid[] = "$OpenBSD: mount_ados.c,v 1.13 2005/04/08 20:09:36 jaredy Exp $"; #endif /* not lint */ #include <sys/cdefs.h> @@ -101,7 +101,7 @@ main(int argc, char *argv[]) dev = argv[optind]; if (realpath(argv[optind + 1], dir) == NULL) - err(1, "realpath %s", dir); + err(1, "realpath %s", argv[optind + 1]); args.fspec = dev; args.export_info.ex_root = -2; /* unchecked anyway on DOS fs */ diff --git a/sbin/mount_cd9660/mount_cd9660.c b/sbin/mount_cd9660/mount_cd9660.c index e2ee9a086d2..9b66f8fee8c 100644 --- a/sbin/mount_cd9660/mount_cd9660.c +++ b/sbin/mount_cd9660/mount_cd9660.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_cd9660.c,v 1.16 2003/07/03 22:41:40 tedu Exp $ */ +/* $OpenBSD: mount_cd9660.c,v 1.17 2005/04/08 20:09:36 jaredy Exp $ */ /* $NetBSD: mount_cd9660.c,v 1.3 1996/04/13 01:31:08 jtc Exp $ */ /* @@ -45,7 +45,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)mount_cd9660.c 8.4 (Berkeley) 3/27/94"; #else -static char rcsid[] = "$OpenBSD: mount_cd9660.c,v 1.16 2003/07/03 22:41:40 tedu Exp $"; +static char rcsid[] = "$OpenBSD: mount_cd9660.c,v 1.17 2005/04/08 20:09:36 jaredy Exp $"; #endif #endif /* not lint */ @@ -107,7 +107,7 @@ main(int argc, char *argv[]) dev = argv[0]; if (realpath(argv[1], dir) == NULL) - err(1, "realpath %s", dir); + err(1, "realpath %s", argv[1]); #define DEFAULT_ROOTUID -2 args.fspec = dev; diff --git a/sbin/mount_ext2fs/mount_ext2fs.c b/sbin/mount_ext2fs/mount_ext2fs.c index e4e179ecaf1..30fd4821d51 100644 --- a/sbin/mount_ext2fs/mount_ext2fs.c +++ b/sbin/mount_ext2fs/mount_ext2fs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_ext2fs.c,v 1.12 2003/07/03 22:41:40 tedu Exp $ */ +/* $OpenBSD: mount_ext2fs.c,v 1.13 2005/04/08 20:09:36 jaredy Exp $ */ /* $NetBSD: mount_ffs.c,v 1.3 1996/04/13 01:31:19 jtc Exp $ */ /*- @@ -40,7 +40,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)mount_ufs.c 8.2 (Berkeley) 3/27/94"; #else -static char rcsid[] = "$OpenBSD: mount_ext2fs.c,v 1.12 2003/07/03 22:41:40 tedu Exp $"; +static char rcsid[] = "$OpenBSD: mount_ext2fs.c,v 1.13 2005/04/08 20:09:36 jaredy Exp $"; #endif #endif /* not lint */ @@ -90,7 +90,7 @@ main(int argc, char *argv[]) args.fspec = argv[0]; /* The name of the device file. */ if (realpath(argv[1], fs_name) == NULL) /* The mount point. */ - err(1, "realpath %s", fs_name); + err(1, "realpath %s", argv[1]); #define DEFAULT_ROOTUID -2 args.export_info.ex_root = DEFAULT_ROOTUID; diff --git a/sbin/mount_fdesc/mount_fdesc.c b/sbin/mount_fdesc/mount_fdesc.c index 364ff938bdd..7a102a9c801 100644 --- a/sbin/mount_fdesc/mount_fdesc.c +++ b/sbin/mount_fdesc/mount_fdesc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_fdesc.c,v 1.10 2003/07/03 22:41:40 tedu Exp $ */ +/* $OpenBSD: mount_fdesc.c,v 1.11 2005/04/08 20:09:36 jaredy Exp $ */ /* $NetBSD: mount_fdesc.c,v 1.7 1996/04/13 01:31:15 jtc Exp $ */ /* @@ -44,7 +44,7 @@ char copyright[] = #if 0 static char sccsid[] = "@(#)mount_fdesc.c 8.2 (Berkeley) 3/27/94"; #else -static char rcsid[] = "$OpenBSD: mount_fdesc.c,v 1.10 2003/07/03 22:41:40 tedu Exp $"; +static char rcsid[] = "$OpenBSD: mount_fdesc.c,v 1.11 2005/04/08 20:09:36 jaredy Exp $"; #endif #endif /* not lint */ @@ -90,7 +90,7 @@ main(int argc, char *argv[]) usage(); if (realpath(argv[1], path) == NULL) - err(1, "realpath %s", path); + err(1, "realpath %s", argv[1]); if (mount(MOUNT_FDESC, path, mntflags, NULL)) { if (errno == EOPNOTSUPP) diff --git a/sbin/mount_ffs/mount_ffs.c b/sbin/mount_ffs/mount_ffs.c index a40fb43ad47..72ddfe5b210 100644 --- a/sbin/mount_ffs/mount_ffs.c +++ b/sbin/mount_ffs/mount_ffs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_ffs.c,v 1.17 2003/07/03 22:41:40 tedu Exp $ */ +/* $OpenBSD: mount_ffs.c,v 1.18 2005/04/08 20:09:37 jaredy Exp $ */ /* $NetBSD: mount_ffs.c,v 1.3 1996/04/13 01:31:19 jtc Exp $ */ /*- @@ -40,7 +40,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)mount_ufs.c 8.2 (Berkeley) 3/27/94"; #else -static char rcsid[] = "$OpenBSD: mount_ffs.c,v 1.17 2003/07/03 22:41:40 tedu Exp $"; +static char rcsid[] = "$OpenBSD: mount_ffs.c,v 1.18 2005/04/08 20:09:37 jaredy Exp $"; #endif #endif /* not lint */ @@ -95,7 +95,7 @@ main(int argc, char *argv[]) args.fspec = argv[0]; /* The name of the device file. */ if (realpath(argv[1], fs_name) == NULL) /* The mount point. */ - err(1, "realpath %s", fs_name); + err(1, "realpath %s", argv[1]); #define DEFAULT_ROOTUID -2 args.export_info.ex_root = DEFAULT_ROOTUID; diff --git a/sbin/mount_kernfs/mount_kernfs.c b/sbin/mount_kernfs/mount_kernfs.c index 723349c461c..9a8bec1eb69 100644 --- a/sbin/mount_kernfs/mount_kernfs.c +++ b/sbin/mount_kernfs/mount_kernfs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_kernfs.c,v 1.11 2003/07/03 22:41:40 tedu Exp $ */ +/* $OpenBSD: mount_kernfs.c,v 1.12 2005/04/08 20:09:37 jaredy Exp $ */ /* $NetBSD: mount_kernfs.c,v 1.8 1996/04/13 05:35:39 cgd Exp $ */ /* @@ -44,7 +44,7 @@ char copyright[] = #if 0 static char sccsid[] = "@(#)mount_kernfs.c 8.2 (Berkeley) 3/27/94"; #else -static char rcsid[] = "$OpenBSD: mount_kernfs.c,v 1.11 2003/07/03 22:41:40 tedu Exp $"; +static char rcsid[] = "$OpenBSD: mount_kernfs.c,v 1.12 2005/04/08 20:09:37 jaredy Exp $"; #endif #endif /* not lint */ @@ -90,7 +90,7 @@ main(int argc, char *argv[]) usage(); if (realpath(argv[1], path) == NULL) - err(1, "realpath %s", path); + err(1, "realpath %s", argv[1]); if (mount(MOUNT_KERNFS, path, mntflags, NULL)) { if (errno == EOPNOTSUPP) diff --git a/sbin/mount_lfs/mount_lfs.c b/sbin/mount_lfs/mount_lfs.c index f41bcf43f72..4d9cdc449da 100644 --- a/sbin/mount_lfs/mount_lfs.c +++ b/sbin/mount_lfs/mount_lfs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_lfs.c,v 1.11 2003/07/03 22:41:40 tedu Exp $ */ +/* $OpenBSD: mount_lfs.c,v 1.12 2005/04/08 20:09:37 jaredy Exp $ */ /* $NetBSD: mount_lfs.c,v 1.4 1996/04/13 05:35:44 cgd Exp $ */ /*- @@ -40,7 +40,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)mount_lfs.c 8.3 (Berkeley) 3/27/94"; #else -static char rcsid[] = "$OpenBSD: mount_lfs.c,v 1.11 2003/07/03 22:41:40 tedu Exp $"; +static char rcsid[] = "$OpenBSD: mount_lfs.c,v 1.12 2005/04/08 20:09:37 jaredy Exp $"; #endif #endif /* not lint */ @@ -105,7 +105,7 @@ main(int argc, char *argv[]) args.fspec = argv[0]; /* the name of the device file */ if (realpath(argv[1], fs_name) == NULL) /* the mount point */ - err(1, "realpath %s", fs_name); + err(1, "realpath %s", argv[1]); #define DEFAULT_ROOTUID -2 args.export_info.ex_root = DEFAULT_ROOTUID; diff --git a/sbin/mount_msdos/mount_msdos.c b/sbin/mount_msdos/mount_msdos.c index 29e18c26232..73eacc6e5bf 100644 --- a/sbin/mount_msdos/mount_msdos.c +++ b/sbin/mount_msdos/mount_msdos.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_msdos.c,v 1.18 2003/07/03 22:41:40 tedu Exp $ */ +/* $OpenBSD: mount_msdos.c,v 1.19 2005/04/08 20:09:37 jaredy Exp $ */ /* $NetBSD: mount_msdos.c,v 1.16 1996/10/24 00:12:50 cgd Exp $ */ /* @@ -32,7 +32,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: mount_msdos.c,v 1.18 2003/07/03 22:41:40 tedu Exp $"; +static char rcsid[] = "$OpenBSD: mount_msdos.c,v 1.19 2005/04/08 20:09:37 jaredy Exp $"; #endif /* not lint */ #include <sys/cdefs.h> @@ -118,7 +118,7 @@ main(int argc, char **argv) dev = argv[optind]; if (realpath(argv[optind + 1], dir) == NULL) - err(1, "realpath %s", dir); + err(1, "realpath %s", argv[optind + 1]); args.fspec = dev; args.export_info.ex_root = -2; /* unchecked anyway on DOS fs */ diff --git a/sbin/mount_nfs/mount_nfs.c b/sbin/mount_nfs/mount_nfs.c index 0dd1247094d..2f95c669d4c 100644 --- a/sbin/mount_nfs/mount_nfs.c +++ b/sbin/mount_nfs/mount_nfs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_nfs.c,v 1.42 2004/09/15 07:10:32 miod Exp $ */ +/* $OpenBSD: mount_nfs.c,v 1.43 2005/04/08 20:09:37 jaredy Exp $ */ /* $NetBSD: mount_nfs.c,v 1.12.4.1 1996/05/25 22:48:05 fvdl Exp $ */ /* @@ -389,7 +389,7 @@ main(int argc, char *argv[]) spec = *argv++; if (realpath(*argv, name) == NULL) - err(1, "realpath %s", name); + err(1, "realpath %s", *argv); if (!getnfsargs(spec, nfsargsp)) exit(1); diff --git a/sbin/mount_ntfs/mount_ntfs.c b/sbin/mount_ntfs/mount_ntfs.c index d0957ec8caa..8cd868ac4cd 100644 --- a/sbin/mount_ntfs/mount_ntfs.c +++ b/sbin/mount_ntfs/mount_ntfs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_ntfs.c,v 1.8 2003/07/03 22:41:40 tedu Exp $ */ +/* $OpenBSD: mount_ntfs.c,v 1.9 2005/04/08 20:09:37 jaredy Exp $ */ /* $NetBSD: mount_ntfs.c,v 1.9 2003/05/03 15:37:08 christos Exp $ */ /* @@ -113,7 +113,7 @@ main(int argc, char *argv[]) dev = argv[optind]; if (realpath(argv[optind + 1], dir) == NULL) - err(1, "realpath %s", dir); + err(1, "realpath %s", argv[optind + 1]); args.fspec = dev; args.export_info.ex_root = 65534; /* unchecked anyway on DOS fs */ diff --git a/sbin/mount_null/mount_null.c b/sbin/mount_null/mount_null.c index 83668b9060b..e2ebdd28492 100644 --- a/sbin/mount_null/mount_null.c +++ b/sbin/mount_null/mount_null.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_null.c,v 1.11 2003/07/03 22:41:40 tedu Exp $ */ +/* $OpenBSD: mount_null.c,v 1.12 2005/04/08 20:09:37 jaredy Exp $ */ /* $NetBSD: mount_null.c,v 1.3 1996/04/13 01:31:49 jtc Exp $ */ /* @@ -43,7 +43,7 @@ char copyright[] = #if 0 static char sccsid[] = "@(#)mount_null.c 8.5 (Berkeley) 3/27/94"; #else -static char rcsid[] = "$OpenBSD: mount_null.c,v 1.11 2003/07/03 22:41:40 tedu Exp $"; +static char rcsid[] = "$OpenBSD: mount_null.c,v 1.12 2005/04/08 20:09:37 jaredy Exp $"; #endif #endif /* not lint */ @@ -92,7 +92,7 @@ main(int argc, char *argv[]) usage(); if (realpath(argv[0], target) == 0) - err(1, "realpath %s", target); + err(1, "realpath %s", argv[0]); if (subdir(target, argv[1]) || subdir(argv[1], target)) errx(1, "%s (%s) and %s are not distinct paths", diff --git a/sbin/mount_portal/mount_portal.c b/sbin/mount_portal/mount_portal.c index ea4ba3f6fe1..d1150aa3236 100644 --- a/sbin/mount_portal/mount_portal.c +++ b/sbin/mount_portal/mount_portal.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_portal.c,v 1.26 2003/07/29 18:38:36 deraadt Exp $ */ +/* $OpenBSD: mount_portal.c,v 1.27 2005/04/08 20:09:37 jaredy Exp $ */ /* $NetBSD: mount_portal.c,v 1.8 1996/04/13 01:31:54 jtc Exp $ */ /* @@ -43,7 +43,7 @@ char copyright[] = #if 0 static char sccsid[] = "@(#)mount_portal.c 8.6 (Berkeley) 4/26/95"; #else -static char rcsid[] = "$OpenBSD: mount_portal.c,v 1.26 2003/07/29 18:38:36 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: mount_portal.c,v 1.27 2005/04/08 20:09:37 jaredy Exp $"; #endif #endif /* not lint */ @@ -153,7 +153,7 @@ main(int argc, char *argv[]) */ conf = argv[optind]; if (realpath(argv[optind+1], mountpt) == NULL) - err(1, "realpath %s", mountpt); + err(1, "realpath %s", argv[optind+1]); /* * Construct the listening socket diff --git a/sbin/mount_procfs/mount_procfs.c b/sbin/mount_procfs/mount_procfs.c index 4f860dca0f6..616b589f12a 100644 --- a/sbin/mount_procfs/mount_procfs.c +++ b/sbin/mount_procfs/mount_procfs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_procfs.c,v 1.14 2004/06/22 21:12:00 otto Exp $ */ +/* $OpenBSD: mount_procfs.c,v 1.15 2005/04/08 20:09:37 jaredy Exp $ */ /* $NetBSD: mount_procfs.c,v 1.7 1996/04/13 01:31:59 jtc Exp $ */ /* @@ -44,7 +44,7 @@ char copyright[] = #if 0 static char sccsid[] = "@(#)mount_procfs.c 8.3 (Berkeley) 3/27/94"; #else -static char rcsid[] = "$OpenBSD: mount_procfs.c,v 1.14 2004/06/22 21:12:00 otto Exp $"; +static char rcsid[] = "$OpenBSD: mount_procfs.c,v 1.15 2005/04/08 20:09:37 jaredy Exp $"; #endif #endif /* not lint */ @@ -94,7 +94,7 @@ main(int argc, char *argv[]) usage(); if (realpath(argv[1], path) == NULL) - err(1, "realpath %s", path); + err(1, "realpath %s", argv[1]); args.version = PROCFS_ARGSVERSION; args.flags = altflags; diff --git a/sbin/mount_udf/mount_udf.c b/sbin/mount_udf/mount_udf.c index c2a2c108c11..fca2e122101 100644 --- a/sbin/mount_udf/mount_udf.c +++ b/sbin/mount_udf/mount_udf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_udf.c,v 1.1 2005/03/29 17:54:52 pedro Exp $ */ +/* $OpenBSD: mount_udf.c,v 1.2 2005/04/08 20:09:38 jaredy Exp $ */ /* * Copyright (c) 2005 Pedro Martelletto <pedro@openbsd.org> @@ -63,7 +63,7 @@ main(int argc, char **argv) args.fspec = argv[0]; if (realpath(argv[1], node) == NULL) - err(1, "realpath %s", node); + err(1, "realpath %s", argv[1]); if (mount(MOUNT_UDF, node, flags, &args) < 0) err(1, "mount"); diff --git a/sbin/mount_umap/mount_umap.c b/sbin/mount_umap/mount_umap.c index a14a2cc6de2..8fb4382f893 100644 --- a/sbin/mount_umap/mount_umap.c +++ b/sbin/mount_umap/mount_umap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_umap.c,v 1.14 2003/07/03 22:41:40 tedu Exp $ */ +/* $OpenBSD: mount_umap.c,v 1.15 2005/04/08 20:09:38 jaredy Exp $ */ /* $NetBSD: mount_umap.c,v 1.5 1996/04/13 01:32:05 jtc Exp $ */ /* @@ -43,7 +43,7 @@ char copyright[] = #if 0 static char sccsid[] = "@(#)mount_umap.c 8.3 (Berkeley) 3/27/94"; #else -static char rcsid[] = "$OpenBSD: mount_umap.c,v 1.14 2003/07/03 22:41:40 tedu Exp $"; +static char rcsid[] = "$OpenBSD: mount_umap.c,v 1.15 2005/04/08 20:09:38 jaredy Exp $"; #endif #endif /* not lint */ @@ -125,7 +125,7 @@ main(int argc, char *argv[]) source = argv[0]; if (realpath(argv[1], target) == NULL) - err(1, "realpath %s", target); + err(1, "realpath %s", argv[1]); /* Read in uid mapping data. */ if ((fp = fopen(umapfile, "r")) == NULL) diff --git a/sbin/mount_union/mount_union.c b/sbin/mount_union/mount_union.c index 61de03e584c..a4bff6f6f0c 100644 --- a/sbin/mount_union/mount_union.c +++ b/sbin/mount_union/mount_union.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_union.c,v 1.10 2003/07/03 22:41:40 tedu Exp $ */ +/* $OpenBSD: mount_union.c,v 1.11 2005/04/08 20:09:38 jaredy Exp $ */ /* $NetBSD: mount_union.c,v 1.3 1996/04/13 01:32:11 jtc Exp $ */ /* @@ -43,7 +43,7 @@ char copyright[] = #if 0 static char sccsid[] = "@(#)mount_union.c 8.5 (Berkeley) 3/27/94"; #else -static char rcsid[] = "$OpenBSD: mount_union.c,v 1.10 2003/07/03 22:41:40 tedu Exp $"; +static char rcsid[] = "$OpenBSD: mount_union.c,v 1.11 2005/04/08 20:09:38 jaredy Exp $"; #endif #endif /* not lint */ @@ -103,7 +103,7 @@ main(int argc, char *argv[]) usage(); if (realpath(argv[0], target) == 0) - err(1, "realpath %s", target); + err(1, "realpath %s", argv[0]); if (subdir(target, argv[1]) || subdir(argv[1], target)) errx(1, "%s (%s) and %s are not distinct paths", diff --git a/sbin/mount_xfs/mount_xfs.c b/sbin/mount_xfs/mount_xfs.c index f1c17a6a1e0..fba1b8481e0 100644 --- a/sbin/mount_xfs/mount_xfs.c +++ b/sbin/mount_xfs/mount_xfs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_xfs.c,v 1.7 2003/07/03 22:41:40 tedu Exp $ */ +/* $OpenBSD: mount_xfs.c,v 1.8 2005/04/08 20:09:38 jaredy Exp $ */ /* * Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). @@ -92,7 +92,7 @@ main(int argc, char **argv) usage(); if (realpath(argv[1], path) == NULL) - err(1, "realpath %s", path); + err(1, "realpath %s", argv[1]); if (mount(MOUNT_XFS, path, mntflags, argv[0])) { if (errno == EOPNOTSUPP) diff --git a/sbin/mountd/mountd.c b/sbin/mountd/mountd.c index bd5b6143547..a30d9cb66be 100644 --- a/sbin/mountd/mountd.c +++ b/sbin/mountd/mountd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mountd.c,v 1.62 2003/10/16 20:14:42 millert Exp $ */ +/* $OpenBSD: mountd.c,v 1.63 2005/04/08 20:09:38 jaredy Exp $ */ /* $NetBSD: mountd.c,v 1.31 1996/02/18 11:57:53 fvdl Exp $ */ /* @@ -407,11 +407,15 @@ mntsrv(struct svc_req *rqstp, SVCXPRT *transp) * Get the real pathname and make sure it is a file or * directory that exists. */ - if (realpath(rpcpath, dirpath) == 0 || - stat(dirpath, &stb) < 0 || + if (realpath(rpcpath, dirpath) == NULL) { + bad = errno; + if (debug) + fprintf(stderr, "realpath failed on %s\n", + rpcpath); + strlcpy(dirpath, rpcpath, sizeof(dirpath)); + } else if (stat(dirpath, &stb) < 0 || (!S_ISDIR(stb.st_mode) && !S_ISREG(stb.st_mode)) || statfs(dirpath, &fsb) < 0) { - chdir("/"); /* Just in case realpath doesn't */ if (debug) fprintf(stderr, "stat failed on %s\n", dirpath); bad = ENOENT; /* We will send error reply later */ |