Changeset 75433 in vbox for trunk/src/VBox/Additions/linux
- Timestamp:
- Nov 13, 2018 10:34:39 PM (6 years ago)
- Location:
- trunk/src/VBox/Additions/linux/sharedfolders
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/sharedfolders/mount.vboxsf.c
r69500 r75433 402 402 mntinf.signature[2] = VBSF_MOUNT_SIGNATURE_BYTE_2; 403 403 mntinf.length = sizeof(mntinf); 404 mntinf.tag[0] = '\0'; 404 405 405 406 if (getuid()) -
trunk/src/VBox/Additions/linux/sharedfolders/vbsfmount.h
r72627 r75433 59 59 int dmask; /* umask applied to directories */ 60 60 int fmask; /* umask applied to regular files */ 61 char tag[32]; /**< Mount tag for VBoxService automounter. @since 6.0 */ 61 62 }; 62 63 -
trunk/src/VBox/Additions/linux/sharedfolders/vfsmod.c
r75407 r75433 156 156 sf_g->gid = info->gid; 157 157 158 if ((unsigned)info->length >= sizeof(struct vbsf_mount_info_new)) {158 if ((unsigned)info->length >= RT_UOFFSETOF(struct vbsf_mount_info_new, tag)) { 159 159 /* new fields */ 160 160 sf_g->dmode = info->dmode; … … 165 165 sf_g->dmode = ~0; 166 166 sf_g->fmode = ~0; 167 } 168 169 if ((unsigned)info->length >= sizeof(struct vbsf_mount_info_new)) { 170 AssertCompile(sizeof(sf_g->tag) >= sizeof(info->tag)); 171 memcpy(sf_g->tag, info->tag, sizeof(info->tag)); 172 sf_g->tag[sizeof(sf_g->tag) - 1] = '\0'; 173 } else { 174 sf_g->tag[0] = '\0'; 167 175 } 168 176 … … 457 465 sf_g->gid = info->gid; 458 466 sf_g->ttl = info->ttl; 459 sf_g->dmode = info->dmode; 460 sf_g->fmode = info->fmode; 461 sf_g->dmask = info->dmask; 462 sf_g->fmask = info->fmask; 467 if ((unsigned)info->length >= RT_UOFFSETOF(struct vbsf_mount_info_new, tag)) { 468 sf_g->dmode = info->dmode; 469 sf_g->fmode = info->fmode; 470 sf_g->dmask = info->dmask; 471 sf_g->fmask = info->fmask; 472 } else { 473 sf_g->dmode = ~0; 474 sf_g->fmode = ~0; 475 } 476 if ((unsigned)info->length >= sizeof(struct vbsf_mount_info_new)) { 477 AssertCompile(sizeof(sf_g->tag) >= sizeof(info->tag)); 478 memcpy(sf_g->tag, info->tag, sizeof(info->tag)); 479 sf_g->tag[sizeof(sf_g->tag) - 1] = '\0'; 480 } else { 481 sf_g->tag[0] = '\0'; 482 } 463 483 } 464 484 } … … 479 499 } 480 500 501 /** Show mount options. */ 502 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0) 503 static int sf_show_options(struct seq_file *m, struct vfsmount *mnt) 504 #else 505 static int sf_show_options(struct seq_file *m, struct dentry *root) 506 #endif 507 { 508 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0) 509 struct super_block *sb = mnt->mnt_sb; 510 #else 511 struct super_block *sb = root->d_sb; 512 #endif 513 struct sf_glob_info *sf_g = GET_GLOB_INFO(sb); 514 if (sf_g) { 515 seq_printf(m, ",uid=%u,gid=%u,ttl=%u,dmode=0%o,fmode=0%o,dmask=0%o,fmask=0%o", 516 sf_g->uid, sf_g->gid, sf_g->ttl, sf_g->dmode, sf_g->fmode, sf_g->dmask, sf_g->fmask); 517 if (sf_g->tag[0] != '\0') { 518 seq_puts(m, ",tag="); 519 seq_escape(m, sf_g->tag, " \t\n\\"); 520 } 521 } 522 523 return 0; 524 } 525 481 526 /** @todo Implement show_options (forever) or maybe set s_options (2.6.25+). 482 527 * Necessary for the automounter tagging. */ … … 492 537 .put_super = sf_put_super, 493 538 .statfs = sf_statfs, 494 .remount_fs = sf_remount_fs 539 .remount_fs = sf_remount_fs, 540 .show_options = sf_show_options 495 541 }; 496 542 -
trunk/src/VBox/Additions/linux/sharedfolders/vfsmod.h
r72627 r75433 58 58 struct backing_dev_info bdi; 59 59 #endif 60 char tag[32]; /**< Mount tag for VBoxService automounter. @since 6.0 */ 60 61 }; 61 62
Note:
See TracChangeset
for help on using the changeset viewer.