mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Jean-Marc Pigeon <jmp@safe.ca>
To: musl@lists.openwall.com
Subject: bug? in  musl libc failed to preserve ownership for
Date: Thu, 02 Apr 2015 21:18:49 -0400	[thread overview]
Message-ID: <551DEA79.70702@safe.ca> (raw)
In-Reply-To: <551DE58A.6070707@safe.ca>

[-- Attachment #1: Type: text/plain, Size: 2132 bytes --]

Hello.

Using cp (from native musl coreutils compilation, not busybox) I am
getting a strange result when doing a copy
(using musls-1.1.8)

test (user:group, no privilege 301:300, doing this as root is no problem):
;-------------------------------------------------------------
mkdir d1
cd d1
touch p1
ln -s p1 lp1
cd ..
cp -a d1 d2
cp: failed to preserve ownership for d2/lp1: Not supported
;--------------------------------------------------------------
Note: same cp from coreutils glibc working fine.

strace extract

getdents64(3, /* 4 entries */, 2048)    = 96
getdents64(3, /* 0 entries */, 2048)    = 0
close(3)                                = 0
lstat("d1/lp1", {st_mode=S_IFLNK|0777, st_size=2, ...}) = 0
readlink("d1/lp1", "p1", 3)             = 2
symlink("p1", "d2/lp1")                 = 0
lstat("d2/lp1", {st_mode=S_IFLNK|0777, st_size=2, ...}) = 0
lchown("d2/lp1", 301, 300)              = 0
newfstatat(AT_FDCWD, "d2/lp1", {st_mode=S_IFLNK|0777, st_size=2, ...},
AT_SYMLINK_NOFOLLOW) = 0
fcntl(1, F_GETFL)                       = 0x8002 (flags O_RDWR|O_LARGEFILE)
writev(2, [{"cp: ", 4}, {NULL, 0}], 2cp: )  = 4
writev(2, [{"", 0}, {"failed to preserve ownership for"..., 39}],
2failed to preserve ownership for d2/lp1) = 39
writev(2, [{": Not supported", 15}, {NULL, 0}], 2: Not supported) = 15
writev(2, [{"", 0}, {"\n", 1}], 2
)      = 1
lstat("d1/p1", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
open("d1/p1", O_RDONLY|O_NOFOLLOW)      = 3
;----------------------------------------------------------------------

My understanding/feeling, could be within fcntl not
reading symlink file status properly. possible?

however, even if 'cp' is complaining, the duplication
is properly done.

-- 

A bientôt
===========================================================
Jean-Marc Pigeon                        E-Mail: jmp@safe.ca
SAFE Inc.                             Phone: (514) 493-4280
  Clement, 'a kiss solution' to get rid of SPAM (at last)
     Clement' Home base <"http://www.clement.safe.ca">
===========================================================


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 3903 bytes --]

  reply	other threads:[~2015-04-03  1:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-02 15:53 perl native musl, ldd Jean-Marc Pigeon
2015-04-02 16:18 ` Rich Felker
2015-04-02 18:17   ` Jean-Marc Pigeon
2015-04-02 18:48     ` u-wsnj
2015-04-02 20:40       ` Jean-Marc Pigeon
2015-04-02 20:48         ` Laurent Bercot
2015-04-02 21:08         ` Nathan McSween
2015-04-02 21:09         ` u-wsnj
2015-04-02 21:26         ` Rich Felker
2015-04-02 21:34         ` Szabolcs Nagy
2015-04-03  0:57           ` Jean-Marc Pigeon
2015-04-03  1:18             ` Jean-Marc Pigeon [this message]
2015-04-03  2:15               ` bug? in musl libc failed to preserve ownership for Rich Felker

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=551DEA79.70702@safe.ca \
    --to=jmp@safe.ca \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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).