I need to install a single file from an RPM, namely
* RPM gnome-keyring-3.6.3-1.fc18.i686 * File: /usr/lib/pkcs11/gnome-keyring-pkcs11.so
into a system running selinux. If I simply expand the RPM and copy in the needed file, the selinux permissions will be wrong. Is there a utility or a function of the rpm program to do this? Any other convenient way? I do I simply have to set all the selinux permissions after the file is installed?
Thanks - jon
On 05/12/13 04:40, Jonathan Ryshpan wrote:
I need to install a single file from an RPM, namely
- RPM gnome-keyring-3.6.3-1.fc18.i686
- File: /usr/lib/pkcs11/gnome-keyring-pkcs11.so
into a system running selinux. If I simply expand the RPM and copy in the needed file, the selinux permissions will be wrong. Is there a utility or a function of the rpm program to do this? Any other convenient way? I do I simply have to set all the selinux permissions after the file is installed?
man restorecon
Allegedly, on or about 11 May 2013, Jonathan Ryshpan sent:
If I simply expand the RPM and copy in the needed file, the selinux permissions will be wrong.
Probably not. The general behaviour is for files to get created with the right contexts when created in, or copied to, their normal filepath. Moving files, on the other hand, usually has the wrong contexts (the default context for where it was created in, not moved to).
There may be cases where some script changes contexts during install, but they'd be prone to failing whenever the files get their contexts replaced by an auto-label. And that's something you can do to existing files, to reset their contexts to the proper ones.
On 05/11/2013 01:40 PM, Jonathan Ryshpan wrote:
I need to install a single file from an RPM, namely
- RPM gnome-keyring-3.6.3-1.fc18.i686
- File: /usr/lib/pkcs11/gnome-keyring-pkcs11.so
The first thing you need to do is RTFM:
rpm -i gnome-keyring-3.6.3-1.fc18.i686 -f gnome-keyring-pkcs11.so
should do the trick. (Please note that I haven't actually done this, but man rpm tells me that it will work and I presume that whoever wrote that knew what they were doing.)
On Sat, 2013-05-11 at 14:16 -0700, Joe Zeff wrote:
On 05/11/2013 01:40 PM, Jonathan Ryshpan wrote:
I need to install a single file from an RPM, namely
- RPM gnome-keyring-3.6.3-1.fc18.i686
- File: /usr/lib/pkcs11/gnome-keyring-pkcs11.so
The first thing you need to do is RTFM:
rpm -i gnome-keyring-3.6.3-1.fc18.i686 -f gnome-keyring-pkcs11.so
should do the trick. (Please note that I haven't actually done this, but man rpm tells me that it will work and I presume that whoever wrote that knew what they were doing.)
If only. The -f option applies only to queries, eg. $ rpm -qf /usr/lib64/pkcs11/gnome-keyring-pkcs11.so gnome-keyring-3.6.3-1.fc18.x86_64 to discover which rpm provides the specified file.
Just to make sure, I tried the following, adding a ".rpm" in case of a typo. $ rpm -i gnome-keyring-3.6.3-1.fc18.i686 -f gnome-keyring-pkcs11.so error: gnome-keyring-3.6.3-1.fc18.i686: not an rpm package (or package manifest): error: open of gnome-keyring-pkcs11.so failed: No such file or directory $ rpm -i gnome-keyring-3.6.3-1.fc18.i686.rpm -f gnome-keyring-pkcs11.so error: open of gnome-keyring-pkcs11.so failed: No such file or directory
Thanks - jon
On 05/11/2013 03:07 PM, Jonathan Ryshpan wrote:
If only. The -f option applies only to queries, eg. $ rpm -qf /usr/lib64/pkcs11/gnome-keyring-pkcs11.so gnome-keyring-3.6.3-1.fc18.x86_64 to discover which rpm provides the specified file.
From the rpm man page:
select options: [PACKAGE_NAME] [-a,--all] [-f,--file FILE]
It doesn't say that this only applies to queries, just that you're able to specify the filename. And, as I wrote, I hadn't tried it myself.
On Sat, 11 May 2013 15:07:04 -0700, Jonathan Ryshpan wrote:
On Sat, 2013-05-11 at 14:16 -0700, Joe Zeff wrote:
On 05/11/2013 01:40 PM, Jonathan Ryshpan wrote:
I need to install a single file from an RPM, namely
- RPM gnome-keyring-3.6.3-1.fc18.i686
- File: /usr/lib/pkcs11/gnome-keyring-pkcs11.so
The first thing you need to do is RTFM:
rpm -i gnome-keyring-3.6.3-1.fc18.i686 -f gnome-keyring-pkcs11.so
should do the trick. (Please note that I haven't actually done this, but man rpm tells me that it will work and I presume that whoever wrote that knew what they were doing.)
If only. The -f option applies only to queries,
Not true.
eg. $ rpm -qf /usr/lib64/pkcs11/gnome-keyring-pkcs11.so gnome-keyring-3.6.3-1.fc18.x86_64 to discover which rpm provides the specified file.
Just to make sure, I tried the following, adding a ".rpm" in case of a typo. $ rpm -i gnome-keyring-3.6.3-1.fc18.i686 -f gnome-keyring-pkcs11.so error: gnome-keyring-3.6.3-1.fc18.i686: not an rpm package (or package manifest): error: open of gnome-keyring-pkcs11.so failed: No such file or directory $ rpm -i gnome-keyring-3.6.3-1.fc18.i686.rpm -f gnome-keyring-pkcs11.so error: open of gnome-keyring-pkcs11.so failed: No such file or directory
Well, obviously the RPM package to install must be available as a local file. The "No such fule or directory" error message should be clear in this regard.
Back to option -f, it's a list of packages when used with e.g. -i, so you can do stuff like
rpm -if /example/list.txt
with "list.txt" containing a list of package file names.
About the original problem, it's possible to restore a single file via rpm2cpio, and its security context with restorecon. Unless the package does special things in its %post scriptlet.
On Sun, May 12, 2013 at 8:32 AM, Michael Schwendt mschwendt@gmail.com wrote:
On Sat, 11 May 2013 15:07:04 -0700, Jonathan Ryshpan wrote:
On Sat, 2013-05-11 at 14:16 -0700, Joe Zeff wrote:
On 05/11/2013 01:40 PM, Jonathan Ryshpan wrote:
I need to install a single file from an RPM, namely
- RPM gnome-keyring-3.6.3-1.fc18.i686
- File: /usr/lib/pkcs11/gnome-keyring-pkcs11.so
The first thing you need to do is RTFM:
rpm -i gnome-keyring-3.6.3-1.fc18.i686 -f gnome-keyring-pkcs11.so
should do the trick. (Please note that I haven't actually done this, but man rpm tells me that it will work and I presume that whoever wrote that knew what they were doing.)
If only. The -f option applies only to queries,
Not true.
Seems to only apply to querying and verifying packages at least according to the man page for rpm and rpm --help.
eg. $ rpm -qf /usr/lib64/pkcs11/gnome-keyring-pkcs11.so gnome-keyring-3.6.3-1.fc18.x86_64 to discover which rpm provides the specified file.
Just to make sure, I tried the following, adding a ".rpm" in case of a typo. $ rpm -i gnome-keyring-3.6.3-1.fc18.i686 -f gnome-keyring-pkcs11.so error: gnome-keyring-3.6.3-1.fc18.i686: not an rpm package (or package manifest): error: open of gnome-keyring-pkcs11.so failed: No such file or directory $ rpm -i gnome-keyring-3.6.3-1.fc18.i686.rpm -f gnome-keyring-pkcs11.so error: open of gnome-keyring-pkcs11.so failed: No such file or directory
Well, obviously the RPM package to install must be available as a local file. The "No such fule or directory" error message should be clear in this regard.
Back to option -f, it's a list of packages when used with e.g. -i, so you can do stuff like
rpm -if /example/list.txt
with "list.txt" containing a list of package file names.
I think the -f is being ignored in this case. The PACKAGE_FILE can be a manifest as you describe and the command given above works just the same without the -f.
John
On Sun, 12 May 2013 09:14:22 -0500, inode0 wrote:
rpm -if /example/list.txt
with "list.txt" containing a list of package file names.
I think the -f is being ignored in this case. The PACKAGE_FILE can be a manifest as you describe and the command given above works just the same without the -f.
Indeed.