1

I am extracting a rpm package on RHEL-6.4. I am using rpm2cpio command as below:

rpm2cpio package-name.rpm | cpio -u -i -d ---quiet 2>&1

The above command runs in fakeroot v1.12.4 environment. (cpio (GNU cpio) 2.10) After execution of above command if I check file tpye using file command it shows file as Directory.

I checked content of rpm using

rpm -qlpv package-name.rpm

It shows all files as file and directory as directory.

However, I noticed if i unset LD_LIBRARY_PATH and then check filetype using file command, it shows all data same as rpm -qlp.

LD_LIBRARY_PATH is set to

/opt/tools/wh/dtd/RHE-5/fakeroot/1.12.4/lib64/libfakeroot

why file is marked as directory when LD_LIBRARY_PATH is set ?

HuntM
  • 157
  • 1
  • 7

1 Answers1

0

Well, the rpm2cpio extract the archive including directory structure. So /usr/bin/foo from archive becomes:

d /usr
d   /bin/
f      foo 

So usr is indeed directory. But /usr/bin/foo is file (and it indeed is file on my workstation). Of course if you have LD_LIBRARY_PATH set something (and you did not shared to what) then it can point to directory which modify ANY system libraries and ANY system call. So the result can be ANYTHING. And it is hard to tell without knowing you local setup.

Note 1: you can call rpmdev-extract from rpmdevtools package. It is more comfortable.

Note 2: I do not see anything like --queryformat perms in supported options, but you can you -qlpv.

msuchy
  • 5,162
  • 1
  • 14
  • 26
  • Agreed with -qlpv. I tried both --qf perms and -qlpv, by mistake I placed perms. – HuntM Mar 15 '16 at 10:06
  • rpmdev-extract is not available on red hat, so couldn't try with it. – HuntM Mar 17 '16 at 07:25
  • It is part of rpmdevtools package which *is* part of RHEL/Centos. See http://mirror.centos.org/centos/6/os/x86_64/Packages/rpmdevtools-7.5-2.el6.noarch.rpm – msuchy Mar 17 '16 at 11:53
  • I have tested with fakeroot v1.20.2. It solved the issue. Can I answer my question? – HuntM Mar 22 '16 at 07:55