-
diff --exclude=AutoConfig.kmk --exclude=configure.log --exclude=env.sh --exclude='*.pyc' --exclude=out -Nur VirtualBox-3.2.6_OSE/include/iprt/path.h VirtualBox-3.2.6_OSE-symlink/include/iprt/path.h
|
old
|
new
|
|
| 632 | 632 | RTR3DECL(int) RTPathQueryInfoEx(const char *pszPath, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags); |
| 633 | 633 | |
| 634 | 634 | /** |
| | 635 | * Return the destination of a symbolic link. |
| | 636 | * |
| | 637 | * @returns IPRT status code. |
| | 638 | * @param pszPath Path to the file system object. |
| | 639 | * @param pszDest Where to store the destination path. |
| | 640 | * @param cchPath Size of the buffer. |
| | 641 | */ |
| | 642 | RTR3DECL(int) RTReadlink(const char *pszPath, char *pszDest, uint32_t cchPath); |
| | 643 | |
| | 644 | /** |
| 635 | 645 | * Changes the mode flags of a file system object. |
| 636 | 646 | * |
| 637 | 647 | * The API requires at least one of the mode flag sets (Unix/Dos) to |
-
diff --exclude=AutoConfig.kmk --exclude=configure.log --exclude=env.sh --exclude='*.pyc' --exclude=out -Nur VirtualBox-3.2.6_OSE/include/VBox/shflsvc.h VirtualBox-3.2.6_OSE-symlink/include/VBox/shflsvc.h
|
old
|
new
|
|
| 98 | 98 | #define SHFL_FN_SET_UTF8 (16) |
| 99 | 99 | /** Map folder */ |
| 100 | 100 | #define SHFL_FN_MAP_FOLDER (17) |
| | 101 | /** Read symlink destination */ |
| | 102 | #define SHFL_FN_READLINK (18) |
| 101 | 103 | |
| 102 | 104 | /** @} */ |
| 103 | 105 | |
| … |
… |
|
| 855 | 857 | |
| 856 | 858 | |
| 857 | 859 | /** |
| | 860 | * SHFL_FN_READLINK |
| | 861 | */ |
| | 862 | |
| | 863 | /** Parameters structure. */ |
| | 864 | typedef struct _VBoxSFReadlink |
| | 865 | { |
| | 866 | VBoxGuestHGCMCallInfo callInfo; |
| | 867 | |
| | 868 | /** pointer, in: SHFLROOT |
| | 869 | * Root handle of the mapping which name is queried. |
| | 870 | */ |
| | 871 | HGCMFunctionParameter root; |
| | 872 | |
| | 873 | /** pointer, in: |
| | 874 | * Points to SHFLSTRING buffer. |
| | 875 | */ |
| | 876 | HGCMFunctionParameter path; |
| | 877 | |
| | 878 | /** pointer, out: |
| | 879 | * Buffer to place data to. |
| | 880 | */ |
| | 881 | HGCMFunctionParameter buffer; |
| | 882 | |
| | 883 | } VBoxSFReadlink; |
| | 884 | |
| | 885 | /** Number of parameters */ |
| | 886 | #define SHFL_CPARMS_READLINK (3) |
| | 887 | |
| | 888 | |
| | 889 | |
| | 890 | /** |
| 858 | 891 | * SHFL_FN_INFORMATION |
| 859 | 892 | */ |
| 860 | 893 | |
-
diff --exclude=AutoConfig.kmk --exclude=configure.log --exclude=env.sh --exclude='*.pyc' --exclude=out -Nur VirtualBox-3.2.6_OSE/src/VBox/Additions/common/VBoxGuestLib/VBoxCalls.c VirtualBox-3.2.6_OSE-symlink/src/VBox/Additions/common/VBoxGuestLib/VBoxCalls.c
|
old
|
new
|
|
| 597 | 597 | return rc; |
| 598 | 598 | } |
| 599 | 599 | |
| | 600 | DECLVBGL(int) vboxReadlink (PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pParsedPath, |
| | 601 | uint32_t cbBuffer, uint8_t *pBuffer) |
| | 602 | { |
| | 603 | int rc = VINF_SUCCESS; |
| | 604 | |
| | 605 | VBoxSFReadlink data; |
| | 606 | |
| | 607 | VBOX_INIT_CALL(&data.callInfo, READLINK, pClient); |
| | 608 | |
| | 609 | data.root.type = VMMDevHGCMParmType_32bit; |
| | 610 | data.root.u.value32 = pMap->root; |
| | 611 | |
| | 612 | data.path.type = VMMDevHGCMParmType_LinAddr; |
| | 613 | data.path.u.Pointer.size = ShflStringSizeOfBuffer (pParsedPath); |
| | 614 | data.path.u.Pointer.u.linearAddr = (uintptr_t)pParsedPath; |
| | 615 | |
| | 616 | data.buffer.type = VMMDevHGCMParmType_LinAddr_Out; |
| | 617 | data.buffer.u.Pointer.size = cbBuffer; |
| | 618 | data.buffer.u.Pointer.u.linearAddr = (uintptr_t)pBuffer; |
| | 619 | |
| | 620 | rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data)); |
| | 621 | |
| | 622 | /* Log(("VBOXSF: VBoxSF::vboxCallReadline: " |
| | 623 | "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); |
| | 624 | */ |
| | 625 | if (RT_SUCCESS (rc)) |
| | 626 | { |
| | 627 | rc = data.callInfo.result; |
| | 628 | } |
| | 629 | return rc; |
| | 630 | } |
| | 631 | |
| 600 | 632 | DECLVBGL(int) vboxCallFSInfo(PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile, |
| 601 | 633 | uint32_t flags, uint32_t *pcbBuffer, PSHFLDIRINFO pBuffer) |
| 602 | 634 | { |
-
diff --exclude=AutoConfig.kmk --exclude=configure.log --exclude=env.sh --exclude='*.pyc' --exclude=out -Nur VirtualBox-3.2.6_OSE/src/VBox/Additions/common/VBoxGuestLib/VBoxCalls.h VirtualBox-3.2.6_OSE-symlink/src/VBox/Additions/common/VBoxGuestLib/VBoxCalls.h
|
old
|
new
|
|
| 172 | 172 | |
| 173 | 173 | DECLVBGL(int) vboxCallDirInfo (PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile,PSHFLSTRING ParsedPath, uint32_t flags, |
| 174 | 174 | uint32_t index, uint32_t *pcbBuffer, PSHFLDIRINFO pBuffer, uint32_t *pcFiles); |
| | 175 | DECLVBGL(int) vboxReadlink (PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING ParsedPath, uint32_t pcbBuffer, uint8_t *pBuffer); |
| 175 | 176 | DECLVBGL(int) vboxCallFSInfo (PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile, uint32_t flags, uint32_t *pcbBuffer, PSHFLDIRINFO pBuffer); |
| 176 | 177 | |
| 177 | 178 | DECLVBGL(int) vboxCallMapFolder (PVBSFCLIENT pClient, PSHFLSTRING szFolderName, PVBSFMAP pMap); |
-
diff --exclude=AutoConfig.kmk --exclude=configure.log --exclude=env.sh --exclude='*.pyc' --exclude=out -Nur VirtualBox-3.2.6_OSE/src/VBox/Additions/linux/sharedfolders/files_vboxsf VirtualBox-3.2.6_OSE-symlink/src/VBox/Additions/linux/sharedfolders/files_vboxsf
|
old
|
new
|
|
| 70 | 70 | ${PATH_ROOT}/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h=>r0drv/linux/the-linux-kernel.h \ |
| 71 | 71 | ${PATH_ROOT}/src/VBox/Additions/linux/sharedfolders/Makefile.module=>Makefile \ |
| 72 | 72 | ${PATH_ROOT}/src/VBox/Additions/linux/sharedfolders/dirops.c=>dirops.c \ |
| | 73 | ${PATH_ROOT}/src/VBox/Additions/linux/sharedfolders/lnkops.c=>lnkops.c \ |
| 73 | 74 | ${PATH_ROOT}/src/VBox/Additions/linux/sharedfolders/regops.c=>regops.c \ |
| 74 | 75 | ${PATH_ROOT}/src/VBox/Additions/linux/sharedfolders/utils.c=>utils.c \ |
| 75 | 76 | ${PATH_ROOT}/src/VBox/Additions/linux/sharedfolders/vbsfmount.h=>vbsfmount.h \ |
-
diff --exclude=AutoConfig.kmk --exclude=configure.log --exclude=env.sh --exclude='*.pyc' --exclude=out -Nur VirtualBox-3.2.6_OSE/src/VBox/Additions/linux/sharedfolders/lnkops.c VirtualBox-3.2.6_OSE-symlink/src/VBox/Additions/linux/sharedfolders/lnkops.c
|
old
|
new
|
|
| | 1 | #include "vfsmod.h" |
| | 2 | |
| | 3 | static void *sf_follow_link(struct dentry *dentry, struct nameidata *nd) |
| | 4 | { |
| | 5 | struct inode *inode = dentry->d_inode; |
| | 6 | struct sf_glob_info *sf_g = GET_GLOB_INFO(inode->i_sb); |
| | 7 | struct sf_inode_info *sf_i = GET_INODE_INFO(inode); |
| | 8 | /* XXX check: cargo-culted from sysfs; in particular, assuming page size >= PATH_MAX */ |
| | 9 | int error = -ENOMEM; |
| | 10 | unsigned long page = get_zeroed_page(GFP_KERNEL); |
| | 11 | int rc; |
| | 12 | |
| | 13 | if (page) { |
| | 14 | error = 0; |
| | 15 | rc = vboxReadlink(&client_handle, &sf_g->map, sf_i->path, PATH_MAX, (char *)page); |
| | 16 | if (RT_FAILURE(rc)) { |
| | 17 | LogFunc(("vboxReadlink failed, caller=%s, rc=%Rrc\n", |
| | 18 | __func__, rc)); |
| | 19 | error = -EPROTO; |
| | 20 | } |
| | 21 | } |
| | 22 | nd_set_link(nd, error ? ERR_PTR(error) : (char *)page); |
| | 23 | return NULL; |
| | 24 | } |
| | 25 | |
| | 26 | static void sf_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie) |
| | 27 | { |
| | 28 | char *page = nd_get_link(nd); |
| | 29 | if (!IS_ERR(page)) |
| | 30 | free_page((unsigned long)page); |
| | 31 | } |
| | 32 | |
| | 33 | struct inode_operations sf_lnk_iops = { |
| | 34 | .readlink = generic_readlink, |
| | 35 | .follow_link = sf_follow_link, |
| | 36 | .put_link = sf_put_link |
| | 37 | }; |
-
diff --exclude=AutoConfig.kmk --exclude=configure.log --exclude=env.sh --exclude='*.pyc' --exclude=out -Nur VirtualBox-3.2.6_OSE/src/VBox/Additions/linux/sharedfolders/Makefile.kmk VirtualBox-3.2.6_OSE-symlink/src/VBox/Additions/linux/sharedfolders/Makefile.kmk
|
old
|
new
|
|
| 65 | 65 | vfsmod.c \ |
| 66 | 66 | utils.c \ |
| 67 | 67 | dirops.c \ |
| | 68 | lnkops.c \ |
| 68 | 69 | regops.c |
| 69 | 70 | vboxsf_LIBS = \ |
| 70 | 71 | $(VBOX_LIB_VBGL_R0) |
-
diff --exclude=AutoConfig.kmk --exclude=configure.log --exclude=env.sh --exclude='*.pyc' --exclude=out -Nur VirtualBox-3.2.6_OSE/src/VBox/Additions/linux/sharedfolders/Makefile.module VirtualBox-3.2.6_OSE-symlink/src/VBox/Additions/linux/sharedfolders/Makefile.module
|
old
|
new
|
|
| 62 | 62 | OBJS = \ |
| 63 | 63 | vfsmod.o \ |
| 64 | 64 | dirops.o \ |
| | 65 | lnkops.o \ |
| 65 | 66 | regops.o \ |
| 66 | 67 | utils.o \ |
| 67 | 68 | GenericRequest.o \ |
-
diff --exclude=AutoConfig.kmk --exclude=configure.log --exclude=env.sh --exclude='*.pyc' --exclude=out -Nur VirtualBox-3.2.6_OSE/src/VBox/Additions/linux/sharedfolders/utils.c VirtualBox-3.2.6_OSE-symlink/src/VBox/Additions/linux/sharedfolders/utils.c
|
old
|
new
|
|
| 75 | 75 | sf_init_inode(struct sf_glob_info *sf_g, struct inode *inode, |
| 76 | 76 | RTFSOBJINFO *info) |
| 77 | 77 | { |
| 78 | | int is_dir; |
| | 78 | int is_dir, is_symlink; |
| 79 | 79 | RTFSOBJATTR *attr; |
| 80 | 80 | int mode; |
| 81 | 81 | |
| … |
… |
|
| 83 | 83 | |
| 84 | 84 | attr = &info->Attr; |
| 85 | 85 | is_dir = RTFS_IS_DIRECTORY(attr->fMode); |
| | 86 | is_symlink = RTFS_IS_SYMLINK(attr->fMode); |
| 86 | 87 | |
| 87 | 88 | #define mode_set(r) attr->fMode & (RTFS_UNIX_##r) ? (S_##r) : 0; |
| 88 | 89 | mode = mode_set(ISUID); |
| … |
… |
|
| 116 | 117 | in the directory plus two (. ..) */ |
| 117 | 118 | inode->i_nlink = 1; |
| 118 | 119 | } |
| | 120 | else if (is_symlink) { |
| | 121 | inode->i_mode = sf_g->fmode != ~0 ? (sf_g->fmode & 0777): mode; |
| | 122 | inode->i_mode &= ~sf_g->fmask; |
| | 123 | inode->i_mode |= S_IFLNK; |
| | 124 | inode->i_op = &sf_lnk_iops; |
| | 125 | inode->i_nlink = 1; |
| | 126 | } |
| 119 | 127 | else { |
| 120 | 128 | inode->i_mode = sf_g->fmode != ~0 ? (sf_g->fmode & 0777): mode; |
| 121 | 129 | inode->i_mode &= ~sf_g->fmask; |
-
diff --exclude=AutoConfig.kmk --exclude=configure.log --exclude=env.sh --exclude='*.pyc' --exclude=out -Nur VirtualBox-3.2.6_OSE/src/VBox/Additions/linux/sharedfolders/vfsmod.h VirtualBox-3.2.6_OSE-symlink/src/VBox/Additions/linux/sharedfolders/vfsmod.h
|
old
|
new
|
|
| 81 | 81 | |
| 82 | 82 | /* forward declarations */ |
| 83 | 83 | extern struct inode_operations sf_dir_iops; |
| | 84 | extern struct inode_operations sf_lnk_iops; |
| 84 | 85 | extern struct inode_operations sf_reg_iops; |
| 85 | 86 | extern struct file_operations sf_dir_fops; |
| 86 | 87 | extern struct file_operations sf_reg_fops; |
-
diff --exclude=AutoConfig.kmk --exclude=configure.log --exclude=env.sh --exclude='*.pyc' --exclude=out -Nur VirtualBox-3.2.6_OSE/src/VBox/HostServices/SharedFolders/service.cpp VirtualBox-3.2.6_OSE-symlink/src/VBox/HostServices/SharedFolders/service.cpp
|
old
|
new
|
|
| 775 | 775 | break; |
| 776 | 776 | } |
| 777 | 777 | |
| | 778 | /* Read symlink destination */ |
| | 779 | case SHFL_FN_READLINK: |
| | 780 | { |
| | 781 | Log(("svcCall: SHFL_FN_READLINK\n")); |
| | 782 | |
| | 783 | /* Verify parameter count and types. */ |
| | 784 | if (cParms != SHFL_CPARMS_READLINK) |
| | 785 | { |
| | 786 | rc = VERR_INVALID_PARAMETER; |
| | 787 | } |
| | 788 | else |
| | 789 | if ( paParms[0].type != VBOX_HGCM_SVC_PARM_32BIT /* root */ |
| | 790 | || paParms[1].type != VBOX_HGCM_SVC_PARM_PTR /* path */ |
| | 791 | || paParms[2].type != VBOX_HGCM_SVC_PARM_PTR /* buffer */ |
| | 792 | ) |
| | 793 | { |
| | 794 | rc = VERR_INVALID_PARAMETER; |
| | 795 | } |
| | 796 | else |
| | 797 | { |
| | 798 | /* Fetch parameters. */ |
| | 799 | SHFLROOT root = (SHFLROOT)paParms[0].u.uint32; |
| | 800 | SHFLSTRING *pPath = (SHFLSTRING *)paParms[1].u.pointer.addr; |
| | 801 | uint32_t cbPath = paParms[1].u.pointer.size; |
| | 802 | uint8_t *pBuffer = (uint8_t *)paParms[2].u.pointer.addr; |
| | 803 | uint32_t cbBuffer = paParms[2].u.pointer.size; |
| | 804 | |
| | 805 | /* Verify parameters values. */ |
| | 806 | if ( !ShflStringIsValidOrNull(pPath, paParms[1].u.pointer.size) |
| | 807 | ) |
| | 808 | { |
| | 809 | rc = VERR_INVALID_PARAMETER; |
| | 810 | } |
| | 811 | else |
| | 812 | { |
| | 813 | /* Execute the function. */ |
| | 814 | rc = vbsfReadlink (pClient, root, pPath, cbPath, pBuffer, cbBuffer); |
| | 815 | |
| | 816 | if (RT_SUCCESS(rc)) |
| | 817 | { |
| | 818 | /* Update parameters.*/ |
| | 819 | ; /* none */ |
| | 820 | } |
| | 821 | } |
| | 822 | } |
| | 823 | |
| | 824 | break; |
| | 825 | } |
| | 826 | |
| 778 | 827 | /* Legacy interface */ |
| 779 | 828 | case SHFL_FN_MAP_FOLDER_OLD: |
| 780 | 829 | { |
-
diff --exclude=AutoConfig.kmk --exclude=configure.log --exclude=env.sh --exclude='*.pyc' --exclude=out -Nur VirtualBox-3.2.6_OSE/src/VBox/HostServices/SharedFolders/vbsf.cpp VirtualBox-3.2.6_OSE-symlink/src/VBox/HostServices/SharedFolders/vbsf.cpp
|
old
|
new
|
|
| 138 | 138 | { |
| 139 | 139 | size_t cbDirEntrySize = cbDirEntry; |
| 140 | 140 | |
| 141 | | rc = RTDirReadEx(hSearch, pDirEntry, &cbDirEntrySize, RTFSOBJATTRADD_NOTHING, RTPATH_F_FOLLOW_LINK); |
| | 141 | rc = RTDirReadEx(hSearch, pDirEntry, &cbDirEntrySize, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK); |
| 142 | 142 | if (rc == VERR_NO_MORE_FILES) |
| 143 | 143 | break; |
| 144 | 144 | |
| … |
… |
|
| 492 | 492 | } |
| 493 | 493 | |
| 494 | 494 | /** @todo don't check when creating files or directories; waste of time */ |
| 495 | | rc = RTPathQueryInfoEx(pszFullPath, &info, RTFSOBJATTRADD_NOTHING, RTPATH_F_FOLLOW_LINK); |
| | 495 | rc = RTPathQueryInfoEx(pszFullPath, &info, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK); |
| 496 | 496 | if (rc == VERR_FILE_NOT_FOUND || rc == VERR_PATH_NOT_FOUND) |
| 497 | 497 | { |
| 498 | 498 | uint32_t len = (uint32_t)strlen(pszFullPath); |
| … |
… |
|
| 506 | 506 | if (*src == RTPATH_DELIMITER) |
| 507 | 507 | { |
| 508 | 508 | *src = 0; |
| 509 | | rc = RTPathQueryInfoEx(pszFullPath, &info, RTFSOBJATTRADD_NOTHING, RTPATH_F_FOLLOW_LINK); |
| | 509 | rc = RTPathQueryInfoEx(pszFullPath, &info, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK); |
| 510 | 510 | *src = RTPATH_DELIMITER; |
| 511 | 511 | if (rc == VINF_SUCCESS) |
| 512 | 512 | { |
| … |
… |
|
| 542 | 542 | { |
| 543 | 543 | fEndOfString = false; |
| 544 | 544 | *end = 0; |
| 545 | | rc = RTPathQueryInfoEx(src, &info, RTFSOBJATTRADD_NOTHING, RTPATH_F_FOLLOW_LINK); |
| | 545 | rc = RTPathQueryInfoEx(src, &info, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK); |
| 546 | 546 | Assert(rc == VINF_SUCCESS || rc == VERR_FILE_NOT_FOUND || rc == VERR_PATH_NOT_FOUND); |
| 547 | 547 | } |
| 548 | 548 | else |
| … |
… |
|
| 882 | 882 | RTFSOBJINFO info; |
| 883 | 883 | |
| 884 | 884 | /** @todo Possible race left here. */ |
| 885 | | if (RT_SUCCESS(RTPathQueryInfoEx(pszPath, &info, RTFSOBJATTRADD_NOTHING, RTPATH_F_FOLLOW_LINK))) |
| | 885 | if (RT_SUCCESS(RTPathQueryInfoEx(pszPath, &info, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK))) |
| 886 | 886 | { |
| 887 | 887 | #ifdef RT_OS_WINDOWS |
| 888 | 888 | info.Attr.fMode |= 0111; |
| … |
… |
|
| 1155 | 1155 | RTFSOBJINFO info; |
| 1156 | 1156 | int rc; |
| 1157 | 1157 | |
| 1158 | | rc = RTPathQueryInfoEx(pszPath, &info, RTFSOBJATTRADD_NOTHING, RTPATH_F_FOLLOW_LINK); |
| | 1158 | rc = RTPathQueryInfoEx(pszPath, &info, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK); |
| 1159 | 1159 | LogFlow(("SHFL_CF_LOOKUP\n")); |
| 1160 | 1160 | /* Client just wants to know if the object exists. */ |
| 1161 | 1161 | switch (rc) |
| … |
… |
|
| 1247 | 1247 | /* Query path information. */ |
| 1248 | 1248 | RTFSOBJINFO info; |
| 1249 | 1249 | |
| 1250 | | rc = RTPathQueryInfoEx(pszFullPath, &info, RTFSOBJATTRADD_NOTHING, RTPATH_F_FOLLOW_LINK); |
| | 1250 | rc = RTPathQueryInfoEx(pszFullPath, &info, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK); |
| 1251 | 1251 | LogFlow(("RTPathQueryInfoEx returned %Rrc\n", rc)); |
| 1252 | 1252 | |
| 1253 | 1253 | if (RT_SUCCESS(rc)) |
| … |
… |
|
| 1526 | 1526 | { |
| 1527 | 1527 | pDirEntry = pDirEntryOrg; |
| 1528 | 1528 | |
| 1529 | | rc = RTDirReadEx(DirHandle, pDirEntry, &cbDirEntrySize, RTFSOBJATTRADD_NOTHING, RTPATH_F_FOLLOW_LINK); |
| | 1529 | rc = RTDirReadEx(DirHandle, pDirEntry, &cbDirEntrySize, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK); |
| 1530 | 1530 | if (rc == VERR_NO_MORE_FILES) |
| 1531 | 1531 | { |
| 1532 | 1532 | *pIndex = 0; /* listing completed */ |
| … |
… |
|
| 1648 | 1648 | return rc; |
| 1649 | 1649 | } |
| 1650 | 1650 | |
| | 1651 | int vbsfReadlink(SHFLCLIENTDATA *pClient, SHFLROOT root, SHFLSTRING *pPath, uint32_t cbPath, uint8_t *pBuffer, uint32_t cbBuffer) |
| | 1652 | { |
| | 1653 | int rc = VINF_SUCCESS; |
| | 1654 | |
| | 1655 | if (pPath == 0 || pBuffer == 0) |
| | 1656 | { |
| | 1657 | AssertFailed(); |
| | 1658 | return VERR_INVALID_PARAMETER; |
| | 1659 | } |
| | 1660 | |
| | 1661 | /* Build a host full path for the given path, handle file name case issues (if the guest |
| | 1662 | * expects case-insensitive paths but the host is case-sensitive) and convert ucs2 to utf8 if |
| | 1663 | * necessary. |
| | 1664 | */ |
| | 1665 | char *pszFullPath = NULL; |
| | 1666 | uint32_t cbFullPathRoot = 0; |
| | 1667 | |
| | 1668 | rc = vbsfBuildFullPath (pClient, root, pPath, cbPath, &pszFullPath, &cbFullPathRoot); |
| | 1669 | |
| | 1670 | if (RT_SUCCESS (rc)) |
| | 1671 | { |
| | 1672 | rc = RTReadlink(pszFullPath, (char *) pBuffer, cbBuffer); |
| | 1673 | |
| | 1674 | /* free the path string */ |
| | 1675 | vbsfFreeFullPath(pszFullPath); |
| | 1676 | } |
| | 1677 | |
| | 1678 | return rc; |
| | 1679 | } |
| | 1680 | |
| 1651 | 1681 | int vbsfQueryFileInfo(SHFLCLIENTDATA *pClient, SHFLROOT root, SHFLHANDLE Handle, uint32_t flags, uint32_t *pcbBuffer, uint8_t *pBuffer) |
| 1652 | 1682 | { |
| 1653 | 1683 | SHFLFILEHANDLE *pHandle = (SHFLFILEHANDLE *)vbsfQueryHandle(Handle, SHFL_HF_TYPE_DIR|SHFL_HF_TYPE_FILE); |
-
diff --exclude=AutoConfig.kmk --exclude=configure.log --exclude=env.sh --exclude='*.pyc' --exclude=out -Nur VirtualBox-3.2.6_OSE/src/VBox/HostServices/SharedFolders/vbsf.h VirtualBox-3.2.6_OSE-symlink/src/VBox/HostServices/SharedFolders/vbsf.h
|
old
|
new
|
|
| 37 | 37 | int vbsfFlush(SHFLCLIENTDATA *pClient, SHFLROOT root, SHFLHANDLE Handle); |
| 38 | 38 | int vbsfDisconnect(SHFLCLIENTDATA *pClient); |
| 39 | 39 | int vbsfQueryFileInfo(SHFLCLIENTDATA *pClient, SHFLROOT root, SHFLHANDLE Handle, uint32_t flags, uint32_t *pcbBuffer, uint8_t *pBuffer); |
| | 40 | int vbsfReadlink(SHFLCLIENTDATA *pClient, SHFLROOT root, SHFLSTRING *pPath, uint32_t cbPath, uint8_t *pBuffer, uint32_t cbBuffer); |
| 40 | 41 | |
| 41 | 42 | #endif /* __VBSF__H */ |
-
diff --exclude=AutoConfig.kmk --exclude=configure.log --exclude=env.sh --exclude='*.pyc' --exclude=out -Nur VirtualBox-3.2.6_OSE/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h VirtualBox-3.2.6_OSE-symlink/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h
|
old
|
new
|
|
| 75 | 75 | #include <linux/kernel.h> |
| 76 | 76 | #include <linux/init.h> |
| 77 | 77 | #include <linux/fs.h> |
| | 78 | #include <linux/namei.h> |
| 78 | 79 | #include <linux/mm.h> |
| 79 | 80 | #include <linux/pagemap.h> |
| 80 | 81 | #include <linux/slab.h> |
-
diff --exclude=AutoConfig.kmk --exclude=configure.log --exclude=env.sh --exclude='*.pyc' --exclude=out -Nur VirtualBox-3.2.6_OSE/src/VBox/Runtime/r3/posix/path-posix.cpp VirtualBox-3.2.6_OSE-symlink/src/VBox/Runtime/r3/posix/path-posix.cpp
|
old
|
new
|
|
| 478 | 478 | return rc; |
| 479 | 479 | } |
| 480 | 480 | |
| | 481 | RTR3DECL(int) RTReadlink(const char *pszPath, char *pBuffer, uint32_t cchBuffer) |
| | 482 | { |
| | 483 | char szNativeDest[RTPATH_MAX]; |
| | 484 | ssize_t len; |
| | 485 | |
| | 486 | /* |
| | 487 | * Validate input. |
| | 488 | */ |
| | 489 | AssertPtrReturn(pszPath, VERR_INVALID_POINTER); |
| | 490 | AssertReturn(*pszPath, VERR_INVALID_PARAMETER); |
| | 491 | AssertPtrReturn(pBuffer, VERR_INVALID_POINTER); |
| | 492 | |
| | 493 | /* |
| | 494 | * Convert the filename. |
| | 495 | */ |
| | 496 | char const *pszNativePath; |
| | 497 | int rc = rtPathToNative(&pszNativePath, pszPath, NULL); |
| | 498 | if (RT_SUCCESS(rc)) |
| | 499 | { |
| | 500 | len = readlink(pszNativePath, szNativeDest, RTPATH_MAX-1); |
| | 501 | if (len != -1) { |
| | 502 | szNativeDest[len] = '\0'; |
| | 503 | rc = rtPathFromNativeCopy(pBuffer, cchBuffer, szNativeDest, NULL); |
| | 504 | } else |
| | 505 | rc = RTErrConvertFromErrno(errno); |
| | 506 | |
| | 507 | rtPathFreeNative(pszNativePath, pszPath); |
| | 508 | } |
| | 509 | |
| | 510 | LogFlow(("RTReadlink(%p:{%s}, pObjInfo=%p): returns %Rrc\n", |
| | 511 | pszPath, pszPath, pObjInfo, rc)); |
| | 512 | return rc; |
| | 513 | } |
| 481 | 514 | |
| 482 | 515 | RTR3DECL(int) RTPathSetTimes(const char *pszPath, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime, |
| 483 | 516 | PCRTTIMESPEC pChangeTime, PCRTTIMESPEC pBirthTime) |