linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Lyakas <alex.btrfs@zadarastorage.com>
To: linux-btrfs <linux-btrfs@vger.kernel.org>,
	chris.mason@fusionio.com, Jan Schmidt <list.btrfs@jan-o-sch.net>
Cc: Arne Jansen <sensille@gmx.net>
Subject: [PATCH] btrfs-progs: Receive: preserve ownership for symlinks, by using 'lchown'
Date: Wed, 17 Oct 2012 15:53:58 +0200	[thread overview]
Message-ID: <CAOcd+r1qVe4C84LOxEnfMJzVtZx-yEDic2bWyVwqYuMyaDNnXA@mail.gmail.com> (raw)

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

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",

                 reply	other threads:[~2012-10-17 13:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOcd+r1qVe4C84LOxEnfMJzVtZx-yEDic2bWyVwqYuMyaDNnXA@mail.gmail.com \
    --to=alex.btrfs@zadarastorage.com \
    --cc=chris.mason@fusionio.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=list.btrfs@jan-o-sch.net \
    --cc=sensille@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).