Changeset 39062 in vbox
- Timestamp:
- Oct 20, 2011 4:14:11 PM (13 years ago)
- Location:
- trunk/src/VBox/Additions/solaris/SharedFolders
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/solaris/SharedFolders/vboxfs_vfs.c
r33540 r39062 239 239 uid_t uid = 0; 240 240 gid_t gid = 0; 241 mode_t dmode = ~0; 242 mode_t fmode = ~0; 243 mode_t dmask = 0; 244 mode_t fmask = 0; 241 245 int stat_ttl = DEF_STAT_TTL_MS; 242 246 int fsync = 0; … … 303 307 304 308 /* 309 * dmode to use for all directories 310 */ 311 if (vfs_optionisset(vfsp, "dmode", &optval) && 312 ddi_strtol(optval, NULL, 10, &val) == 0 && 313 (mode_t)val == val) 314 dmode = val; 315 316 /* 317 * fmode to use for all files 318 */ 319 if (vfs_optionisset(vfsp, "fmode", &optval) && 320 ddi_strtol(optval, NULL, 10, &val) == 0 && 321 (mode_t)val == val) 322 fmode = val; 323 324 /* 325 * dmask to use for all directories 326 */ 327 if (vfs_optionisset(vfsp, "dmask", &optval) && 328 ddi_strtol(optval, NULL, 10, &val) == 0 && 329 (mode_t)val == val) 330 dmask = val; 331 332 /* 333 * fmask to use for all files 334 */ 335 if (vfs_optionisset(vfsp, "fmask", &optval) && 336 ddi_strtol(optval, NULL, 10, &val) == 0 && 337 (mode_t)val == val) 338 fmask = val; 339 340 /* 305 341 * ttl to use for stat caches 306 342 */ … … 367 403 sffs->sf_uid = uid; 368 404 sffs->sf_gid = gid; 405 sffs->sf_dmode = dmode; 406 sffs->sf_fmode = fmode; 407 sffs->sf_dmask = dmask; 408 sffs->sf_fmask = fmask; 369 409 sffs->sf_stat_ttl = stat_ttl; 370 410 sffs->sf_fsync = fsync; … … 515 555 Log((" uid_t sf_uid = 0x%l\n", (ulong_t)sffs->sf_uid)); 516 556 Log((" gid_t sf_gid = 0x%l\n", (ulong_t)sffs->sf_gid)); 557 Log((" mode_t sf_dmode = 0x%l\n", (ulong_t)sffs->sf_dmode)); 558 Log((" mode_t sf_fmode = 0x%l\n", (ulong_t)sffs->sf_fmode)); 559 Log((" mode_t sf_dmask = 0x%l\n", (ulong_t)sffs->sf_dmask)); 560 Log((" mode_t sf_fmask = 0x%l\n", (ulong_t)sffs->sf_fmask)); 517 561 Log((" char *sf_share_name = %s\n", sffs->sf_share_name)); 518 562 Log((" char *sf_mntpath = %s\n", sffs->sf_mntpath)); -
trunk/src/VBox/Additions/solaris/SharedFolders/vboxfs_vfs.h
r31691 r39062 40 40 uid_t sf_uid; /* owner of all shared folders */ 41 41 gid_t sf_gid; /* group of all shared folders */ 42 mode_t sf_dmode; /* mode of all directories */ 43 mode_t sf_fmode; /* mode of all files */ 44 mode_t sf_dmask; /* mask of all directories */ 45 mode_t sf_fmask; /* mask of all files */ 42 46 int sf_stat_ttl; /* ttl for stat caches (in ms) */ 43 47 int sf_fsync; /* whether to honor fsync or not */ -
trunk/src/VBox/Additions/solaris/SharedFolders/vboxfs_vnode.c
r39009 r39062 858 858 vap->va_mode = mode & MODEMASK; 859 859 if (S_ISDIR(mode)) 860 { 860 861 vap->va_type = VDIR; 862 vap->va_mode = sffs->sf_dmode != ~0 ? (sffs->sf_dmode & 0777) : vap->va_mode; 863 vap->va_mode &= ~sffs->sf_dmask; 864 vap->va_mode |= S_IFDIR; 865 } 861 866 else if (S_ISREG(mode)) 867 { 862 868 vap->va_type = VREG; 869 vap->va_mode = sffs->sf_fmask != ~0 ? (sffs->sf_fmode & 0777) : vap->va_mode; 870 vap->va_mode &= ~sffs->sf_fmask; 871 vap->va_mode |= S_IFREG; 872 } 863 873 else if (S_ISFIFO(mode)) 864 874 vap->va_type = VFIFO; … … 868 878 vap->va_type = VBLK; 869 879 else if (S_ISLNK(mode)) 880 { 870 881 vap->va_type = VLNK; 882 vap->va_mode = sffs->sf_fmask != ~0 ? (sffs->sf_fmode & 0777) : vap->va_mode; 883 vap->va_mode &= ~sffs->sf_fmask; 884 vap->va_mode |= S_IFLNK; 885 } 871 886 else if (S_ISSOCK(mode)) 872 887 vap->va_type = VSOCK;
Note:
See TracChangeset
for help on using the changeset viewer.