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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Alex Lyakas <alex.btrfs@xxxxxxxxxxxxxxxxx>

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;
 		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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux