Bug 810948

Summary: Unable to disable or enable hbacrule with --setattr [regression]
Product: Red Hat Enterprise Linux 6 Reporter: Jenny Severance <jgalipea>
Component: ipaAssignee: Rob Crittenden <rcritten>
Status: CLOSED ERRATA QA Contact: IDM QE LIST <seceng-idm-qe-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.3CC: mkosek
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-2.2.0-9.el6 Doc Type: Bug Fix
Doc Text:
No documentation needed.
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 13:26:40 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 Jenny Severance 2012-04-09 17:50:06 UTC
Description of problem:

# ipa hbacrule-mod --setattr ipaenabledflag=1 test
ipa: ERROR: ipaEnabledFlag: value #0 invalid per syntax: Invalid syntax.

# ipa hbacrule-mod --setattr ipaenabledflag=0 test
ipa: ERROR: ipaEnabledFlag: value #0 invalid per syntax: Invalid syntax.

# ipa hbacrule-mod --setattr ipaenabledflag=FALSE test
ipa: ERROR: ipaEnabledFlag: value #0 invalid per syntax: Invalid syntax.

# ipa hbacrule-mod --setattr ipaenabledflag=TRUE test
ipa: ERROR: ipaEnabledFlag: value #0 invalid per syntax: Invalid syntax.

# ipa hbacrule-mod --setattr ipaenabledflag=False test
ipa: ERROR: ipaEnabledFlag: value #0 invalid per syntax: Invalid syntax.

# ipa hbacrule-mod --setattr ipaenabledflag=True test
ipa: ERROR: ipaEnabledFlag: value #0 invalid per syntax: Invalid syntax.

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: ipa-hbacrule-cli-015: Negative - setattr and addattr on ipaEnabledFlag
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   LOG    ] :: Executing: ipa hbacrule-mod --setattr ipaenabledflag=test test
:: [   LOG    ] :: "ipa hbacrule-mod --setattr ipaenabledflag=test test" failed as expected.
:: [   PASS   ] :: Error message as expected: ipa: ERROR: invalid 'ipaenabledflag': must be True or False
:: [   PASS   ] :: Verify expected error message for --setattr on ipaEnabledFlag.
:: [   FAIL   ] :: Disable rule using setattr modification. (Expected 0, got 1)
:: [   LOG    ] :: ERROR: Expect test Enabled status to be FALSE. GOT: TRUE
:: [   PASS   ] :: Verify rule is now disabled
:: [   LOG    ] :: Executing: ipa hbacrule-mod --addattr ipaenabledflag=TRUE test
:: [   LOG    ] :: "ipa hbacrule-mod --addattr ipaenabledflag=TRUE test" failed as expected.
:: [   PASS   ] :: Error message as expected: ipa: ERROR: ipaenabledflag: Only one value allowed.
:: [   PASS   ] :: Verify expected error message for --addattr on ipaEnabledFlag.
:: [   LOG    ] :: Duration: 9s
:: [   LOG    ] :: Assertions: 5 good, 1 bad
:: [   FAIL   ] :: RESULT: ipa-hbacrule-cli-015: Negative - setattr and addattr on ipaEnabledFlag


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

How reproducible:


Steps to Reproduce:
1.ipa hbacrule-add --desc=test test
2.ipa hbacrule-mod --setattr ipaenabledflag=FALSE test
3.
  
Actual results:
ipa: ERROR: ipaEnabledFlag: value #0 invalid per syntax: Invalid syntax.

Expected results:
Rule to be disabled

Additional info:

Comment 2 Martin Kosek 2012-04-10 10:44:49 UTC
This is a regression introduced in this patch:

https://fedorahosted.org/freeipa/changeset/241955e4ce34f491168237f5a06bcb98daf22a5a/

We do not encode parameters present only for LDAPObject and for LDAPCommand properly. I will open an upstream ticket.

Comment 3 Martin Kosek 2012-04-10 10:45:49 UTC
Upstream ticket:
https://fedorahosted.org/freeipa/ticket/2616

Comment 4 Rob Crittenden 2012-04-10 22:34:45 UTC
master: 1431c80b3c2a256bb6c10cf042f7671004695a9f

ipa-2-2: 32fa7f7a48b3d956b0ec5dbea9cd22db504a562d

Comment 7 Jenny Severance 2012-04-11 14:47:29 UTC
verified :

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: ipa-hbacrule-cli-015: Negative - setattr and addattr on ipaEnabledFlag
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   LOG    ] :: Executing: ipa hbacrule-mod --setattr ipaenabledflag=test test
:: [   LOG    ] :: "ipa hbacrule-mod --setattr ipaenabledflag=test test" failed as expected.
:: [   PASS   ] :: Error message as expected: ipa: ERROR: invalid 'ipaenabledflag': must be True or False
:: [   PASS   ] :: Verify expected error message for --setattr on ipaEnabledFlag.
:: [   PASS   ] :: Disable rule using setattr modification.
:: [   LOG    ] :: test is FALSE as expected.
:: [   PASS   ] :: Verify rule is now disabled
:: [   LOG    ] :: Executing: ipa hbacrule-mod --addattr ipaenabledflag=TRUE test
:: [   LOG    ] :: "ipa hbacrule-mod --addattr ipaenabledflag=TRUE test" failed as expected.
:: [   PASS   ] :: Error message as expected: ipa: ERROR: ipaenabledflag: Only one value allowed.
:: [   PASS   ] :: Verify expected error message for --addattr on ipaEnabledFlag.
:: [   LOG    ] :: Duration: 17s
:: [   LOG    ] :: Assertions: 6 good, 0 bad
:: [   PASS   ] :: RESULT: ipa-hbacrule-cli-015: Negative - setattr and addattr on ipaEnabledFlag

version :
ipa-server-2.2.0-9.el6.x86_64

Comment 9 Martin Kosek 2012-04-25 11:47:14 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
No documentation needed.

Comment 11 errata-xmlrpc 2012-06-20 13:26:40 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/RHBA-2012-0819.html