aboutsummaryrefslogtreecommitdiff
path: root/sshfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'sshfs.c')
-rw-r--r--sshfs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sshfs.c b/sshfs.c
index e14aa71..323ab6c 100644
--- a/sshfs.c
+++ b/sshfs.c
@@ -2150,6 +2150,10 @@ static int sshfs_chown(const char *path, uid_t uid, gid_t gid)
{
int err;
struct buffer buf;
+
+ if (sshfs.remote_uid_detected && uid == sshfs.local_uid)
+ uid = sshfs.remote_uid;
+
buf_init(&buf, 0);
buf_add_path(&buf, path);
buf_add_uint32(&buf, SSH_FILEXFER_ATTR_UIDGID);