Skip to content

Commit

Permalink
Add another kadmin ACL test for backreferences
Browse files Browse the repository at this point in the history
Add a test using backreferences which don't correspond directly to
principal components, to verify that *N refers to the Nth wildcard and
not the Nth component.
  • Loading branch information
greghudson committed Nov 21, 2013
1 parent 8eb9e6f commit 1192811
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/tests/t_kadmin_acl.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def delprinc(name):
admin = make_client('user/admin')
none = make_client('none')
restrictions = make_client('restrictions')
onetwothreefour = make_client('one/two/three/four')

realm.run_kadminl('addpol -minlife "1 day" minlife')

Expand All @@ -64,6 +65,7 @@ def delprinc(name):
restricted_rename ad * +preauth
*/* d *2/*1
*/two/*/* d *3/*1/*2
*/admin a
wctarget a wild/*
restrictions a type1 -policy minlife
Expand Down Expand Up @@ -328,6 +330,10 @@ def delprinc(name):
out = kadmin_as(admin, 'delprinc -force none')
if 'Operation requires' not in out:
fail('delprinc failure (wildcard backreferences not matched)')
realm.addprinc('four/one/three', 'pw')
out = kadmin_as(onetwothreefour, 'delprinc -force four/one/three')
if 'Principal "four/one/three@KRBTEST.COM" deleted.' not in out:
fail('delprinc success (wildcard backreferences 2)')

kadmin_as(restrictions, 'addprinc -pw pw type1')
out = realm.run_kadminl('getprinc type1')
Expand Down

0 comments on commit 1192811

Please sign in to comment.