bug-cpio
[Top][All Lists]
Advanced

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

Wrong handling of file types in long listing


From: Thorsten Otto
Subject: Wrong handling of file types in long listing
Date: Wed, 02 Sep 2020 03:34:37 +0200

Hi,

 

i recently found two bugs ralted to list the file type in verbose (long) mode.

 

- in copyin(), file_hdr->c_mode was passed to mode_string, but that expects a mode according struct stat.st_mode (only matters if the file types of system are different from the CP_xxx constants)

 

- in cpio_to_stat(), the mode member is just anded with the S_IFxxx constants. That does not work, for example S_IFDIR (04000) is also set for S_IFBLK type (060000).

 

Attached is a propsed patch to fix that.

 

 

Attachment: cpio-filemode.patch
Description: Text Data


reply via email to

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