diff mbox

btrfs-progs: Receive: preserve ownership for symlinks, by using 'lchown'

Message ID CAOcd+r1qVe4C84LOxEnfMJzVtZx-yEDic2bWyVwqYuMyaDNnXA@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Alex Lyakas Oct. 17, 2012, 1:53 p.m. UTC
Signed-off-by: Alex Lyakas <alex.btrfs@zadarastorage.com>

 		fprintf(stderr, "ERROR: chown %s failed. %s\n",
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/cmds-receive.c b/cmds-receive.c
index 6b7cf12..a6a6a5b 100644
--- a/cmds-receive.c
+++ b/cmds-receive.c
@@ -731,7 +731,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;