Add test for using "list" as user, runas and host.
This commit is contained in:
7
MANIFEST
7
MANIFEST
@@ -999,6 +999,13 @@ plugins/sudoers/regress/sudoers/test3.ldif.ok
|
||||
plugins/sudoers/regress/sudoers/test3.ldif2sudo.ok
|
||||
plugins/sudoers/regress/sudoers/test3.out.ok
|
||||
plugins/sudoers/regress/sudoers/test3.toke.ok
|
||||
plugins/sudoers/regress/sudoers/test30.in
|
||||
plugins/sudoers/regress/sudoers/test30.json.ok
|
||||
plugins/sudoers/regress/sudoers/test30.ldif.ok
|
||||
plugins/sudoers/regress/sudoers/test30.ldif2sudo.ok
|
||||
plugins/sudoers/regress/sudoers/test30.out.ok
|
||||
plugins/sudoers/regress/sudoers/test30.sudo.ok
|
||||
plugins/sudoers/regress/sudoers/test30.toke.ok
|
||||
plugins/sudoers/regress/sudoers/test4.in
|
||||
plugins/sudoers/regress/sudoers/test4.json.ok
|
||||
plugins/sudoers/regress/sudoers/test4.ldif.ok
|
||||
|
10
plugins/sudoers/regress/sudoers/test30.in
Normal file
10
plugins/sudoers/regress/sudoers/test30.in
Normal file
@@ -0,0 +1,10 @@
|
||||
# Test parsing of "list" pseudo-command.
|
||||
# It should be allowed as a command but also as a user or host.
|
||||
|
||||
user1 ALL = list
|
||||
|
||||
list ALL = ALL
|
||||
|
||||
user2 ALL = (list : list) ALL
|
||||
|
||||
user3 list = ALL
|
79
plugins/sudoers/regress/sudoers/test30.json.ok
Normal file
79
plugins/sudoers/regress/sudoers/test30.json.ok
Normal file
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"User_Specs": [
|
||||
{
|
||||
"User_List": [
|
||||
{ "username": "user1" }
|
||||
],
|
||||
"Host_List": [
|
||||
{ "hostname": "ALL" }
|
||||
],
|
||||
"Cmnd_Specs": [
|
||||
{
|
||||
"Commands": [
|
||||
{ "command": "list" }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"User_List": [
|
||||
{ "username": "list" }
|
||||
],
|
||||
"Host_List": [
|
||||
{ "hostname": "ALL" }
|
||||
],
|
||||
"Cmnd_Specs": [
|
||||
{
|
||||
"Options": [
|
||||
{ "setenv": true }
|
||||
],
|
||||
"Commands": [
|
||||
{ "command": "ALL" }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"User_List": [
|
||||
{ "username": "user2" }
|
||||
],
|
||||
"Host_List": [
|
||||
{ "hostname": "ALL" }
|
||||
],
|
||||
"Cmnd_Specs": [
|
||||
{
|
||||
"runasusers": [
|
||||
{ "username": "list" }
|
||||
],
|
||||
"runasgroups": [
|
||||
{ "usergroup": "list" }
|
||||
],
|
||||
"Options": [
|
||||
{ "setenv": true }
|
||||
],
|
||||
"Commands": [
|
||||
{ "command": "ALL" }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"User_List": [
|
||||
{ "username": "user3" }
|
||||
],
|
||||
"Host_List": [
|
||||
{ "hostname": "list" }
|
||||
],
|
||||
"Cmnd_Specs": [
|
||||
{
|
||||
"Options": [
|
||||
{ "setenv": true }
|
||||
],
|
||||
"Commands": [
|
||||
{ "command": "ALL" }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
38
plugins/sudoers/regress/sudoers/test30.ldif.ok
Normal file
38
plugins/sudoers/regress/sudoers/test30.ldif.ok
Normal file
@@ -0,0 +1,38 @@
|
||||
dn: cn=user1,ou=SUDOers,dc=sudo,dc=ws
|
||||
objectClass: top
|
||||
objectClass: sudoRole
|
||||
cn: user1
|
||||
sudoUser: user1
|
||||
sudoHost: ALL
|
||||
sudoCommand: list
|
||||
sudoOrder: 1
|
||||
|
||||
dn: cn=list,ou=SUDOers,dc=sudo,dc=ws
|
||||
objectClass: top
|
||||
objectClass: sudoRole
|
||||
cn: list
|
||||
sudoUser: list
|
||||
sudoHost: ALL
|
||||
sudoCommand: ALL
|
||||
sudoOrder: 2
|
||||
|
||||
dn: cn=user2,ou=SUDOers,dc=sudo,dc=ws
|
||||
objectClass: top
|
||||
objectClass: sudoRole
|
||||
cn: user2
|
||||
sudoUser: user2
|
||||
sudoHost: ALL
|
||||
sudoRunAsUser: list
|
||||
sudoRunAsGroup: list
|
||||
sudoCommand: ALL
|
||||
sudoOrder: 3
|
||||
|
||||
dn: cn=user3,ou=SUDOers,dc=sudo,dc=ws
|
||||
objectClass: top
|
||||
objectClass: sudoRole
|
||||
cn: user3
|
||||
sudoUser: user3
|
||||
sudoHost: list
|
||||
sudoCommand: ALL
|
||||
sudoOrder: 4
|
||||
|
11
plugins/sudoers/regress/sudoers/test30.ldif2sudo.ok
Normal file
11
plugins/sudoers/regress/sudoers/test30.ldif2sudo.ok
Normal file
@@ -0,0 +1,11 @@
|
||||
# sudoRole user1
|
||||
user1 ALL = list
|
||||
|
||||
# sudoRole list
|
||||
list ALL = ALL
|
||||
|
||||
# sudoRole user2
|
||||
user2 ALL = (list : list) ALL
|
||||
|
||||
# sudoRole user3
|
||||
user3 list = ALL
|
6
plugins/sudoers/regress/sudoers/test30.out.ok
Normal file
6
plugins/sudoers/regress/sudoers/test30.out.ok
Normal file
@@ -0,0 +1,6 @@
|
||||
Parses OK
|
||||
|
||||
user1 ALL = list
|
||||
list ALL = ALL
|
||||
user2 ALL = (list : list) ALL
|
||||
user3 list = ALL
|
7
plugins/sudoers/regress/sudoers/test30.sudo.ok
Normal file
7
plugins/sudoers/regress/sudoers/test30.sudo.ok
Normal file
@@ -0,0 +1,7 @@
|
||||
user1 ALL = list
|
||||
|
||||
list ALL = ALL
|
||||
|
||||
user2 ALL = (list : list) ALL
|
||||
|
||||
user3 list = ALL
|
10
plugins/sudoers/regress/sudoers/test30.toke.ok
Normal file
10
plugins/sudoers/regress/sudoers/test30.toke.ok
Normal file
@@ -0,0 +1,10 @@
|
||||
#
|
||||
#
|
||||
|
||||
WORD(6) ALL = WORD(6)
|
||||
|
||||
WORD(6) ALL = ALL
|
||||
|
||||
WORD(6) ALL = ( WORD(6) : WORD(6) ) ALL
|
||||
|
||||
WORD(6) WORD(6) = ALL
|
Reference in New Issue
Block a user