-
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 |
| … |
… |
|
| 785 | 795 | */ |
| 786 | 796 | RTR3DECL(int) RTPathRename(const char *pszSrc, const char *pszDst, unsigned fRename); |
| 787 | 797 | |
| | 798 | /** |
| | 799 | * Create a symlink from new path to old path. |
| | 800 | * |
| | 801 | * @returns IPRT status code. |
| | 802 | * @param pszNewPath The path for the new symlink. |
| | 803 | * @param pszOldPath The destination path for the symlink. |
| | 804 | */ |
| | 805 | RTR3DECL(int) RTSymlink(const char *pszNewPath, const char *pszOldPath); |
| | 806 | |
| 788 | 807 | #endif /* IN_RING3 */ |
| 789 | 808 | |
| 790 | 809 | /** @} */ |
-
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) |
| | 103 | /** Create symlink */ |
| | 104 | #define SHFL_FN_SYMLINK (19) |
| 101 | 105 | |
| 102 | 106 | /** @} */ |
| 103 | 107 | |
| … |
… |
|
| 855 | 859 | |
| 856 | 860 | |
| 857 | 861 | /** |
| | 862 | * SHFL_FN_READLINK |
| | 863 | */ |
| | 864 | |
| | 865 | /** Parameters structure. */ |
| | 866 | typedef struct _VBoxSFReadlink |
| | 867 | { |
| | 868 | VBoxGuestHGCMCallInfo callInfo; |
| | 869 | |
| | 870 | /** pointer, in: SHFLROOT |
| | 871 | * Root handle of the mapping which name is queried. |
| | 872 | */ |
| | 873 | HGCMFunctionParameter root; |
| | 874 | |
| | 875 | /** pointer, in: |
| | 876 | * Points to SHFLSTRING buffer. |
| | 877 | */ |
| | 878 | HGCMFunctionParameter path; |
| | 879 | |
| | 880 | /** pointer, out: |
| | 881 | * Buffer to place data to. |
| | 882 | */ |
| | 883 | HGCMFunctionParameter buffer; |
| | 884 | |
| | 885 | } VBoxSFReadlink; |
| | 886 | |
| | 887 | /** Number of parameters */ |
| | 888 | #define SHFL_CPARMS_READLINK (3) |
| | 889 | |
| | 890 | |
| | 891 | |
| | 892 | /** |
| 858 | 893 | * SHFL_FN_INFORMATION |
| 859 | 894 | */ |
| 860 | 895 | |
| … |
… |
|
| 983 | 1018 | |
| 984 | 1019 | #define SHFL_CPARMS_RENAME (4) |
| 985 | 1020 | |
| | 1021 | |
| | 1022 | /** |
| | 1023 | * SHFL_FN_SYMLINK |
| | 1024 | */ |
| | 1025 | |
| | 1026 | /** Parameters structure. */ |
| | 1027 | typedef struct _VBoxSFSymlink |
| | 1028 | { |
| | 1029 | VBoxGuestHGCMCallInfo callInfo; |
| | 1030 | |
| | 1031 | /** pointer, in: SHFLROOT |
| | 1032 | * Root handle of the mapping which name is queried. |
| | 1033 | */ |
| | 1034 | HGCMFunctionParameter root; |
| | 1035 | |
| | 1036 | /** pointer, in: |
| | 1037 | * Points to SHFLSTRING of path for the new symlink. |
| | 1038 | */ |
| | 1039 | HGCMFunctionParameter newPath; |
| | 1040 | |
| | 1041 | /** pointer, in: |
| | 1042 | * Points to SHFLSTRING of destination for symlink. |
| | 1043 | */ |
| | 1044 | HGCMFunctionParameter oldPath; |
| | 1045 | |
| | 1046 | /** pointer, out: |
| | 1047 | * Information about created symlink. |
| | 1048 | */ |
| | 1049 | HGCMFunctionParameter info; |
| | 1050 | |
| | 1051 | } VBoxSFSymlink; |
| | 1052 | |
| | 1053 | #define SHFL_CPARMS_SYMLINK (4) |
| | 1054 | |
| 986 | 1055 | /** |
| 987 | 1056 | * SHFL_FN_ADD_MAPPING |
| 988 | 1057 | * Host call, no guest structure is used. |
-
Binary files VirtualBox-3.2.6_OSE/include/VBox/.shflsvc.h.swp and VirtualBox-3.2.6_OSE-symlink/include/VBox/.shflsvc.h.swp differ
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_In; |
| | 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 | { |
| … |
… |
|
| 681 | 713 | return rc; |
| 682 | 714 | } |
| 683 | 715 | |
| | 716 | DECLVBGL(int) vboxCallSymlink (PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pNewPath, PSHFLSTRING pOldPath, PRTFSOBJINFO pBuffer) |
| | 717 | { |
| | 718 | int rc = VINF_SUCCESS; |
| | 719 | |
| | 720 | VBoxSFSymlink data; |
| | 721 | |
| | 722 | VBOX_INIT_CALL(&data.callInfo, SYMLINK, pClient); |
| | 723 | |
| | 724 | data.root.type = VMMDevHGCMParmType_32bit; |
| | 725 | data.root.u.value32 = pMap->root; |
| | 726 | |
| | 727 | data.newPath.type = VMMDevHGCMParmType_LinAddr_In; |
| | 728 | data.newPath.u.Pointer.size = ShflStringSizeOfBuffer (pNewPath); |
| | 729 | data.newPath.u.Pointer.u.linearAddr = (uintptr_t)pNewPath; |
| | 730 | |
| | 731 | data.oldPath.type = VMMDevHGCMParmType_LinAddr_In; |
| | 732 | data.oldPath.u.Pointer.size = ShflStringSizeOfBuffer (pOldPath); |
| | 733 | data.oldPath.u.Pointer.u.linearAddr = (uintptr_t)pOldPath; |
| | 734 | |
| | 735 | data.info.type = VMMDevHGCMParmType_LinAddr_Out; |
| | 736 | data.info.u.Pointer.size = sizeof(RTFSOBJINFO); |
| | 737 | data.info.u.Pointer.u.linearAddr = (uintptr_t)pBuffer; |
| | 738 | |
| | 739 | rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data)); |
| | 740 | |
| | 741 | /* Log(("VBOXSF: VBoxSF::vboxCallSymlink: " |
| | 742 | "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); |
| | 743 | */ |
| | 744 | if (RT_SUCCESS (rc)) |
| | 745 | { |
| | 746 | rc = data.callInfo.result; |
| | 747 | } |
| | 748 | return rc; |
| | 749 | } |
| | 750 | |
| | 751 | |
| 684 | 752 | #endif /* !VBGL_VBOXGUEST */ |
-
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); |
| 178 | 179 | DECLVBGL(int) vboxCallUnmapFolder (PVBSFCLIENT pClient, PVBSFMAP pMap); |
| 179 | 180 | DECLVBGL(int) vboxCallSetUtf8 (PVBSFCLIENT pClient); |
| 180 | 181 | |
| | 182 | DECLVBGL(int) vboxCallSymlink (PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pNewPath, PSHFLSTRING pOldPath, PRTFSOBJINFO pBuffer); |
| | 183 | |
| 181 | 184 | #endif /* __VBOXCALLS__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/dirops.c VirtualBox-3.2.6_OSE-symlink/src/VBox/Additions/linux/sharedfolders/dirops.c
|
old
|
new
|
|
| 661 | 661 | return err; |
| 662 | 662 | } |
| 663 | 663 | |
| | 664 | /* Based on sf_lookup */ |
| | 665 | static int sf_symlink(struct inode *parent, struct dentry *dentry, const char *symname) |
| | 666 | { |
| | 667 | int err; |
| | 668 | int rc; |
| | 669 | struct sf_inode_info *sf_i, *sf_new_i; |
| | 670 | struct sf_glob_info *sf_g; |
| | 671 | SHFLSTRING *path, *ssymname; |
| | 672 | RTFSOBJINFO info; |
| | 673 | struct inode *inode; |
| | 674 | ino_t ino; |
| | 675 | int symname_len = strlen(symname) + 1; |
| | 676 | |
| | 677 | TRACE(); |
| | 678 | sf_g = GET_GLOB_INFO(parent->i_sb); |
| | 679 | sf_i = GET_INODE_INFO(parent); |
| | 680 | |
| | 681 | BUG_ON(!sf_g); |
| | 682 | BUG_ON(!sf_i); |
| | 683 | |
| | 684 | err = sf_path_from_dentry(__func__, sf_g, sf_i, dentry, &path); |
| | 685 | if (err) { |
| | 686 | goto fail0; |
| | 687 | } |
| | 688 | |
| | 689 | ssymname = kmalloc(offsetof(SHFLSTRING, String.utf8) + symname_len, GFP_KERNEL); |
| | 690 | if (!ssymname) { |
| | 691 | LogRelFunc(("kmalloc failed, caller=sf_symlink\n")); |
| | 692 | err = -ENOMEM; |
| | 693 | goto fail1; |
| | 694 | } |
| | 695 | |
| | 696 | ssymname->u16Length = symname_len - 1; |
| | 697 | ssymname->u16Size = symname_len; |
| | 698 | memcpy(ssymname->String.utf8, symname, symname_len); |
| | 699 | |
| | 700 | rc = vboxCallSymlink(&client_handle, &sf_g->map, path, ssymname, &info); |
| | 701 | if (RT_FAILURE(rc)) { |
| | 702 | if (rc == VERR_WRITE_PROTECT) { |
| | 703 | err = -EROFS; |
| | 704 | goto fail2; |
| | 705 | } |
| | 706 | err = -EPROTO; |
| | 707 | /* XXX LogFunc(("(%d): vboxCallCreate(%s) failed rc=%Rrc\n", |
| | 708 | fDirectory, sf_i->path->String.utf8, rc)); */ |
| | 709 | goto fail2; |
| | 710 | } |
| | 711 | |
| | 712 | err = sf_instantiate(__func__, parent, dentry, path, &info, SHFL_HANDLE_NIL); |
| | 713 | if (err) { |
| | 714 | LogFunc(("(%d): could not instantiate dentry for %s err=%d\n", |
| | 715 | fDirectory, sf_i->path->String.utf8, err)); |
| | 716 | goto fail2; |
| | 717 | } |
| | 718 | |
| | 719 | fail2: |
| | 720 | kfree(ssymname); |
| | 721 | fail1: |
| | 722 | kfree(path); |
| | 723 | fail0: |
| | 724 | return err; |
| | 725 | } |
| | 726 | |
| 664 | 727 | struct inode_operations sf_dir_iops = { |
| 665 | 728 | .lookup = sf_lookup, |
| 666 | 729 | .create = sf_create, |
| … |
… |
|
| 672 | 735 | .revalidate = sf_inode_revalidate |
| 673 | 736 | #else |
| 674 | 737 | .getattr = sf_getattr, |
| 675 | | .setattr = sf_setattr |
| | 738 | .setattr = sf_setattr, |
| | 739 | .symlink = sf_symlink |
| 676 | 740 | #endif |
| 677 | 741 | }; |
-
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/Additions/x11/vboxmouse/undefined_15 VirtualBox-3.2.6_OSE-symlink/src/VBox/Additions/x11/vboxmouse/undefined_15
|
old
|
new
|
|
| 92 | 92 | miPointerCurrentScreen |
| 93 | 93 | screenInfo |
| 94 | 94 | InitPointerDeviceStruct |
| | 95 | symlink |
-
diff --exclude=AutoConfig.kmk --exclude=configure.log --exclude=env.sh --exclude='*.pyc' --exclude=out -Nur VirtualBox-3.2.6_OSE/src/VBox/Additions/x11/vboxmouse/undefined_70 VirtualBox-3.2.6_OSE-symlink/src/VBox/Additions/x11/vboxmouse/undefined_70
|
old
|
new
|
|
| 143 | 143 | __umoddi3 |
| 144 | 144 | __udivdi3 |
| 145 | 145 | __moddi3 |
| | 146 | symlink |
-
diff --exclude=AutoConfig.kmk --exclude=configure.log --exclude=env.sh --exclude='*.pyc' --exclude=out -Nur VirtualBox-3.2.6_OSE/src/VBox/Additions/x11/vboxmouse/undefined_71 VirtualBox-3.2.6_OSE-symlink/src/VBox/Additions/x11/vboxmouse/undefined_71
|
old
|
new
|
|
| 141 | 141 | __umoddi3 |
| 142 | 142 | __udivdi3 |
| 143 | 143 | __divdi3 |
| | 144 | symlink |
-
diff --exclude=AutoConfig.kmk --exclude=configure.log --exclude=env.sh --exclude='*.pyc' --exclude=out -Nur VirtualBox-3.2.6_OSE/src/VBox/Additions/x11/vboxvideo/undefined_13 VirtualBox-3.2.6_OSE-symlink/src/VBox/Additions/x11/vboxvideo/undefined_13
|
old
|
new
|
|
| 179 | 179 | sprintf |
| 180 | 180 | FatalError |
| 181 | 181 | xf86CrtcConfigPrivateIndex |
| | 182 | symlink |
-
diff --exclude=AutoConfig.kmk --exclude=configure.log --exclude=env.sh --exclude='*.pyc' --exclude=out -Nur VirtualBox-3.2.6_OSE/src/VBox/Additions/x11/vboxvideo/undefined_70 VirtualBox-3.2.6_OSE-symlink/src/VBox/Additions/x11/vboxvideo/undefined_70
|
old
|
new
|
|
| 179 | 179 | vgaHWFreeHWRec |
| 180 | 180 | vgaHWSaveScreen |
| 181 | 181 | vgaHWDPMSSet |
| | 182 | symlink |
-
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 | { |
| … |
… |
|
| 1109 | 1158 | break; |
| 1110 | 1159 | } |
| 1111 | 1160 | |
| | 1161 | case SHFL_FN_SYMLINK: |
| | 1162 | { |
| | 1163 | Log(("svnCall: SHFL_FN_SYMLINK\n")); |
| | 1164 | /* Verify parameter count and types. */ |
| | 1165 | if (cParms != SHFL_CPARMS_SYMLINK) |
| | 1166 | { |
| | 1167 | rc = VERR_INVALID_PARAMETER; |
| | 1168 | } |
| | 1169 | else |
| | 1170 | if ( paParms[0].type != VBOX_HGCM_SVC_PARM_32BIT /* root */ |
| | 1171 | || paParms[1].type != VBOX_HGCM_SVC_PARM_PTR /* newPath */ |
| | 1172 | || paParms[2].type != VBOX_HGCM_SVC_PARM_PTR /* oldPath */ |
| | 1173 | || paParms[3].type != VBOX_HGCM_SVC_PARM_PTR /* info */ |
| | 1174 | ) |
| | 1175 | { |
| | 1176 | rc = VERR_INVALID_PARAMETER; |
| | 1177 | } |
| | 1178 | else |
| | 1179 | { |
| | 1180 | /* Fetch parameters. */ |
| | 1181 | SHFLROOT root = (SHFLROOT)paParms[0].u.uint32; |
| | 1182 | SHFLSTRING *pNewPath = (SHFLSTRING *)paParms[1].u.pointer.addr; |
| | 1183 | SHFLSTRING *pOldPath = (SHFLSTRING *)paParms[2].u.pointer.addr; |
| | 1184 | RTFSOBJINFO *pInfo = (RTFSOBJINFO *)paParms[3].u.pointer.addr; |
| | 1185 | uint32_t cbInfo = paParms[3].u.pointer.size; |
| | 1186 | |
| | 1187 | /* Verify parameters values. */ |
| | 1188 | if ( !ShflStringIsValid(pNewPath, paParms[1].u.pointer.size) |
| | 1189 | || !ShflStringIsValid(pOldPath, paParms[2].u.pointer.size) |
| | 1190 | || (cbInfo != sizeof(RTFSOBJINFO)) |
| | 1191 | ) |
| | 1192 | { |
| | 1193 | rc = VERR_INVALID_PARAMETER; |
| | 1194 | } |
| | 1195 | else |
| | 1196 | { |
| | 1197 | /* Execute the function. */ |
| | 1198 | rc = vbsfSymlink (pClient, root, pNewPath, pOldPath, pInfo); |
| | 1199 | if (RT_SUCCESS(rc)) |
| | 1200 | { |
| | 1201 | /* Update parameters.*/ |
| | 1202 | ; /* none */ |
| | 1203 | } |
| | 1204 | } |
| | 1205 | } |
| | 1206 | } |
| | 1207 | break; |
| | 1208 | |
| 1112 | 1209 | default: |
| 1113 | 1210 | { |
| 1114 | 1211 | rc = VERR_NOT_IMPLEMENTED; |
-
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); |
| … |
… |
|
| 2104 | 2134 | return rc; |
| 2105 | 2135 | } |
| 2106 | 2136 | |
| | 2137 | int vbsfSymlink(SHFLCLIENTDATA *pClient, SHFLROOT root, SHFLSTRING *pNewPath, SHFLSTRING *pOldPath, RTFSOBJINFO *pInfo) |
| | 2138 | { |
| | 2139 | int rc = VINF_SUCCESS; |
| | 2140 | |
| | 2141 | char *pszFullNewPath = NULL; |
| | 2142 | char *pszOldPath = NULL; |
| | 2143 | |
| | 2144 | /* XXX: no support for UCS2 at the moment. */ |
| | 2145 | if (!BIT_FLAG(pClient->fu32Flags, SHFL_CF_UTF8)) |
| | 2146 | return VERR_NOT_IMPLEMENTED; |
| | 2147 | |
| | 2148 | rc = vbsfBuildFullPath (pClient, root, pNewPath, pNewPath->u16Size, &pszFullNewPath, NULL); |
| | 2149 | if (rc != VINF_SUCCESS) |
| | 2150 | return rc; |
| | 2151 | |
| | 2152 | rc = RTSymlink(pszFullNewPath, (const char *)pOldPath->String.utf8); |
| | 2153 | if (RT_SUCCESS (rc)) { |
| | 2154 | /* XXX: should this error code make the exit code? */ |
| | 2155 | rc = RTPathQueryInfoEx(pszFullNewPath, pInfo, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK); |
| | 2156 | } |
| | 2157 | |
| | 2158 | vbsfFreeFullPath(pszFullNewPath); |
| | 2159 | return rc; |
| | 2160 | } |
| | 2161 | |
| 2107 | 2162 | /* |
| 2108 | 2163 | * Clean up our mess by freeing all handles that are still valid. |
| 2109 | 2164 | * |
-
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); |
| | 41 | int vbsfSymlink(SHFLCLIENTDATA *pClient, SHFLROOT root, SHFLSTRING *pNewPath, SHFLSTRING *pOldPath, RTFSOBJINFO *pInfo); |
| 40 | 42 | |
| 41 | 43 | #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) |
| … |
… |
|
| 776 | 809 | } |
| 777 | 810 | |
| 778 | 811 | |
| | 812 | RTR3DECL(int) RTSymlink(const char *pszNewPath, const char *pszOldPath) |
| | 813 | { |
| | 814 | /* |
| | 815 | * Validate input. |
| | 816 | */ |
| | 817 | AssertMsgReturn(VALID_PTR(pszNewPath), ("%p\n", pszNewPath), VERR_INVALID_POINTER); |
| | 818 | AssertMsgReturn(VALID_PTR(pszOldPath), ("%p\n", pszOldPath), VERR_INVALID_POINTER); |
| | 819 | AssertMsgReturn(*pszNewPath, ("%p\n", pszNewPath), VERR_INVALID_PARAMETER); |
| | 820 | AssertMsgReturn(*pszOldPath, ("%p\n", pszOldPath), VERR_INVALID_PARAMETER); |
| | 821 | |
| | 822 | /* |
| | 823 | * Convert the filenames. |
| | 824 | */ |
| | 825 | char const *pszNativeNewPath; |
| | 826 | char const *pszNativeOldPath; |
| | 827 | int rc = rtPathToNative(&pszNativeNewPath, pszNewPath, NULL); |
| | 828 | if (RT_SUCCESS(rc)) |
| | 829 | { |
| | 830 | rc = rtPathToNative(&pszNativeOldPath, pszOldPath, NULL); |
| | 831 | if (RT_SUCCESS(rc)) |
| | 832 | { |
| | 833 | if (symlink(pszOldPath, pszNewPath) == -1) |
| | 834 | rc = RTErrConvertFromErrno(errno); |
| | 835 | |
| | 836 | rtPathFreeNative(pszNativeOldPath, pszOldPath); |
| | 837 | } |
| | 838 | rtPathFreeNative(pszNativeNewPath, pszNewPath); |
| | 839 | } |
| | 840 | |
| | 841 | return rc; |
| | 842 | } |
| | 843 | |
| | 844 | |
| 779 | 845 | RTDECL(bool) RTPathExists(const char *pszPath) |
| 780 | 846 | { |
| 781 | 847 | return RTPathExistsEx(pszPath, RTPATH_F_FOLLOW_LINK); |