Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109721975
D39273.id119470.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D39273.id119470.diff
View Options
diff --git a/sys/fs/tarfs/tarfs_vfsops.c b/sys/fs/tarfs/tarfs_vfsops.c
--- a/sys/fs/tarfs/tarfs_vfsops.c
+++ b/sys/fs/tarfs/tarfs_vfsops.c
@@ -108,7 +108,7 @@
static vfs_fhtovp_t tarfs_fhtovp;
static const char *tarfs_opts[] = {
- "from", "gid", "mode", "uid", "verify",
+ "as", "from", "gid", "mode", "uid", "verify",
NULL
};
@@ -905,11 +905,12 @@
struct tarfs_mount *tmp = NULL;
struct thread *td = curthread;
struct vnode *vp;
+ char *as;
char *from;
uid_t root_uid;
gid_t root_gid;
mode_t root_mode;
- int error, flags, len;
+ int error, flags, aslen, len;
if (mp->mnt_flag & MNT_UPDATE)
return (EOPNOTSUPP);
@@ -936,10 +937,16 @@
error = vfs_getopt(mp->mnt_optnew, "from", (void **)&from, &len);
if (error != 0 || from[len - 1] != '\0')
return (EINVAL);
+ error = vfs_getopt(mp->mnt_optnew, "as", (void **)&as, &aslen);
+ if (error != 0 || as[aslen - 1] != '\0')
+ as = from;
/* Find the source tarball */
- TARFS_DPF(FS, "%s(%s, uid=%u, gid=%u, mode=%o)\n", __func__,
- from, root_uid, root_gid, root_mode);
+ TARFS_DPF(FS, "%s(%s%s%s, uid=%u, gid=%u, mode=%o)\n", __func__,
+ from,
+ (as != from) ? " as " : "",
+ (as != from) ? as : "",
+ root_uid, root_gid, root_mode);
flags = FREAD;
if (vfs_flagopt(mp->mnt_optnew, "verify", NULL, 0)) {
flags |= O_VERIFY;
@@ -995,7 +1002,7 @@
MNT_IUNLOCK(mp);
vfs_getnewfsid(mp);
- vfs_mountedfrom(mp, from);
+ vfs_mountedfrom(mp, as);
TARFS_DPF(FS, "%s: success\n", __func__);
return (0);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Feb 9, 6:06 PM (17 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16560207
Default Alt Text
D39273.id119470.diff (1 KB)
Attached To
Mode
D39273: tarfs_mount allow control of vfs_mountedfrom
Attached
Detach File
Event Timeline
Log In to Comment