diff options
author | Petr Viktorin <pviktori@redhat.com> | 2012-03-08 07:55:00 -0500 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2013-02-20 17:34:51 +0100 |
commit | d66898405b2a38244723555c5d9e1b8510919baa (patch) | |
tree | c714351c3bb2a6c9aab95c1410e45c95f2929b9a /tests/test_xmlrpc/xmlrpc_test.py | |
parent | 1821fa0aabf12bc5d1de226e6937a7414680da5b (diff) | |
download | freeipa.git-d66898405b2a38244723555c5d9e1b8510919baa.tar.gz freeipa.git-d66898405b2a38244723555c5d9e1b8510919baa.tar.xz freeipa.git-d66898405b2a38244723555c5d9e1b8510919baa.zip |
Use ipauniqueid for the RDN of sudo commands
Since sudo commands are case-sensitive, we can't use 'sudocmd'
as the RDN.
Tests for case-sensitive behavior included
https://fedorahosted.org/freeipa/ticket/2482
Diffstat (limited to 'tests/test_xmlrpc/xmlrpc_test.py')
-rw-r--r-- | tests/test_xmlrpc/xmlrpc_test.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/test_xmlrpc/xmlrpc_test.py b/tests/test_xmlrpc/xmlrpc_test.py index 610fa97c..0a046b45 100644 --- a/tests/test_xmlrpc/xmlrpc_test.py +++ b/tests/test_xmlrpc/xmlrpc_test.py @@ -35,10 +35,10 @@ from ipalib.x509 import valid_issuer # or `long`? If not, we still need to return them as `unicode` instead of `str`. fuzzy_digits = Fuzzy('^\d+$', type=basestring) +uuid_re = '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}' + # Matches an ipauniqueid like u'784d85fd-eae7-11de-9d01-54520012478b' -fuzzy_uuid = Fuzzy( - '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$' -) +fuzzy_uuid = Fuzzy('^%s$' % uuid_re) # Matches trusted domain GUID, like u'463bf2be-3456-4a57-979e-120304f2a0eb' fuzzy_guid = fuzzy_uuid @@ -52,7 +52,12 @@ fuzzy_domain_sid = Fuzzy( # Matches netgroup dn. Note (?i) at the beginning of the regexp is the ingnore case flag fuzzy_netgroupdn = Fuzzy( - '(?i)ipauniqueid=[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12},cn=ng,cn=alt,%s' % api.env.basedn + '(?i)ipauniqueid=%s,cn=ng,cn=alt,%s' % (uuid_re, api.env.basedn) +) + +# Matches sudocmd dn +fuzzy_sudocmddn = Fuzzy( + '(?i)ipauniqueid=%s,cn=sudocmds,cn=sudo,%s' % (uuid_re, api.env.basedn) ) # Matches a hash signature, not enforcing length |