|
From: | Radek Brich |
Subject: | Re: [Bug-cpio] cpio 2.9: sets unexpected (wrong?) file owner UID |
Date: | Tue, 26 Feb 2008 13:41:34 +0100 |
User-agent: | KMail/1.9.6 (enterprise 0.20071204.744707) |
forwarding to the list... ---------- Forwarded Message ---------- Subject: Re: [Bug-cpio] cpio 2.9: sets unexpected (wrong?) file owner UID Date: Ășt 26. Ășnora 2008 From: Radek Brich <address@hidden> To: "Sergey Poznyakoff" <address@hidden> On Tuesday 26 of February 2008 12:05:05 you wrote: > Radek Brich <address@hidden> ha escrit: > > On Tue 30. of October 2007 12:27:11 Alexey Stratonnikov wrote: > > > When cpio archive is created as "find . -depth |cpio -o" and extracted > > > as "cpio -i --make-directories" under root user, I get all directories > > > owned by UID=0 no matter who was the owner of the directory when acrive > > > was created. > > > > > > This may be shown as: > > [...] > > This test case works with the latest alpha version > (ftp://alpha.gnu.org/gnu/cpio/cpio-2.9.90.tar.gz). > > Regards, > Sergey Hi Sergey, I'm attaching few reproducers here -- only the 'no-depth' one works with cpio-2.9.90. I think the problem is in the delayed_set_stat. It remembers permissions of implicitly created directories and overwrites the permissions from archive with those when apply_delayed_set_stat() is called. $ sudo ./cpio-dir-perm-depth ~/tmp/cpio-2.9.90/src/cpio * Original permissions: drwx------ 2 bin bin 4096 2008-02-26 13:33 a * Extracted permissions: drwxr-xr-x 2 root root 4096 2008-02-26 13:33 a I wrote a patch for the 'find . -depth | cpio -o' case, so I'm attaching it too, though it's not exactly clean to be included... -- Radek Brich Base OS/core services Red Hat, Brno, Czech Rep. -------------------------------------------------------
cpio-dir-perm-depth
Description: application/shellscript
cpio-dir-perm-passthrough
Description: application/shellscript
cpio-dir-perm-no-depth
Description: application/shellscript
cpio-2.9-dir_perm.patch
Description: Text Data
[Prev in Thread] | Current Thread | [Next in Thread] |