bug-cpio
[Top][All Lists]
Advanced

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

[Bug-cpio] The permissions of ./ do not change


From: mad1ost
Subject: [Bug-cpio] The permissions of ./ do not change
Date: Sun, 27 Aug 2017 23:14:37 +0300
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

address@hidden:~# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
NAME="Debian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=debian
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

address@hidden:~# cpio --version
cpio (GNU cpio) 2.11
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Phil Nelson, David MacKenzie, John Oleynick,
and Sergey Poznyakoff.

address@hidden:~# ls -ld wordpress/
d-wxr-xr-x 5 user1 user1 4096 Aug 27 21:39 wordpress/ # no read permission for user user1
address@hidden:~# cd wordpress
address@hidden:~/wordpress# ls -la
total 216
d-wxr-xr-x  5 user1 user1  4096 Aug 27 21:39 .
drwx------  7 root  root   4096 Aug 27 22:50 ..
-rw-r--r--  1 user1 user1    35 Jul  9 20:26 .htaccess
-rw-r--r--  1 user1 user1   418 Sep 25  2013 index.php
-rw-r--r--  1 user1 user1 19935 Jun 15 18:02 license.txt
-rw-r--r--  1 user1 user1 10847 Jun 15 18:02 readme.html
...

address@hidden:~/wordpress# find -print0 | cpio -0oH ustar > ../wp.tar
54738 blocks
address@hidden:~/wordpress# cd ..
address@hidden:~# mkdir copy
address@hidden:~# ls -ld copy
drwxr-xr-x 2 root root 4096 Aug 27 22:55 copy
address@hidden:~# cd copy
address@hidden:~/copy# cpio -tv < ../wp.tar | head -5
d-wxr-xr-x   1 user1    user1           0 Aug 27 21:39 ./ # no read permission for user user1
-rw-r--r--   1 user1    user1        5447 Sep 28  2016 wp-activate.php
-rw-r--r--   1 user1    user1       16200 Apr  6 21:01 wp-settings.php
-rw-r--r--   1 user1    user1        4179 Jun 15 18:02 wp-config-sample.php
-rw-r--r--   1 user1    user1        3301 Oct 25  2016 wp-load.php
address@hidden:~/copy# cpio -i < ../wp.tar
54737 blocks
address@hidden:~/copy# ls -la
total 216
drwxr-xr-x  5 root  root   4096 Aug 27 22:58 . # read permission do not change
drwx------  8 root  root   4096 Aug 27 22:55 ..
-rw-r--r--  1 user1 user1    35 Aug 27 22:58 .htaccess
-rw-r--r--  1 user1 user1   418 Aug 27 22:58 index.php
-rw-r--r--  1 user1 user1 19935 Aug 27 22:58 license.txt
-rw-r--r--  1 user1 user1 10847 Aug 27 22:58 readme.html

BUT

address@hidden:~/copy# cd ..
address@hidden:~# rm -rf copy
address@hidden:~# mkdir copy
address@hidden:~# ls -ld copy
drwxr-xr-x 2 root root 4096 Aug 27 22:59 copy
address@hidden:~# cd copy
address@hidden:~/copy# tar -tvf ../wp.tar | head -5
d-wxr-xr-x user1/user1       0 2017-08-27 21:39 ./
-rw-r--r-- user1/user1    5447 2016-09-28 00:36 wp-activate.php
-rw-r--r-- user1/user1   16200 2017-04-06 21:01 wp-settings.php
-rw-r--r-- user1/user1    4179 2017-06-15 18:02 wp-config-sample.php
-rw-r--r-- user1/user1    3301 2016-10-25 06:15 wp-load.php
address@hidden:~/copy# tar -xf ../wp.tar
address@hidden:~/copy# ls -la
total 216
d-wxr-xr-x  5 user1 user1  4096 Aug 27 21:39 . # permission have changed
drwx------  8 root  root   4096 Aug 27 22:59 ..
-rw-r--r--  1 user1 user1    35 Jul  9 20:26 .htaccess
-rw-r--r--  1 user1 user1   418 Sep 25  2013 index.php
-rw-r--r--  1 user1 user1 19935 Jun 15 18:02 license.txt
...

It's a bug or feature?

I also tried do like this

address@hidden:~/wordpress# find -depth -print0 | cpio -0oH ustar > ../wp.tar
54738 blocks
address@hidden:~/wordpress# cd ..
address@hidden:~# mkdir copy
address@hidden:~# cd copy/
address@hidden:~/copy# ls
address@hidden:~/copy# cpio -tv < ../wp.tar | tail -1
54737 blocks
d-wxr-xr-x   1 user1    user1           0 Aug 27 21:39 ./
address@hidden:~/copy# cpio -id < ../wp.tar
54737 blocks
address@hidden:~/copy# ls -la
total 216
drwxr-xr-x  5 root  root   4096 Aug 27 23:05 . # read permission do not change
drwx------  8 root  root   4096 Aug 27 23:04 ..
-rw-r--r--  1 user1 user1    35 Aug 27 23:05 .htaccess
-rw-r--r--  1 user1 user1   418 Aug 27 23:05 index.php
-rw-r--r--  1 user1 user1 19935 Aug 27 23:05 license.txt
-rw-r--r--  1 user1 user1 10847 Aug 27 23:05 readme.html
...

but no success.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]