Bug 202525 - anaconda should label the /var mountpoint var_t if /var is a separate filesystem
anaconda should label the /var mountpoint var_t if /var is a separate filesystem
Product: Fedora
Classification: Fedora
Component: anaconda (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Anaconda Maintenance Team
Mike McLean
Depends On:
Blocks: FC6Target
  Show dependency treegraph
Reported: 2006-08-14 18:03 EDT by Orion Poplawski
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-08-24 16:09:22 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Orion Poplawski 2006-08-14 18:03:53 EDT
Description of problem:

Posted this to fedora-devel but to takers so here's the bug report against anaconda.

If you install FC (including FC6T2) with /var as a separate partition, you will
get lots of the following at boot:

audit(1155060024.471:4): avc:  denied  { search } for  pid=496
comm="pam_console_app" name="var" dev=hda2 ino=251905
tcontext=system_u:object_r:file_t:s0 tclass=dir

This is because pam_console_apply is being run before /var is mounted and the
unmounted /var directory does not have the appropriate selinux context (var_t).
 pam_console_apply is apparently looking for the fine /var/run/console.lock.

I believe pam_console_apply is being run before /var is mounted by udev.  udev
is started before /var is mounted, and the following udev rule exists:

# cat /etc/udev/rules.d/95-pam-console.rules
ACTION=="add", SYSFS{dev}=="?*", KERNEL=="?*", RUN+="/sbin/pam_console_apply

Which appears to run pam_console_apply for every device, which would explain why
there are so many messages.

Now, I think the proper solution is to have anaconda properly label the /var
mount point var_t.  Indeed, putting "restorecon /var" early in rc.sysinit and
rebooting a couple times has been to favored hack to this point and does not
appear to result in any other error messages.
Comment 1 Jeremy Katz 2006-08-15 13:43:28 EDT
This is ... ugly.  But I guess we could do a hack like setting labels when going
to mount filesystems on a new install :/
Comment 2 Jeremy Katz 2006-08-24 16:09:22 EDT
Should be fixed in CVS

Note You need to log in before you can comment on or make changes to this bug.