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 785257

Summary: ipa permission-find --sizelimit is disregarded
Product: Red Hat Enterprise Linux 6 Reporter: Namita Soman <nsoman>
Component: ipaAssignee: Rob Crittenden <rcritten>
Status: CLOSED ERRATA QA Contact: Namita Soman <nsoman>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 6.2CC: jgalipea, mkosek
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-3.0.0-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 09:09:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Namita Soman 2012-01-27 19:42:02 UTC
Description of problem:
help indicates:
--sizelimit=INT       Maximum number of entries returned  

There are 16 permissions that match attr=description. Used sizelimit to bring back only 5.
ipa permission-find --attr=description --sizelimit=5
But it still brought back all 16.

Version-Release number of selected component (if applicable):
ipa-server-2.2.0-101.20120123T0157zgit64cf8a4.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1.Find how many permissions match a filter like attr=description:
ipa permission-find --attr=description
2. Now limit the number of entries retunr using sizelimit
ipa permission-find --attr=description --sizelimit=5

  
Actual results:
All matching permissions are listed

Expected results:
Only 5 permissions should be listed

Additional info:

Comment 2 Namita Soman 2012-01-27 20:19:37 UTC
--timelimit - is difficult to gauge, but suspect it is disregarded as well

the test i ran:
# date; ipa permission-find --name=ManageUser1 --timelimit=1; date
Fri Jan 27 15:17:23 EST 2012
----------------------
88 permissions matched
----------------------
  Permission name: AAA
  Permissions: write

<snip>
.....
<snip>

  Granted to Privilege: Write IPA Configuration
-----------------------------
Number of entries returned 88
-----------------------------
Fri Jan 27 15:17:34 EST 2012


Not sure if the search lasted 1 sec, but printing out 88 entries took 9 sec...

Comment 3 Martin Kosek 2012-01-30 08:05:12 UTC
Upstream ticket:
https://fedorahosted.org/freeipa/ticket/2322

Comment 4 Rob Crittenden 2012-01-30 14:12:48 UTC
timelimit refers only to LDAP search time. You can see the time taken in the DS access log.

Comment 5 Namita Soman 2012-02-29 14:44:01 UTC
Also --permissions if invalid is disregarded.

Actual:
# ipa permission-find --permissions=xyz --all
---------------------
0 permissions matched
---------------------
----------------------------
Number of entries returned 0
----------------------------

Expected: 
message indicating - "ipa: ERROR: invalid 'permissions': "xyz" is not a valid permission"

Comment 6 Rob Crittenden 2012-02-29 15:41:29 UTC
That's to be expected. The search options are just things to look for to narrow down the search. Not existing should not prevent the search from executing.

Comment 7 Martin Kosek 2012-05-30 06:52:13 UTC
Fixed upstream:
master: https://fedorahosted.org/freeipa/changeset/8d00d7c13038abc152afbd46c96108753506fb77

--sizelimit is now properly enforced.


As for the --timelimit issue, there is not much more we can do. This is not a standard search, where just one LDAP query is run.

With permission-find, we run:
1. LDAP Search to search for all matching permission objects
2. For all matched objects, we run an LDAP retrieve call to pull ACI data
3. LDAP search is run to also search in ACIs
4. For all matched objects, we run an LDAP retrieve call to pull permission data

This is the reason why the --timelimit cannot be kept as easily as with other *-find commands.

Comment 8 Jenny Severance 2012-09-25 16:20:10 UTC
regression test added to rbac permission test suite

Comment 11 Namita Soman 2013-01-14 14:06:41 UTC
Verified using ipa-server-3.0.0-20.el6.x86_64

# ipa permission-find  --attrs=description --permissions=write --type=user --sizelimit=3
---------------------
3 permissions matched
---------------------
  Permission name: ManageUser1
  Permissions: write
  Attributes: carlicense, description
  Type: user

  Permission name: ManageUser2
  Permissions: read, write
  Attributes: carlicense, description
  Type: user

  Permission name: Modify Users
  Permissions: write
  Attributes: givenname, sn, cn, displayname, title, initials, loginshell, gecos, homephone, mobile, pager, facsimiletelephonenumber, telephonenumber, street, roomnumber, l, st, postalcode, manager, secretary, description, carlicense,
              labeleduri, inetuserhttpurl, seealso, employeetype, businesscategory, ou, mepmanagedentry, objectclass
  Type: user
  Granted to Privilege: User Administrators, Modify Users and Reset passwords
----------------------------
Number of entries returned 3
----------------------------


# ipa permission-find  --attrs=description --permissions=write --type=user --sizelimit=2
---------------------
2 permissions matched
---------------------
  Permission name: ManageUser1
  Permissions: write
  Attributes: carlicense, description
  Type: user

  Permission name: Modify Users
  Permissions: write
  Attributes: givenname, sn, cn, displayname, title, initials, loginshell, gecos, homephone, mobile, pager, facsimiletelephonenumber, telephonenumber, street, roomnumber, l, st, postalcode, manager, secretary, description, carlicense,
              labeleduri, inetuserhttpurl, seealso, employeetype, businesscategory, ou, mepmanagedentry, objectclass
  Type: user
  Granted to Privilege: User Administrators, Modify Users and Reset passwords
----------------------------
Number of entries returned 2
----------------------------

Comment 13 errata-xmlrpc 2013-02-21 09:09:45 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.

http://rhn.redhat.com/errata/RHSA-2013-0528.html