I want to see what permissions the files within an rpm will "have" after the rpm is installed. But without having to install the rpm.
You can use rpm command (rpm command) itself to list the files inside a RPM package. rpm is a powerful Package Manager, which can be used to build, install, query, verify, update, and erase individual software packages.
To view the permissions for all files in a directory, use the ls command with the -la options. Add other options as desired; for help, see List the files in a directory in Unix. In the output example above, the first character in each line indicates whether the listed object is a file or a directory.
Listing of the files inside an RPM package You can get a listing of the files inside an RPM by performing an RPM query and adding the “-p” switch: $ rpm -q -l -p bash-3.1-16.1. x86_64. rpm /bin/bash /bin/sh /etc/skel/.
The --dump
option to rpm
gives you this information (as well as other information).
rpm -qp --dump "$RPM_PACKAGE_FILENAME"
Here's a way that shows you permissions "like ls
does":
$ rpm -q --qf "[%-15{=NAME} %-36{FILENAMES} %{FILEMODES:perms}\n]" -p $FILENAME
FILENAME /etc/pam.d/sudo -rw-r--r--
FILENAME /etc/file/name/here -rw-r--r--
....
ref
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With