diff --git a/src/VBox/Additions/linux/sharedfolders/dirops.c b/src/VBox/Additions/linux/sharedfolders/dirops.c
index 0267b0b..7b32718 100644
|
a
|
b
|
static int sf_mkdir(struct inode *parent, struct dentry *dentry, int mode)
|
| 663 | 663 | } |
| 664 | 664 | |
| 665 | 665 | /** |
| | 666 | * Set S_IWUSR on dentry |
| | 667 | * |
| | 668 | * @param dentry directory cache entry |
| | 669 | */ |
| | 670 | static int sf_set_write(struct dentry *dentry) |
| | 671 | { |
| | 672 | struct iattr iattr; |
| | 673 | |
| | 674 | iattr.ia_mode = dentry->d_inode->i_mode | S_IWUSR; |
| | 675 | iattr.ia_valid = ATTR_MODE; |
| | 676 | |
| | 677 | return sf_setattr(dentry, &iattr); |
| | 678 | } |
| | 679 | |
| | 680 | /** |
| 666 | 681 | * Remove a regular file / directory. |
| 667 | 682 | * |
| 668 | 683 | * @param parent inode of the directory |
| … |
… |
static int sf_unlink_aux(struct inode *parent, struct dentry *dentry, int fDirec
|
| 677 | 692 | struct sf_inode_info *sf_i = GET_INODE_INFO(parent); |
| 678 | 693 | SHFLSTRING *path; |
| 679 | 694 | uint32_t fFlags; |
| | 695 | int retried = 0; |
| 680 | 696 | |
| 681 | 697 | TRACE(); |
| 682 | 698 | BUG_ON(!sf_g); |
| … |
… |
static int sf_unlink_aux(struct inode *parent, struct dentry *dentry, int fDirec
|
| 690 | 706 | && dentry->d_inode |
| 691 | 707 | && ((dentry->d_inode->i_mode & S_IFLNK) == S_IFLNK)) |
| 692 | 708 | fFlags |= SHFL_REMOVE_SYMLINK; |
| | 709 | |
| | 710 | retry: |
| 693 | 711 | rc = VbglR0SfRemove(&client_handle, &sf_g->map, path, fFlags); |
| 694 | 712 | if (RT_FAILURE(rc)) |
| 695 | 713 | { |
| | 714 | if ( !retried++ |
| | 715 | && RTErrConvertToErrno(rc) == EPERM |
| | 716 | && !sf_set_write(dentry)) |
| | 717 | goto retry; |
| 696 | 718 | LogFunc(("(%d): VbglR0SfRemove(%s) failed rc=%Rrc\n", fDirectory, path->String.utf8, rc)); |
| 697 | 719 | err = -RTErrConvertToErrno(rc); |
| 698 | 720 | goto fail1; |
| … |
… |
static int sf_rename(struct inode *old_parent, struct dentry *old_dentry,
|
| 795 | 817 | else |
| 796 | 818 | { |
| 797 | 819 | int fDir = ((old_dentry->d_inode->i_mode & S_IFDIR) != 0); |
| | 820 | int retried = 0; |
| 798 | 821 | |
| | 822 | retry: |
| 799 | 823 | rc = VbglR0SfRename(&client_handle, &sf_g->map, old_path, |
| 800 | 824 | new_path, fDir ? 0 : SHFL_RENAME_FILE | SHFL_RENAME_REPLACE_IF_EXISTS); |
| 801 | 825 | if (RT_SUCCESS(rc)) |
| … |
… |
static int sf_rename(struct inode *old_parent, struct dentry *old_dentry,
|
| 808 | 832 | } |
| 809 | 833 | else |
| 810 | 834 | { |
| | 835 | if ( !retried++ |
| | 836 | && RTErrConvertToErrno(rc) == EPERM |
| | 837 | && !sf_set_write(new_dentry)) |
| | 838 | goto retry; |
| 811 | 839 | LogFunc(("VbglR0SfRename failed rc=%Rrc\n", rc)); |
| 812 | 840 | err = -RTErrConvertToErrno(rc); |
| 813 | 841 | kfree(new_path); |