mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-22 01:49:11 +00:00
Add some more ldif -> sudoers tests to verify sudoOrder.
This commit is contained in:
parent
ea38e9d909
commit
2221fbe2f1
4
MANIFEST
4
MANIFEST
@ -446,6 +446,10 @@ plugins/sudoers/regress/cvtsudoers/test26.out.ok
|
|||||||
plugins/sudoers/regress/cvtsudoers/test26.sh
|
plugins/sudoers/regress/cvtsudoers/test26.sh
|
||||||
plugins/sudoers/regress/cvtsudoers/test27.out.ok
|
plugins/sudoers/regress/cvtsudoers/test27.out.ok
|
||||||
plugins/sudoers/regress/cvtsudoers/test27.sh
|
plugins/sudoers/regress/cvtsudoers/test27.sh
|
||||||
|
plugins/sudoers/regress/cvtsudoers/test28.out.ok
|
||||||
|
plugins/sudoers/regress/cvtsudoers/test28.sh
|
||||||
|
plugins/sudoers/regress/cvtsudoers/test29.out.ok
|
||||||
|
plugins/sudoers/regress/cvtsudoers/test29.sh
|
||||||
plugins/sudoers/regress/cvtsudoers/test3.out.ok
|
plugins/sudoers/regress/cvtsudoers/test3.out.ok
|
||||||
plugins/sudoers/regress/cvtsudoers/test3.sh
|
plugins/sudoers/regress/cvtsudoers/test3.sh
|
||||||
plugins/sudoers/regress/cvtsudoers/test4.out.ok
|
plugins/sudoers/regress/cvtsudoers/test4.out.ok
|
||||||
|
10
plugins/sudoers/regress/cvtsudoers/test28.out.ok
Normal file
10
plugins/sudoers/regress/cvtsudoers/test28.out.ok
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
Defaults log_output
|
||||||
|
|
||||||
|
# sudoRole millert
|
||||||
|
millert ALL = (ALL : ALL) ALL
|
||||||
|
|
||||||
|
# sudoRole root
|
||||||
|
root ALL = (ALL : ALL) NOPASSWD: ALL
|
||||||
|
|
||||||
|
# sudoRole %wheel
|
||||||
|
%wheel +sudo-hosts = (ALL : ALL) NOPASSWD: ALL
|
73
plugins/sudoers/regress/cvtsudoers/test28.sh
Executable file
73
plugins/sudoers/regress/cvtsudoers/test28.sh
Executable file
@ -0,0 +1,73 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Test LDAP sudoOrder when converting to sudoers.
|
||||||
|
#
|
||||||
|
|
||||||
|
exec 2>&1
|
||||||
|
./cvtsudoers -c "" -i ldif -f sudoers <<EOF
|
||||||
|
dn: dc=sudo,dc=ws
|
||||||
|
objectClass: dcObject
|
||||||
|
objectClass: organization
|
||||||
|
dc: courtesan
|
||||||
|
o: Sudo World Headquarters
|
||||||
|
description: Sudo World Headquarters
|
||||||
|
|
||||||
|
# Organizational Role for Directory Manager
|
||||||
|
dn: cn=Manager,dc=sudo,dc=ws
|
||||||
|
objectClass: organizationalRole
|
||||||
|
cn: Manager
|
||||||
|
description: Directory Manager
|
||||||
|
|
||||||
|
# SUDOers, sudo.ws
|
||||||
|
dn: ou=SUDOers,dc=sudo,dc=ws
|
||||||
|
objectClass: top
|
||||||
|
objectClass: organizationalUnit
|
||||||
|
description: SUDO Configuration Subtree
|
||||||
|
ou: SUDOers
|
||||||
|
|
||||||
|
# defaults, SUDOers, sudo.ws
|
||||||
|
dn: cn=defaults,ou=SUDOers,dc=sudo,dc=ws
|
||||||
|
objectClass: top
|
||||||
|
objectClass: sudoRole
|
||||||
|
cn: defaults
|
||||||
|
description: Default sudoOption's go here
|
||||||
|
sudoOption: log_output
|
||||||
|
|
||||||
|
# root, SUDOers, sudo.ws
|
||||||
|
dn: cn=root,ou=SUDOers,dc=sudo,dc=ws
|
||||||
|
objectClass: top
|
||||||
|
objectClass: sudoRole
|
||||||
|
cn: root
|
||||||
|
sudoUser: root
|
||||||
|
sudoRunAsUser: ALL
|
||||||
|
sudoRunAsGroup: ALL
|
||||||
|
sudoHost: ALL
|
||||||
|
sudoCommand: ALL
|
||||||
|
sudoOption: !authenticate
|
||||||
|
sudoOrder: 10
|
||||||
|
|
||||||
|
# %wheel, SUDOers, sudo.ws
|
||||||
|
dn: cn=%wheel,ou=SUDOers,dc=sudo,dc=ws
|
||||||
|
objectClass: top
|
||||||
|
objectClass: sudoRole
|
||||||
|
cn: %wheel
|
||||||
|
sudoUser: %wheel
|
||||||
|
sudoRunAsUser: ALL
|
||||||
|
sudoRunAsGroup: ALL
|
||||||
|
sudoHost: +sudo-hosts
|
||||||
|
sudoCommand: ALL
|
||||||
|
sudoOption: !authenticate
|
||||||
|
sudoOrder: 10
|
||||||
|
|
||||||
|
# millert, SUDOers, sudo.ws
|
||||||
|
dn: cn=millert,ou=SUDOers,dc=sudo,dc=ws
|
||||||
|
objectClass: top
|
||||||
|
objectClass: sudoRole
|
||||||
|
cn: millert
|
||||||
|
sudoUser: millert
|
||||||
|
sudoRunAsUser: ALL
|
||||||
|
sudoRunAsGroup: ALL
|
||||||
|
sudoHost: ALL
|
||||||
|
sudoCommand: ALL
|
||||||
|
sudoOrder: 5
|
||||||
|
EOF
|
4
plugins/sudoers/regress/cvtsudoers/test29.out.ok
Normal file
4
plugins/sudoers/regress/cvtsudoers/test29.out.ok
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
Defaults log_output
|
||||||
|
|
||||||
|
# sudoRole millert, millert2
|
||||||
|
millert ALL = (ALL : ALL) ALL, NOPASSWD: ALL
|
60
plugins/sudoers/regress/cvtsudoers/test29.sh
Executable file
60
plugins/sudoers/regress/cvtsudoers/test29.sh
Executable file
@ -0,0 +1,60 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Test LDAP sudoOrder when converting to sudoers.
|
||||||
|
#
|
||||||
|
|
||||||
|
exec 2>&1
|
||||||
|
./cvtsudoers -c "" -i ldif -f sudoers <<EOF
|
||||||
|
dn: dc=sudo,dc=ws
|
||||||
|
objectClass: dcObject
|
||||||
|
objectClass: organization
|
||||||
|
dc: courtesan
|
||||||
|
o: Sudo World Headquarters
|
||||||
|
description: Sudo World Headquarters
|
||||||
|
|
||||||
|
# Organizational Role for Directory Manager
|
||||||
|
dn: cn=Manager,dc=sudo,dc=ws
|
||||||
|
objectClass: organizationalRole
|
||||||
|
cn: Manager
|
||||||
|
description: Directory Manager
|
||||||
|
|
||||||
|
# SUDOers, sudo.ws
|
||||||
|
dn: ou=SUDOers,dc=sudo,dc=ws
|
||||||
|
objectClass: top
|
||||||
|
objectClass: organizationalUnit
|
||||||
|
description: SUDO Configuration Subtree
|
||||||
|
ou: SUDOers
|
||||||
|
|
||||||
|
# defaults, SUDOers, sudo.ws
|
||||||
|
dn: cn=defaults,ou=SUDOers,dc=sudo,dc=ws
|
||||||
|
objectClass: top
|
||||||
|
objectClass: sudoRole
|
||||||
|
cn: defaults
|
||||||
|
description: Default sudoOption's go here
|
||||||
|
sudoOption: log_output
|
||||||
|
|
||||||
|
# millert, SUDOers, sudo.ws
|
||||||
|
dn: cn=millert,ou=SUDOers,dc=sudo,dc=ws
|
||||||
|
objectClass: top
|
||||||
|
objectClass: sudoRole
|
||||||
|
cn: millert
|
||||||
|
sudoUser: millert
|
||||||
|
sudoRunAsUser: ALL
|
||||||
|
sudoRunAsGroup: ALL
|
||||||
|
sudoHost: ALL
|
||||||
|
sudoCommand: ALL
|
||||||
|
sudoOrder: 5
|
||||||
|
|
||||||
|
# millert2, SUDOers, sudo.ws
|
||||||
|
dn: cn=millert2,ou=SUDOers,dc=sudo,dc=ws
|
||||||
|
objectClass: top
|
||||||
|
objectClass: sudoRole
|
||||||
|
cn: millert2
|
||||||
|
sudoUser: millert
|
||||||
|
sudoRunAsUser: ALL
|
||||||
|
sudoRunAsGroup: ALL
|
||||||
|
sudoHost: ALL
|
||||||
|
sudoCommand: ALL
|
||||||
|
sudoOption: !authenticate
|
||||||
|
sudoOrder: 10
|
||||||
|
EOF
|
Loading…
x
Reference in New Issue
Block a user