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 a21c037663ebbf34d27bd6ccc4c5b3a022830522..37d07dbb553d7b6b503bb867ad4d3f3bc1d930f8 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",