summaryrefslogtreecommitdiff
path: root/sbin/mount_ntfs/mount_ntfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/mount_ntfs/mount_ntfs.c')
-rw-r--r--sbin/mount_ntfs/mount_ntfs.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/sbin/mount_ntfs/mount_ntfs.c b/sbin/mount_ntfs/mount_ntfs.c
index fa602047ede..d0957ec8caa 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.7 2003/07/02 22:38:54 avsm Exp $ */
+/* $OpenBSD: mount_ntfs.c,v 1.8 2003/07/03 22:41:40 tedu Exp $ */
/* $NetBSD: mount_ntfs.c,v 1.9 2003/05/03 15:37:08 christos Exp $ */
/*
@@ -73,7 +73,7 @@ main(int argc, char *argv[])
struct ntfs_args args;
struct stat sb;
int c, mntflags, set_gid, set_uid, set_mask;
- char *dev, *dir, ndir[MAXPATHLEN];
+ char *dev, dir[MAXPATHLEN];
mntflags = set_gid = set_uid = set_mask = 0;
(void)memset(&args, '\0', sizeof(args));
@@ -112,16 +112,8 @@ main(int argc, char *argv[])
usage();
dev = argv[optind];
- dir = argv[optind + 1];
- if (dir[0] != '/') {
- warnx("\"%s\" is a relative path", dir);
- if (getcwd(ndir, sizeof(ndir)) == NULL)
- err(EX_OSERR, "getcwd");
- strlcat(ndir, "/", sizeof(ndir));
- strlcat(ndir, dir, sizeof(ndir));
- dir = ndir;
- warnx("using \"%s\" instead", dir);
- }
+ if (realpath(argv[optind + 1], dir) == NULL)
+ err(1, "realpath %s", dir);
args.fspec = dev;
args.export_info.ex_root = 65534; /* unchecked anyway on DOS fs */