Bug 484997

Summary: cpio does not honor system umask correctly.
Product: Red Hat Enterprise Linux 5 Reporter: Wade Mealing <wmealing>
Component: cpioAssignee: Ondrej Vasik <ovasik>
Status: CLOSED DUPLICATE QA Contact: BaseOS QE <qe-baseos-auto>
Severity: medium Docs Contact:
Priority: low    
Version: 5.4   
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-02-11 04:04:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Minor changes from debian patch on same issue. none

Description Wade Mealing 2009-02-11 01:28:33 UTC
Created attachment 331506 [details]
Minor changes from debian patch on same issue.

Description of problem:

cpio provide doesnt honor the umask , i.e When trying to restored files using cpio from the tape drive the directories are created with 700 instead of 755(if umask is 0022). 

Version-Release number of selected component (if applicable):

cpio-2.6-20

How reproducible:

Every time.

Steps to Reproduce:

umask 0022
mkdir -p /tmp/test-tape/dir1/dir2
cd /tmp/test-tape/
touch a b c d e f
cd dir1
touch g h i j k l 
cd dir2
touch m n o p q r 
cd /tmp/test-tape/
ls -l | grep dir1 | awk ' { print $1  } ' 
mkdir -p /tmp/newdir/
find /tmp/test-tape/* -type f -print | cpio -pdvm /tmp/newdir/  &> /dev/null 
ls -l | grep dir1 | awk ' { print $1  } ' 

dir1 should be affected by the umask of the system.

Actual results:

drwxr-xr-x
drwx------

Expected results:

sh testcase.sh
drwxr-xr-x
drwxr-xr-x

Additional info:

Comment 1 Wade Mealing 2009-02-11 04:04:08 UTC

*** This bug has been marked as a duplicate of bug 484690 ***