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.
Description of problem:
Trying to set up quota on a filesystem which is mounted as an user home directory fails due to selinux denial for the command "quotacheck -c /user/home/directory"
Version-Release number of selected component (if applicable):
selinux-policy-targeted-3.7.19-126.el6.noarch
How reproducible:
always
Steps to Reproduce:
1. run the test /CoreOS/quota/Regression/bz77871-grace-period-not-shown
Actual results:
see https://beaker.engineering.redhat.com/tasks/executed?task=/CoreOS/quota/Regression/bz77871-grace-period-not-shown&job_id=170480
ls -dlZ /tmp/tmp.QCHj5nec7c/bz77871:
drwxr-xr-x. bz77871bz77871 unconfined_u:object_r:user_home_dir_t:s0 /tmp/tmp.QCHj5nec7c/bz77871
quotacheck: Cannot create new quotafile /tmp/tmp.QCHj5nec7c/bz77871/aquota.user.new: Permission denied
quotacheck: Cannot initialize IO on new quotafile: Permission denied
type=SYSCALL msg=audit(1323811395.282:1089019): arch=c000003e syscall=2 success=no exit=-13 a0=7fff2d5d2030 a1=c2 a2=180 a3=7fff2d5d1da0 items=0 ppid=30595 pid=30889 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="quotacheck" exe="/sbin/quotacheck" subj=unconfined_u:unconfined_r:quota_t:s0-s0:c0.c1023 key=(null)
type=AVC msg=audit(1323811395.282:1089019): avc: denied { write } for pid=30889 comm="quotacheck" name="/" dev=loop0 ino=2 scontext=unconfined_u:unconfined_r:quota_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_dir_t:s0 tclass=dir
Expected results:
no errors/denials, aquota.user created properly
Additional info:
Note that "unconfined_u:object_r:user_home_dir_t:s0" corresponds to the contexts of normal user directories in /home
(In reply to comment #1)
> Karel,
> you will need to use "home_root_t" label, which is used for /home directory.
okay, changing
unconfined_u:object_r:user_home_dir_t:s0 to unconfined_u:object_r:home_root_t:s0 seems to enable quota to do its job
however, this creates quite unpleasant inconsistency, as for example restorecon tends to change home_root_t to user_home_dir_t
could we have this at least as RFE to enable quota to operate both on home_root_t AND user_home_dir_t ?
(In reply to comment #3)
> Sure, But Karel would an admin actually setup a users homedir with a
> quota.group file actually in the users homedir? Or is this just a test issue?
well, I don't have the statistical data ...
the problem is that quota works by default per filesystem, and it puts its data (i.e. quota.user/quota.group) into fileystem's root
while the typical usage is to have /home mounted on one filesystem and users' directories as subdirectories on that filesystem, I think having users' directories as separate mounts makes sense too (and using quota on them, as quota provides better control than just "I won't write the file as you are out of free blocks on this harddrive")
CCing ppisar, the quota maintainer, if he can correct me/add some info ...?
I have not so much to add. quota tools control quotas that are maintained per file system. Thus administrator expects the tools can work on any (real) mount point. Not only on /home. Otherwise you tell administrator that quotas are supported on /home only which is hard constraint. I think SELinux should allow quota tools to write into file_t.
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.
http://rhn.redhat.com/errata/RHBA-2012-0780.html