Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 948318

Summary: Texlive rpms create files not owned with any package, aren't removed when uninstalled and have wrong selinux context
Product: Red Hat Enterprise Linux 7 Reporter: Michal Trunecka <mtruneck>
Component: texliveAssignee: Than Ngo <than>
Status: CLOSED ERRATA QA Contact: Marek Haicman <mhaicman>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: ebenes, ksrot, mhaicman, mmalik, mzember, riehecky, than
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: texlive-2012-35.20130427_r30134.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 11:09:42 UTC Type: Bug
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
Files created by some of texlive-* rpms none

Description Michal Trunecka 2013-04-04 15:05:02 UTC
Description of problem:
For example package texlive-xmltex-bin creates following files:

/var/lib/texmf/web2c/pdftex/xmltex.fmt
/var/lib/texmf/web2c/pdftex/xmltex.log

The files are not owned by any package, so they aren't removed when the package was uninstalled.

# rpm -qf /var/lib/texmf/web2c/pdftex/xmltex.fmt
file /var/lib/texmf/web2c/pdftex/xmltex.fmt is not owned by any package

And the files have wrong selinux context:
# restorecon -Rv /var/lib/texmf/web2c/pdftex/xmltex.fmt
restorecon reset /var/lib/texmf/web2c/pdftex/xmltex.fmt context unconfined_u:object_r:rpm_script_tmp_t:s0->unconfined_u:object_r:tetex_data_t:s0

The list of the files is attached, but without list of rpms, because it is difficult to track the rpm which creates the files.

Version-Release number of selected component (if applicable):
1:texlive-xmltex-bin-2012-0.svn3006.9.20121120_r28314.el7.noarch
...and a lot of others, versions from build RHEL7-20130306


How reproducible:
always

Steps to Reproduce:
 # ls /var/lib/texmf/web2c/pdftex/xmltex.*
ls: cannot access /var/lib/texmf/web2c/pdftex/xmltex.*: No such file or directory

 # yum install texlive-xmltex-bin
 ...

 # ls /var/lib/texmf/web2c/pdftex/xmltex.*
/var/lib/texmf/web2c/pdftex/xmltex.fmt
/var/lib/texmf/web2c/pdftex/xmltex.log

 # rpm -qf /var/lib/texmf/web2c/pdftex/xmltex.fmt
file /var/lib/texmf/web2c/pdftex/xmltex.fmt is not owned by any package

  

Expected results:
The files would be marked as owned by the corresponding rpm and have the correct selinux-context after installation.

Comment 1 Michal Trunecka 2013-04-04 15:06:55 UTC
Created attachment 731642 [details]
Files created by some of texlive-* rpms

Comment 2 Than Ngo 2013-12-19 16:27:55 UTC
(In reply to Michal Trunecka from comment #0)
> Description of problem:
> For example package texlive-xmltex-bin creates following files:
> 
> /var/lib/texmf/web2c/pdftex/xmltex.fmt
> /var/lib/texmf/web2c/pdftex/xmltex.log
> 
> The files are not owned by any package, so they aren't removed when the
> package was uninstalled.
> 
> # rpm -qf /var/lib/texmf/web2c/pdftex/xmltex.fmt
> file /var/lib/texmf/web2c/pdftex/xmltex.fmt is not owned by any package
> 
> And the files have wrong selinux context:
> # restorecon -Rv /var/lib/texmf/web2c/pdftex/xmltex.fmt
> restorecon reset /var/lib/texmf/web2c/pdftex/xmltex.fmt context
> unconfined_u:object_r:rpm_script_tmp_t:s0->unconfined_u:object_r:
> tetex_data_t:s0
> 

what is wrong with the seliniux context? could you please add more infos?
thanks

Comment 3 Michal Trunecka 2014-01-02 13:10:40 UTC
After installing all texlive packages (texlive\*), e.g. these two files has the context rpm_script_tmp_t:

# ls -laZ  /var/lib/texmf/web2c/pdftex/xmltex*
-rw-r--r--. root root unconfined_u:object_r:rpm_script_tmp_t:SystemLow /var/lib/texmf/web2c/pdftex/xmltex.fmt
-rw-r--r--. root root unconfined_u:object_r:rpm_script_tmp_t:SystemLow /var/lib/texmf/web2c/pdftex/xmltex.log

But that is obviously context used for temp files of rpm scripts. The correct context is tetex_data_t, which can be confirmed by restorecon tool:

# restorecon -Rv /var/lib/texmf/web2c/pdftex/xmltex*
restorecon reset /var/lib/texmf/web2c/pdftex/xmltex.fmt context unconfined_u:object_r:rpm_script_tmp_t:s0->unconfined_u:object_r:tetex_data_t:s0
restorecon reset /var/lib/texmf/web2c/pdftex/xmltex.log context unconfined_u:object_r:rpm_script_tmp_t:s0->unconfined_u:object_r:tetex_data_t:s0

Comment 4 Michal Trunecka 2014-01-02 13:13:23 UTC
It can be solved e.g. by running restorecon on the particular path at the end of the postinstall rpm script.

Comment 5 RHEL Program Management 2014-03-22 06:56:37 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 12 Marek Haicman 2015-09-24 18:24:35 UTC
In the bug, apart from selinux contexts, files not owned by any package are also specified. On version texlive-2012-38.20130427_r30134.el7, these files(+dirs) relevant to texlive are non-owned by any rpm:

/var/lib/texmf/web2c
/var/lib/texmf/web2c/tex
/var/lib/texmf/web2c/tex/tex.fmt
/var/lib/texmf/web2c/tex/tex.log
/var/lib/texmf/web2c/metafont
/var/lib/texmf/web2c/metafont/mf.base
/var/lib/texmf/web2c/metafont/mf.log
/var/lib/texmf/web2c/luatex
/var/lib/texmf/web2c/luatex/lualatex.fmt
/var/lib/texmf/web2c/luatex/luatex.log
/var/lib/texmf/web2c/luatex/dvilualatex.log
/var/lib/texmf/web2c/luatex/lualatex.log
/var/lib/texmf/web2c/luatex/dviluatex.log
/var/lib/texmf/web2c/luatex/dviluatex.fmt
/var/lib/texmf/web2c/luatex/dvilualatex.fmt
/var/lib/texmf/web2c/luatex/luatex.fmt
/var/lib/texmf/web2c/pdftex
/var/lib/texmf/web2c/pdftex/pdftex.log
/var/lib/texmf/web2c/pdftex/xmltex.log
/var/lib/texmf/web2c/pdftex/pdflatex.fmt
/var/lib/texmf/web2c/pdftex/pdfetex.log
/var/lib/texmf/web2c/pdftex/pdfxmltex.log
/var/lib/texmf/web2c/pdftex/pdftex.fmt
/var/lib/texmf/web2c/pdftex/etex.log
/var/lib/texmf/web2c/pdftex/latex.log
/var/lib/texmf/web2c/pdftex/mptopdf.fmt
/var/lib/texmf/web2c/pdftex/etex.fmt
/var/lib/texmf/web2c/pdftex/xmltex.fmt
/var/lib/texmf/web2c/pdftex/jadetex.log
/var/lib/texmf/web2c/pdftex/jadetex.fmt
/var/lib/texmf/web2c/pdftex/pdfxmltex.fmt
/var/lib/texmf/web2c/pdftex/pdfjadetex.fmt
/var/lib/texmf/web2c/pdftex/mptopdf.log
/var/lib/texmf/web2c/pdftex/pdfetex.fmt
/var/lib/texmf/web2c/pdftex/latex.fmt
/var/lib/texmf/web2c/pdftex/pdflatex.log
/var/lib/texmf/web2c/pdftex/pdfjadetex.log
/var/lib/texmf/web2c/xetex
/var/lib/texmf/web2c/xetex/xetex.fmt
/var/lib/texmf/web2c/xetex/xetex.log
/var/lib/texmf/web2c/xetex/xelatex.log
/var/lib/texmf/web2c/xetex/xelatex.fmt
/var/lib/texmf/ls-R

But having files in /var/ directory is not a common practice in RHEL [these are OWNED files on machine with 1240 packages, 550 of them are texlive-*, rest basic server stuff - definitely not full install]:

/var/cache/ldconfig/aux-cache
/var/lib/logrotate.status
/var/lib/plymouth/boot-duration
/var/lib/rpm/Providename
/var/lib/rpm/Dirnames
/var/lib/rpm/Basenames
/var/lib/rpm/__db.001
/var/lib/rpm/Name
/var/lib/rpm/Requirename
/var/lib/rpm/Sha1header
/var/lib/rpm/Triggername
/var/lib/rpm/Sigmd5
/var/lib/rpm/Installtid
/var/lib/rpm/__db.002
/var/lib/rpm/Group
/var/lib/rpm/Obsoletename
/var/lib/rpm/Conflictname
/var/lib/rpm/__db.003
/var/lib/rpm/Packages
/var/lib/nfs/state
/var/lib/nfs/etab
/var/lib/nfs/rmtab
/var/lib/nfs/xtab
/var/lib/misc/postfix.aliasesdb-stamp
/var/lib/systemd/random-seed
/var/lib/systemd/catalog/database
/var/spool/anacron/cron.monthly
/var/spool/anacron/cron.weekly
/var/spool/anacron/cron.daily
/var/log/btmp
/var/log/wtmp
/var/log/tallylog
/var/log/lastlog
/var/db/Makefile

That is 34 files. Rest of the files [269, not counting /var/lib/yum - thousands files there] are not owned.

Based on this data, I would propose to not consider THIS part of bugreport as a bug. Could you please confirm my sentiment?

Comment 13 Marek Haicman 2015-09-24 18:27:02 UTC
Confirming that selinux contexts are fixed in version texlive-2012-38.20130427_r30134.el7

drwxr-xr-x. root    root    system_u:object_r:tetex_data_t:s0 texmf
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/tex/tex.fmt
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/tex/tex.log
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/metafont/mf.base
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/metafont/mf.log
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/luatex/lualatex.fmt
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/luatex/luatex.log
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/luatex/dvilualatex.log
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/luatex/lualatex.log
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/luatex/dviluatex.log
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/luatex/dviluatex.fmt
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/luatex/dvilualatex.fmt
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/luatex/luatex.fmt
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/pdftex/pdftex.log
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/pdftex/xmltex.log
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/pdftex/pdflatex.fmt
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/pdftex/pdfetex.log
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/pdftex/pdfxmltex.log
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/pdftex/pdftex.fmt
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/pdftex/etex.log
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/pdftex/latex.log
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/pdftex/mptopdf.fmt
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/pdftex/etex.fmt
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/pdftex/xmltex.fmt
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/pdftex/jadetex.log
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/pdftex/jadetex.fmt
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/pdftex/pdfxmltex.fmt
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/pdftex/pdfjadetex.fmt
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/pdftex/mptopdf.log
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/pdftex/pdfetex.fmt
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/pdftex/latex.fmt
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/pdftex/pdflatex.log
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/pdftex/pdfjadetex.log
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/xetex/xetex.fmt
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/xetex/xetex.log
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/xetex/xelatex.log
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/web2c/xetex/xelatex.fmt
-rw-r--r--. root root unconfined_u:object_r:tetex_data_t:s0 /var/lib/texmf/ls-R

Comment 14 Marek Haicman 2015-09-24 19:03:22 UTC
Confirming version texlive-38.20130427_r30134.el7 also fixed ownership (rpm point of view) in /usr/ directory of these directories [these were non-owned in previous version]:

/usr/share/texlive/texmf-dist/fonts/afm/metapost 
/usr/share/texlive/texmf-dist/fonts/enc/dvips/metapost 
/usr/share/texlive/texmf-dist/fonts/map/dvips/metapost
/usr/share/texlive/texmf-dist/fonts/tfm/metapost
/usr/share/texlive/texmf-dist/fonts/type1/metapost
/usr/share/texlive/texmf-dist/metapost/base
/usr/share/texlive/texmf-dist/metapost/config
/usr/share/texlive/texmf-dist/metapost
/usr/share/texlive/texmf-dist/metapost/misc
/usr/share/texlive/texmf-dist/metapost/support/charlib 
/usr/share/texlive/texmf-dist/metapost/support 
/usr/share/texlive/texmf-dist/tex/generic/metapost
/usr/share/texlive/texmf-dist/tex/latex/adjustbox
/usr/share/texlive/texmf-dist/tex/latex/collectbox
/usr/share/texlive/texmf-dist/tex/latex/ifoddpage
/usr/share/texlive/tlpkg/TeXLive
/usr/share/texlive/tlpkg/tlpostcode

Comment 16 Marek Haicman 2015-09-25 09:39:36 UTC
Closing this as verified based on findings reported in comments 12,13 and 14.

Part about files in /var/ not owned by any package is moved to bz1266433.

Comment 17 Than Ngo 2015-10-12 13:46:52 UTC
*** Bug 1167474 has been marked as a duplicate of this bug. ***

Comment 18 errata-xmlrpc 2015-11-19 11:09:42 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHEA-2015-2264.html