[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    [BusyBox] cpio -id and umask
From:       lenaerts.frank () pandora ! be (Frank Lenaerts)
Date:       2004-02-25 21:36:03
Message-ID: 20040225213603.GA19022 () galaxy
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


Hi,

It seems that busybox cpio -id does not take the umask into account
for non existing parent directories.

Example:

/tmp/testdir/ with mode 0700 (e.g. like ~/.ssh)
/tmp/testdir/testfile with mode 0600 (e.g. like ~/.ssh/authorized_keys)

Next, create a cpio archive using GNU cpio without explicitly adding
/tmp/testdir i.e.

echo /tmp/testdir/testfile | cpio -o --format=crc > /tmp/tf.cpio

Next, unpack the archive using GNU cpio:

cd /tmp/gnu-cpio
cpio -id < /tmp/tf.cpio

This creates /tmp/testdir with mode 0755 (because umask is 0022, I
didn't first know this) and /tmp/testdir/testfile with mode 0600.

Next, unpack the archive using BB cpio:

cd /tmp/bb-cpio
busybox cpio -id < /tmp/tf.cpio

This creates /tmp/testdir with mode 0777 (not taking into account the
umask) and /tmp/testdir/testfile with mode 0600.

So, for myself, the moral of the story is to also incorporate the
parent directories if their permissions matter (like with ~/.ssh).

Concerning busybox cpio, I think it should take the umask into account.

-- 
lenaerts.frank@pandora.be

gpg fingerprint: A41E A399 5160 BAB9 AEF1  58F2 B92A F4AB 9FFB 3707
gpg key id: 9FFB3707

Those who do not understand Unix are condemned to reinvent it, poorly."
-- Henry Spencer


[Attachment #5 (application/pgp-signature)]

_______________________________________________
busybox mailing list
busybox@mail.busybox.net
http://codepoet.org/mailman/listinfo/busybox


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic