Bug 870244

Summary: repquota shows uids not user names with sss
Product: Red Hat Enterprise Linux 6 Reporter: Orion Poplawski <orion>
Component: quotaAssignee: Petr Pisar <ppisar>
Status: CLOSED UPSTREAM QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3   
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
URL: https://sourceforge.net/tracker/?func=detail&atid=118136&aid=3580224&group_id=18136
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-21 12:19:38 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:

Description Orion Poplawski 2012-10-25 21:57:48 UTC
Description of problem:

Using sss:

passwd:     files sss
shadow:     files sss
group:      files sss

# repquota -a
*** Report for user quotas on device /dev/mapper/VolGroup-lv_root
Block grace time: 7days; Inode grace time: 7days
                        Block limits                File limits
User            used    soft    hard  grace    used  soft  hard  grace
----------------------------------------------------------------------
root      -- 2282948       0       0          50064     0     0       
postfix   --      60       0       0             38     0     0       
rpc       --      12       0       0              4     0     0       
rpcuser   --      20       0       0              6     0     0       
named     --      28       0       0              7     0     0       
puppet    --      60       0       0             15     0     0       
smmsp     --     620       0       0            118     0     0       
#1744     --       0       0       0              1     0     0       

# id orion
uid=1744(orion) gid=1001(nwra) groups=1001(nwra),1020(web),1023(source),1027(code),1035(nek),1008(Domain Admins),1002(staff),1034(ivm),10(wheel)
# getent passwd 1744
orion:*:1744:1001:Orion Poplawski:/home/orion:/bin/bash

Everything else seems to resolve the uid fine.

Version-Release number of selected component (if applicable):
quota-3.17-16.el6.x86_64   

This can be resolved by setting:

enumerate = true

in /etc/sssd/sssd.conf for the domain.  But instead of walking through the password entries with getpwent(), I think it would be better to use getpwuid().  Similar with groups.

Filed upstream: https://sourceforge.net/tracker/?func=detail&atid=118136&aid=3580224&group_id=18136

Comment 2 Petr Pisar 2012-10-26 13:35:35 UTC
Indeed walking whole user database is pointless. (Though there can be some corner cases when it's faster than querying for each ID directly. E.g. if disk quotas list a lot of IDs that are missing entry in user database. But then there is `-n' option.)

Comment 3 Petr Pisar 2014-10-21 12:19:38 UTC
As stated by upstream:

> XFS, ocfs2, or ext4 (just recently) do not have quota files available to
> userspace applications and thus repquota has to be implemented by iterating
> over all users and querying kernel for quota information. So for those
> filesystems we have to use getpwent().

Changing the quota in a way you request would break another use cases. Therefore I will postpone resolution of this issue to the upstream.