aboutsummaryrefslogtreecommitdiff
path: root/sbin/mount_umapfs
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>1999-10-09 11:54:14 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>1999-10-09 11:54:14 +0000
commit73dd3167345391095dd7c75aefa870a5bce92397 (patch)
tree33cadf04c808cb0644aedaa306f8f3c0987ba3fe /sbin/mount_umapfs
parent1d64c295bbdb773ca3d62cdb5a9eec06e12799c8 (diff)
downloadsrc-73dd3167345391095dd7c75aefa870a5bce92397.tar.gz
src-73dd3167345391095dd7c75aefa870a5bce92397.zip
mount* fixes from Martin Blapp <mb@imp.ch>:
Made mount more userfriendly (bad slashes are now filtered out) and we remove in mount_nfs trailing slashes if there are any. Fixed mount_xxx binarys to resolve with realpath(3) the mountpoint. Translate the deprecated nfs-syntax with '@' to ':' . The ':' syntax has now precedence, but '@' still works. Notify the user that the '@' syntax should not be used. PR: 7846 PR: 13692 Submitted by: Martin Blapp <mb@imp.ch> Reviewed by: phk
Notes
Notes: svn path=/head/; revision=52055
Diffstat (limited to 'sbin/mount_umapfs')
-rw-r--r--sbin/mount_umapfs/mount_umapfs.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sbin/mount_umapfs/mount_umapfs.c b/sbin/mount_umapfs/mount_umapfs.c
index 888682c3b98e..0aa7b8c075a3 100644
--- a/sbin/mount_umapfs/mount_umapfs.c
+++ b/sbin/mount_umapfs/mount_umapfs.c
@@ -98,7 +98,8 @@ main(argc, argv)
FILE *fp, *gfp;
u_long gmapdata[GMAPFILEENTRIES][2], mapdata[MAPFILEENTRIES][2];
int ch, count, gnentries, mntflags, nentries;
- char *gmapfile, *mapfile, *source, *target, buf[20];
+ char *gmapfile, *mapfile, buf[20];
+ char source[MAXPATHLEN], target[MAXPATHLEN];
struct vfsconf vfc;
int error;
@@ -125,8 +126,9 @@ main(argc, argv)
if (argc != 2 || mapfile == NULL || gmapfile == NULL)
usage();
- source = argv[0];
- target = argv[1];
+ /* resolve both target and source with realpath(3) */
+ (void)checkpath(argv[0], source);
+ (void)checkpath(argv[1], target);
/* Read in uid mapping data. */
if ((fp = fopen(mapfile, "r")) == NULL)