Add test to exercise RunasSpec without a RunasUser.
This commit is contained in:
6
MANIFEST
6
MANIFEST
@@ -852,6 +852,12 @@ plugins/sudoers/regress/sudoers/test26.ldif.ok
|
|||||||
plugins/sudoers/regress/sudoers/test26.ldif2sudo.ok
|
plugins/sudoers/regress/sudoers/test26.ldif2sudo.ok
|
||||||
plugins/sudoers/regress/sudoers/test26.out.ok
|
plugins/sudoers/regress/sudoers/test26.out.ok
|
||||||
plugins/sudoers/regress/sudoers/test26.toke.ok
|
plugins/sudoers/regress/sudoers/test26.toke.ok
|
||||||
|
plugins/sudoers/regress/sudoers/test27.in
|
||||||
|
plugins/sudoers/regress/sudoers/test27.json.ok
|
||||||
|
plugins/sudoers/regress/sudoers/test27.ldif.ok
|
||||||
|
plugins/sudoers/regress/sudoers/test27.ldif2sudo.ok
|
||||||
|
plugins/sudoers/regress/sudoers/test27.out.ok
|
||||||
|
plugins/sudoers/regress/sudoers/test27.toke.ok
|
||||||
plugins/sudoers/regress/sudoers/test3.in
|
plugins/sudoers/regress/sudoers/test3.in
|
||||||
plugins/sudoers/regress/sudoers/test3.json.ok
|
plugins/sudoers/regress/sudoers/test3.json.ok
|
||||||
plugins/sudoers/regress/sudoers/test3.ldif.ok
|
plugins/sudoers/regress/sudoers/test3.ldif.ok
|
||||||
|
10
plugins/sudoers/regress/sudoers/test27.in
Normal file
10
plugins/sudoers/regress/sudoers/test27.in
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# Query the group plugin too (if there is one)
|
||||||
|
Defaults always_query_group_plugin
|
||||||
|
|
||||||
|
# Test RunasGroup with and without RunasUser
|
||||||
|
root ALL = ( root : wheel ) ALL
|
||||||
|
millert ALL = ( : wheel ) ALL
|
||||||
|
%sudo ALL = ( : wheel ) ALL
|
||||||
|
|
||||||
|
# Test RunasUser with %group syntax
|
||||||
|
operator ALL = ( %wheel ) ALL
|
98
plugins/sudoers/regress/sudoers/test27.json.ok
Normal file
98
plugins/sudoers/regress/sudoers/test27.json.ok
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
{
|
||||||
|
"Defaults": [
|
||||||
|
{
|
||||||
|
"Options": [
|
||||||
|
{ "always_query_group_plugin": true }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"User_Specs": [
|
||||||
|
{
|
||||||
|
"User_List": [
|
||||||
|
{ "username": "root" }
|
||||||
|
],
|
||||||
|
"Host_List": [
|
||||||
|
{ "hostname": "ALL" }
|
||||||
|
],
|
||||||
|
"Cmnd_Specs": [
|
||||||
|
{
|
||||||
|
"runasusers": [
|
||||||
|
{ "username": "root" }
|
||||||
|
],
|
||||||
|
"runasgroups": [
|
||||||
|
{ "usergroup": "wheel" }
|
||||||
|
],
|
||||||
|
"Options": [
|
||||||
|
{ "setenv": true }
|
||||||
|
],
|
||||||
|
"Commands": [
|
||||||
|
{ "command": "ALL" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"User_List": [
|
||||||
|
{ "username": "millert" }
|
||||||
|
],
|
||||||
|
"Host_List": [
|
||||||
|
{ "hostname": "ALL" }
|
||||||
|
],
|
||||||
|
"Cmnd_Specs": [
|
||||||
|
{
|
||||||
|
"runasgroups": [
|
||||||
|
{ "usergroup": "wheel" }
|
||||||
|
],
|
||||||
|
"Options": [
|
||||||
|
{ "setenv": true }
|
||||||
|
],
|
||||||
|
"Commands": [
|
||||||
|
{ "command": "ALL" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"User_List": [
|
||||||
|
{ "usergroup": "sudo" }
|
||||||
|
],
|
||||||
|
"Host_List": [
|
||||||
|
{ "hostname": "ALL" }
|
||||||
|
],
|
||||||
|
"Cmnd_Specs": [
|
||||||
|
{
|
||||||
|
"runasgroups": [
|
||||||
|
{ "usergroup": "wheel" }
|
||||||
|
],
|
||||||
|
"Options": [
|
||||||
|
{ "setenv": true }
|
||||||
|
],
|
||||||
|
"Commands": [
|
||||||
|
{ "command": "ALL" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"User_List": [
|
||||||
|
{ "username": "operator" }
|
||||||
|
],
|
||||||
|
"Host_List": [
|
||||||
|
{ "hostname": "ALL" }
|
||||||
|
],
|
||||||
|
"Cmnd_Specs": [
|
||||||
|
{
|
||||||
|
"runasusers": [
|
||||||
|
{ "usergroup": "wheel" }
|
||||||
|
],
|
||||||
|
"Options": [
|
||||||
|
{ "setenv": true }
|
||||||
|
],
|
||||||
|
"Commands": [
|
||||||
|
{ "command": "ALL" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
48
plugins/sudoers/regress/sudoers/test27.ldif.ok
Normal file
48
plugins/sudoers/regress/sudoers/test27.ldif.ok
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
dn: cn=defaults,ou=SUDOers,dc=sudo,dc=ws
|
||||||
|
objectClass: top
|
||||||
|
objectClass: sudoRole
|
||||||
|
cn: defaults
|
||||||
|
description: Default sudoOption's go here
|
||||||
|
sudoOption: always_query_group_plugin
|
||||||
|
|
||||||
|
dn: cn=root,ou=SUDOers,dc=sudo,dc=ws
|
||||||
|
objectClass: top
|
||||||
|
objectClass: sudoRole
|
||||||
|
cn: root
|
||||||
|
sudoUser: root
|
||||||
|
sudoHost: ALL
|
||||||
|
sudoRunAsUser: root
|
||||||
|
sudoRunAsGroup: wheel
|
||||||
|
sudoCommand: ALL
|
||||||
|
sudoOrder: 1
|
||||||
|
|
||||||
|
dn: cn=millert,ou=SUDOers,dc=sudo,dc=ws
|
||||||
|
objectClass: top
|
||||||
|
objectClass: sudoRole
|
||||||
|
cn: millert
|
||||||
|
sudoUser: millert
|
||||||
|
sudoHost: ALL
|
||||||
|
sudoRunAsGroup: wheel
|
||||||
|
sudoCommand: ALL
|
||||||
|
sudoOrder: 2
|
||||||
|
|
||||||
|
dn: cn=%sudo,ou=SUDOers,dc=sudo,dc=ws
|
||||||
|
objectClass: top
|
||||||
|
objectClass: sudoRole
|
||||||
|
cn: %sudo
|
||||||
|
sudoUser: %sudo
|
||||||
|
sudoHost: ALL
|
||||||
|
sudoRunAsGroup: wheel
|
||||||
|
sudoCommand: ALL
|
||||||
|
sudoOrder: 3
|
||||||
|
|
||||||
|
dn: cn=operator,ou=SUDOers,dc=sudo,dc=ws
|
||||||
|
objectClass: top
|
||||||
|
objectClass: sudoRole
|
||||||
|
cn: operator
|
||||||
|
sudoUser: operator
|
||||||
|
sudoHost: ALL
|
||||||
|
sudoRunAsUser: %wheel
|
||||||
|
sudoCommand: ALL
|
||||||
|
sudoOrder: 4
|
||||||
|
|
11
plugins/sudoers/regress/sudoers/test27.ldif2sudo.ok
Normal file
11
plugins/sudoers/regress/sudoers/test27.ldif2sudo.ok
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# sudoRole root
|
||||||
|
root ALL = (root : wheel) ALL
|
||||||
|
|
||||||
|
# sudoRole millert
|
||||||
|
millert ALL = ( : wheel) ALL
|
||||||
|
|
||||||
|
# sudoRole %sudo
|
||||||
|
%sudo ALL = ( : wheel) ALL
|
||||||
|
|
||||||
|
# sudoRole operator
|
||||||
|
operator ALL = (%wheel) ALL
|
8
plugins/sudoers/regress/sudoers/test27.out.ok
Normal file
8
plugins/sudoers/regress/sudoers/test27.out.ok
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
Parses OK
|
||||||
|
|
||||||
|
Defaults always_query_group_plugin
|
||||||
|
|
||||||
|
root ALL = (root : wheel) ALL
|
||||||
|
millert ALL = ( : wheel) ALL
|
||||||
|
%sudo ALL = ( : wheel) ALL
|
||||||
|
operator ALL = (%wheel) ALL
|
10
plugins/sudoers/regress/sudoers/test27.toke.ok
Normal file
10
plugins/sudoers/regress/sudoers/test27.toke.ok
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#
|
||||||
|
DEFAULTS DEFVAR
|
||||||
|
|
||||||
|
#
|
||||||
|
WORD(6) ALL = ( WORD(6) : WORD(6) ) ALL
|
||||||
|
WORD(6) ALL = ( : WORD(6) ) ALL
|
||||||
|
USERGROUP ALL = ( : WORD(6) ) ALL
|
||||||
|
|
||||||
|
#
|
||||||
|
WORD(6) ALL = ( USERGROUP ) ALL
|
Reference in New Issue
Block a user