Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 785257 - ipa permission-find --sizelimit is disregarded
ipa permission-find --sizelimit is disregarded
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ipa (Show other bugs)
6.2
Unspecified Unspecified
medium Severity unspecified
: rc
: ---
Assigned To: Rob Crittenden
Namita Soman
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-27 14:42 EST by Namita Soman
Modified: 2013-08-19 10:15 EDT (History)
2 users (show)

See Also:
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 04:09:45 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:0528 normal SHIPPED_LIVE Low: ipa security, bug fix and enhancement update 2013-02-21 03:22:21 EST

  None (edit)
Description Namita Soman 2012-01-27 14:42:02 EST
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 15:19:37 EST
--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 03:05:12 EST
Upstream ticket:
https://fedorahosted.org/freeipa/ticket/2322
Comment 4 Rob Crittenden 2012-01-30 09:12:48 EST
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 09:44:01 EST
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 10:41:29 EST
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 02:52:13 EDT
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 Galipeau 2012-09-25 12:20:10 EDT
regression test added to rbac permission test suite
Comment 11 Namita Soman 2013-01-14 09:06:41 EST
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 04:09:45 EST
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

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