summaryrefslogtreecommitdiffstats
path: root/sys/ntfs/ntfs_vfsops.c
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2013-04-15 15:32:19 +0000
committerjsing <jsing@openbsd.org>2013-04-15 15:32:19 +0000
commitaec3986e4c77ef418b044f5a18f9ea2d3dfdc5ca (patch)
tree0ef0402a8c1ce45cd17a6e33cb6f909d524c8384 /sys/ntfs/ntfs_vfsops.c
parentsync (diff)
downloadwireguard-openbsd-aec3986e4c77ef418b044f5a18f9ea2d3dfdc5ca.tar.xz
wireguard-openbsd-aec3986e4c77ef418b044f5a18f9ea2d3dfdc5ca.zip
Add an f_mntfromspec member to struct statfs, which specifies the name of
the special provided when the mount was requested. This may be the same as the special that was actually used for the mount (e.g. in the case of a device node) or it may be different (e.g. in the case of a DUID). Whilst here, change f_ctime to a 64 bit type and remove the pointless f_spare members. Compatibility goo courtesy of guenther@ ok krw@ millert@
Diffstat (limited to 'sys/ntfs/ntfs_vfsops.c')
-rw-r--r--sys/ntfs/ntfs_vfsops.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/ntfs/ntfs_vfsops.c b/sys/ntfs/ntfs_vfsops.c
index fd08a45c480..120a400fe12 100644
--- a/sys/ntfs/ntfs_vfsops.c
+++ b/sys/ntfs/ntfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntfs_vfsops.c,v 1.33 2013/01/18 05:09:21 jsing Exp $ */
+/* $OpenBSD: ntfs_vfsops.c,v 1.34 2013/04/15 15:32:19 jsing Exp $ */
/* $NetBSD: ntfs_vfsops.c,v 1.7 2003/04/24 07:50:19 christos Exp $ */
/*-
@@ -125,6 +125,7 @@ ntfs_mount(struct mount *mp, const char *path, void *data,
int err = 0;
struct vnode *devvp;
struct ntfs_args args;
+ char fname[MNAMELEN];
char fspec[MNAMELEN];
mode_t amode;
@@ -167,9 +168,11 @@ ntfs_mount(struct mount *mp, const char *path, void *data,
err = copyinstr(args.fspec, fspec, sizeof(fspec), NULL);
if (err)
goto error_1;
- disk_map(fspec, fspec, MNAMELEN, DM_OPENBLCK);
- NDINIT(ndp, LOOKUP, FOLLOW, UIO_SYSSPACE, fspec, p);
+ if (disk_map(fspec, fname, sizeof(fname), DM_OPENBLCK) == -1)
+ bcopy(fspec, fname, sizeof(fname));
+
+ NDINIT(ndp, LOOKUP, FOLLOW, UIO_SYSSPACE, fname, p);
err = namei(ndp);
if (err) {
/* can't get devvp!*/
@@ -238,7 +241,9 @@ ntfs_mount(struct mount *mp, const char *path, void *data,
bzero(mp->mnt_stat.f_mntonname, MNAMELEN);
strlcpy(mp->mnt_stat.f_mntonname, path, MNAMELEN);
bzero(mp->mnt_stat.f_mntfromname, MNAMELEN);
- strlcpy(mp->mnt_stat.f_mntfromname, fspec, MNAMELEN);
+ strlcpy(mp->mnt_stat.f_mntfromname, fname, MNAMELEN);
+ bzero(mp->mnt_stat.f_mntfromspec, MNAMELEN);
+ strlcpy(mp->mnt_stat.f_mntfromspec, fspec, MNAMELEN);
bcopy(&args, &mp->mnt_stat.mount_info.ntfs_args, sizeof(args));
if ( !err) {
err = ntfs_mountfs(devvp, mp, &args, p);