Changeset 100317 in vbox for trunk/src/VBox/Additions/linux
- Timestamp:
- Jun 28, 2023 10:34:21 AM (19 months ago)
- Location:
- trunk/src/VBox/Additions/linux/sharedfolders
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/sharedfolders/mount.vboxsf.c
r98103 r100317 60 60 61 61 #include <iprt/assertcompile.h> 62 #include <iprt/param.h> /* PAGE_SIZE (used by MAX_MNTOPT_STR) */63 62 #include <iprt/string.h> 64 63 … … 543 542 static const char s_szSfNameOpt[] = "sf_name="; 544 543 char szSharedFolderIconved[sizeof(s_szSfNameOpt) - 1 + MAX_HOST_NAME]; 545 char szOpts[MAX_MNTOPT_STR];544 char *pszOpts = NULL; 546 545 struct vbsf_mount_opts opts = 547 546 { … … 572 571 if (!argv[0]) 573 572 argv[0] = "mount.vboxsf"; 573 574 long cbOpts = sysconf(_SC_PAGESIZE); 575 if (cbOpts == -1) 576 panic("Couldn't query system page size errno=%d.\n", errno); 577 578 pszOpts = alloca(cbOpts); 579 if (!pszOpts) 580 panic("Couldn't allocate memory for mount options buffers\n"); 574 581 575 582 /* … … 624 631 */ 625 632 offOpts = 0; 626 szOpts[0] = '\0';627 offOpts = append_option( szOpts, sizeof(szOpts), offOpts, opts.szTTL);628 offOpts = append_option( szOpts, sizeof(szOpts), offOpts, opts.szMsDirCacheTTL);629 offOpts = append_option( szOpts, sizeof(szOpts), offOpts, opts.szMsInodeTTL);630 offOpts = append_option( szOpts, sizeof(szOpts), offOpts, opts.szMaxIoPages);631 offOpts = append_option( szOpts, sizeof(szOpts), offOpts, opts.szDirBuf);632 offOpts = append_option( szOpts, sizeof(szOpts), offOpts, opts.szCacheMode);633 offOpts = append_option( szOpts, sizeof(szOpts), offOpts, opts.szUid);634 offOpts = append_option( szOpts, sizeof(szOpts), offOpts, opts.szGid);635 offOpts = append_option( szOpts, sizeof(szOpts), offOpts, opts.szDMode);636 offOpts = append_option( szOpts, sizeof(szOpts), offOpts, opts.szFMode);637 offOpts = append_option( szOpts, sizeof(szOpts), offOpts, opts.szDMask);638 offOpts = append_option( szOpts, sizeof(szOpts), offOpts, opts.szFMask);639 offOpts = append_option( szOpts, sizeof(szOpts), offOpts, opts.szIoCharset);633 pszOpts[0] = '\0'; 634 offOpts = append_option(pszOpts, cbOpts, offOpts, opts.szTTL); 635 offOpts = append_option(pszOpts, cbOpts, offOpts, opts.szMsDirCacheTTL); 636 offOpts = append_option(pszOpts, cbOpts, offOpts, opts.szMsInodeTTL); 637 offOpts = append_option(pszOpts, cbOpts, offOpts, opts.szMaxIoPages); 638 offOpts = append_option(pszOpts, cbOpts, offOpts, opts.szDirBuf); 639 offOpts = append_option(pszOpts, cbOpts, offOpts, opts.szCacheMode); 640 offOpts = append_option(pszOpts, cbOpts, offOpts, opts.szUid); 641 offOpts = append_option(pszOpts, cbOpts, offOpts, opts.szGid); 642 offOpts = append_option(pszOpts, cbOpts, offOpts, opts.szDMode); 643 offOpts = append_option(pszOpts, cbOpts, offOpts, opts.szFMode); 644 offOpts = append_option(pszOpts, cbOpts, offOpts, opts.szDMask); 645 offOpts = append_option(pszOpts, cbOpts, offOpts, opts.szFMask); 646 offOpts = append_option(pszOpts, cbOpts, offOpts, opts.szIoCharset); 640 647 641 648 /* For pre-2.6 kernels we have to supply the shared folder name as a … … 655 662 strcpy(&szSharedFolderIconved[sizeof(s_szSfNameOpt) - 1], pszSharedFolder); 656 663 } 657 offOpts = append_option( szOpts, sizeof(szOpts), offOpts, szSharedFolderIconved);664 offOpts = append_option(pszOpts, cbOpts, offOpts, szSharedFolderIconved); 658 665 } 659 666 … … 661 668 * Do the actual mounting. 662 669 */ 663 err = mount(pszSharedFolder, pszMountPoint, "vboxsf", opts.fFlags, szOpts);670 err = mount(pszSharedFolder, pszMountPoint, "vboxsf", opts.fFlags, pszOpts); 664 671 saved_errno = errno; 665 672 … … 674 681 if (!nomtab) 675 682 { 676 err = vbsfmount_complete(pszSharedFolder, pszMountPoint, opts.fFlags, szOpts);683 err = vbsfmount_complete(pszSharedFolder, pszMountPoint, opts.fFlags, pszOpts); 677 684 switch (err) 678 685 { -
trunk/src/VBox/Additions/linux/sharedfolders/vbsfmount.h
r98103 r100317 35 35 #endif 36 36 37 /* Linux constrains the size of data mount argument to PAGE_SIZE - 1. */38 #define MAX_MNTOPT_STR PAGE_SIZE39 37 #define MAX_HOST_NAME 256 40 38 #define MAX_NLS_NAME 32
Note:
See TracChangeset
for help on using the changeset viewer.