btrfs-progs: Receive: preserve ownership for symlinks, by using 'lchown'
authorAlex Lyakas <alex.btrfs@zadarastorage.com>
Wed, 17 Oct 2012 13:53:58 +0000 (15:53 +0200)
committerDavid Sterba <dsterba@suse.cz>
Thu, 17 Jan 2013 17:27:54 +0000 (18:27 +0100)
Signed-off-by: Alex Lyakas <alex.btrfs@zadarastorage.com>
cmds-receive.c

index a21c037..37d07db 100644 (file)
@@ -725,7 +725,7 @@ static int process_chown(const char *path, u64 uid, u64 gid, void *user)
                fprintf(stderr, "chown %s - uid=%llu, gid=%llu\n", path,
                                uid, gid);
 
-       ret = chown(full_path, uid, gid);
+       ret = lchown(full_path, uid, gid);
        if (ret < 0) {
                ret = -errno;
                fprintf(stderr, "ERROR: chown %s failed. %s\n",