|
Packit Service |
a2ae7a |
(* Module: Test_sudoers *)
|
|
Packit Service |
a2ae7a |
module Test_sudoers =
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let test_user = [ label "user" . Sudoers.sto_to_com_user . Util.eol ]*
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(* Test: test_user *)
|
|
Packit Service |
a2ae7a |
test test_user get "root
|
|
Packit Service |
a2ae7a |
@pbuilder
|
|
Packit Service |
a2ae7a |
+secre-taries
|
|
Packit Service |
a2ae7a |
@my\ admin\ group
|
|
Packit Service |
a2ae7a |
EXAMPLE\\\\cslack
|
|
Packit Service |
a2ae7a |
MY\ EX-AMPLE\ 9\\\\cslack\ group
|
|
Packit Service |
a2ae7a |
" =
|
|
Packit Service |
a2ae7a |
{ "user" = "root" }
|
|
Packit Service |
a2ae7a |
{ "user" = "@pbuilder" }
|
|
Packit Service |
a2ae7a |
{ "user" = "+secre-taries" }
|
|
Packit Service |
a2ae7a |
{ "user" = "@my\\ admin\\ group" }
|
|
Packit Service |
a2ae7a |
{ "user" = "EXAMPLE\\\\cslack" }
|
|
Packit Service |
a2ae7a |
{ "user" = "MY\\ EX-AMPLE\\ 9\\\\cslack\\ group" }
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let conf = "
|
|
Packit Service |
a2ae7a |
Host_Alias LOCALNET = 192.168.0.0/24, localhost
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
# User alias specification
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
User_Alias EXAMPLE_ADMINS = cslack, EXAMPLE\\\\cslack,\
|
|
Packit Service |
a2ae7a |
EXAMPLE\\\\jmalstrom
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
# Cmnd alias specification
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
Cmnd_Alias \
|
|
Packit Service |
a2ae7a |
DEBIAN_TOOLS \
|
|
Packit Service |
a2ae7a |
= \
|
|
Packit Service |
a2ae7a |
/usr/bin/apt-get,\
|
|
Packit Service |
a2ae7a |
/usr/bin/auto-get, \
|
|
Packit Service |
a2ae7a |
/usr/bin/dpkg, /usr/bin/dselect, /usr/sbin/dpkg-reconfigure \
|
|
Packit Service |
a2ae7a |
: PBUILDER = /usr/sbin/pbuilder
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
Cmnd_Alias ICAL = /bin/cat /home/rpinson/.kde/share/apps/korganizer/std.ics
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
Defaults@LOCALNET !lecture, \
|
|
Packit Service |
a2ae7a |
\t\t tty_tickets,!fqdn, !!env_reset
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
Defaults !visiblepw
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
Defaults:buildd env_keep+=\"APT_CONFIG DEBIAN_FRONTEND SHELL\"
|
|
Packit Service |
a2ae7a |
Defaults!PBUILDER env_keep+=\"HOME ARCH DIST DISTRIBUTION PDEBUILD_PBUILDER\"
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
# User privilege specification
|
|
Packit Service |
a2ae7a |
root ALL=(ALL) ALL
|
|
Packit Service |
a2ae7a |
root ALL=(: ALL) ALL
|
|
Packit Service |
a2ae7a |
root ALL=(ALL :ALL) ALL
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
# Members of the admin group may gain root privileges
|
|
Packit Service |
a2ae7a |
%admin ALL=(ALL) ALL, NOPASSWD : NOSETENV: \
|
|
Packit Service |
a2ae7a |
DEBIAN_TOOLS
|
|
Packit Service |
a2ae7a |
%pbuilder LOCALNET = NOPASSWD: PBUILDER
|
|
Packit Service |
a2ae7a |
www-data +biglab=(rpinson)NOEXEC: ICAL \
|
|
Packit Service |
a2ae7a |
: \
|
|
Packit Service |
a2ae7a |
localhost = NOPASSWD: /usr/bin/test
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
+secretaries ALPHA = /usr/bin/su [!-]*, !/usr/bin/su *root*
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
@my\ admin\ group ALL=(root) NOPASSWD: /usr/bin/python /usr/local/sbin/filterlog -iu\\=www /var/log/something.log
|
|
Packit Service |
a2ae7a |
#includedir /etc/sudoers.d
|
|
Packit Service |
a2ae7a |
#include /etc/sudoers.d
|
|
Packit Service |
a2ae7a |
"
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
test Sudoers.lns get conf =
|
|
Packit Service |
a2ae7a |
{}
|
|
Packit Service |
a2ae7a |
{ "Host_Alias"
|
|
Packit Service |
a2ae7a |
{ "alias"
|
|
Packit Service |
a2ae7a |
{ "name" = "LOCALNET" }
|
|
Packit Service |
a2ae7a |
{ "host" = "192.168.0.0/24" }
|
|
Packit Service |
a2ae7a |
{ "host" = "localhost" } } }
|
|
Packit Service |
a2ae7a |
{}
|
|
Packit Service |
a2ae7a |
{ "#comment" = "User alias specification" }
|
|
Packit Service |
a2ae7a |
{}
|
|
Packit Service |
a2ae7a |
{ "User_Alias"
|
|
Packit Service |
a2ae7a |
{ "alias"
|
|
Packit Service |
a2ae7a |
{ "name" = "EXAMPLE_ADMINS" }
|
|
Packit Service |
a2ae7a |
{ "user" = "cslack" }
|
|
Packit Service |
a2ae7a |
{ "user" = "EXAMPLE\\\\cslack" }
|
|
Packit Service |
a2ae7a |
{ "user" = "EXAMPLE\\\\jmalstrom" } } }
|
|
Packit Service |
a2ae7a |
{}
|
|
Packit Service |
a2ae7a |
{ "#comment" = "Cmnd alias specification" }
|
|
Packit Service |
a2ae7a |
{}
|
|
Packit Service |
a2ae7a |
{ "Cmnd_Alias"
|
|
Packit Service |
a2ae7a |
{ "alias"
|
|
Packit Service |
a2ae7a |
{ "name" = "DEBIAN_TOOLS" }
|
|
Packit Service |
a2ae7a |
{ "command" = "/usr/bin/apt-get" }
|
|
Packit Service |
a2ae7a |
{ "command" = "/usr/bin/auto-get" }
|
|
Packit Service |
a2ae7a |
{ "command" = "/usr/bin/dpkg" }
|
|
Packit Service |
a2ae7a |
{ "command" = "/usr/bin/dselect" }
|
|
Packit Service |
a2ae7a |
{ "command" = "/usr/sbin/dpkg-reconfigure" } }
|
|
Packit Service |
a2ae7a |
{ "alias"
|
|
Packit Service |
a2ae7a |
{ "name" = "PBUILDER" }
|
|
Packit Service |
a2ae7a |
{ "command" = "/usr/sbin/pbuilder" } } }
|
|
Packit Service |
a2ae7a |
{}
|
|
Packit Service |
a2ae7a |
{ "Cmnd_Alias"
|
|
Packit Service |
a2ae7a |
{ "alias"
|
|
Packit Service |
a2ae7a |
{ "name" = "ICAL" }
|
|
Packit Service |
a2ae7a |
{ "command" = "/bin/cat /home/rpinson/.kde/share/apps/korganizer/std.ics" } } }
|
|
Packit Service |
a2ae7a |
{}
|
|
Packit Service |
a2ae7a |
{ "Defaults"
|
|
Packit Service |
a2ae7a |
{ "type" = "@LOCALNET" }
|
|
Packit Service |
a2ae7a |
{ "lecture" { "negate" } }
|
|
Packit Service |
a2ae7a |
{ "tty_tickets" }
|
|
Packit Service |
a2ae7a |
{ "fqdn" { "negate" } }
|
|
Packit Service |
a2ae7a |
{ "env_reset" } }
|
|
Packit Service |
a2ae7a |
{}
|
|
Packit Service |
a2ae7a |
{ "Defaults"
|
|
Packit Service |
a2ae7a |
{ "visiblepw" { "negate" } } }
|
|
Packit Service |
a2ae7a |
{}
|
|
Packit Service |
a2ae7a |
{ "Defaults"
|
|
Packit Service |
a2ae7a |
{ "type" = ":buildd" }
|
|
Packit Service |
a2ae7a |
{ "env_keep"
|
|
Packit Service |
a2ae7a |
{ "append" }
|
|
Packit Service |
a2ae7a |
{ "var" = "APT_CONFIG" }
|
|
Packit Service |
a2ae7a |
{ "var" = "DEBIAN_FRONTEND" }
|
|
Packit Service |
a2ae7a |
{ "var" = "SHELL" } } }
|
|
Packit Service |
a2ae7a |
{ "Defaults"
|
|
Packit Service |
a2ae7a |
{ "type" = "!PBUILDER" }
|
|
Packit Service |
a2ae7a |
{ "env_keep"
|
|
Packit Service |
a2ae7a |
{ "append" }
|
|
Packit Service |
a2ae7a |
{ "var" = "HOME" }
|
|
Packit Service |
a2ae7a |
{ "var" = "ARCH" }
|
|
Packit Service |
a2ae7a |
{ "var" = "DIST" }
|
|
Packit Service |
a2ae7a |
{ "var" = "DISTRIBUTION" }
|
|
Packit Service |
a2ae7a |
{ "var" = "PDEBUILD_PBUILDER" } } }
|
|
Packit Service |
a2ae7a |
{}
|
|
Packit Service |
a2ae7a |
{ "#comment" = "User privilege specification" }
|
|
Packit Service |
a2ae7a |
{ "spec"
|
|
Packit Service |
a2ae7a |
{ "user" = "root" }
|
|
Packit Service |
a2ae7a |
{ "host_group"
|
|
Packit Service |
a2ae7a |
{ "host" = "ALL" }
|
|
Packit Service |
a2ae7a |
{ "command" = "ALL"
|
|
Packit Service |
a2ae7a |
{ "runas_user" = "ALL" } } } }
|
|
Packit Service |
a2ae7a |
{ "spec"
|
|
Packit Service |
a2ae7a |
{ "user" = "root" }
|
|
Packit Service |
a2ae7a |
{ "host_group"
|
|
Packit Service |
a2ae7a |
{ "host" = "ALL" }
|
|
Packit Service |
a2ae7a |
{ "command" = "ALL"
|
|
Packit Service |
a2ae7a |
{ "runas_group" = "ALL" } } } }
|
|
Packit Service |
a2ae7a |
{ "spec"
|
|
Packit Service |
a2ae7a |
{ "user" = "root" }
|
|
Packit Service |
a2ae7a |
{ "host_group"
|
|
Packit Service |
a2ae7a |
{ "host" = "ALL" }
|
|
Packit Service |
a2ae7a |
{ "command" = "ALL"
|
|
Packit Service |
a2ae7a |
{ "runas_user" = "ALL" }
|
|
Packit Service |
a2ae7a |
{ "runas_group" = "ALL" } } } }
|
|
Packit Service |
a2ae7a |
{}
|
|
Packit Service |
a2ae7a |
{ "#comment" = "Members of the admin group may gain root privileges" }
|
|
Packit Service |
a2ae7a |
{ "spec"
|
|
Packit Service |
a2ae7a |
{ "user" = "%admin" }
|
|
Packit Service |
a2ae7a |
{ "host_group"
|
|
Packit Service |
a2ae7a |
{ "host" = "ALL" }
|
|
Packit Service |
a2ae7a |
{ "command" = "ALL"
|
|
Packit Service |
a2ae7a |
{ "runas_user" = "ALL" } }
|
|
Packit Service |
a2ae7a |
{ "command" = "DEBIAN_TOOLS"
|
|
Packit Service |
a2ae7a |
{ "tag" = "NOPASSWD" }
|
|
Packit Service |
a2ae7a |
{ "tag" = "NOSETENV" } } } }
|
|
Packit Service |
a2ae7a |
{ "spec"
|
|
Packit Service |
a2ae7a |
{ "user" = "%pbuilder" }
|
|
Packit Service |
a2ae7a |
{ "host_group"
|
|
Packit Service |
a2ae7a |
{ "host" = "LOCALNET" }
|
|
Packit Service |
a2ae7a |
{ "command" = "PBUILDER"
|
|
Packit Service |
a2ae7a |
{ "tag" = "NOPASSWD" } } } }
|
|
Packit Service |
a2ae7a |
{ "spec"
|
|
Packit Service |
a2ae7a |
{ "user" = "www-data" }
|
|
Packit Service |
a2ae7a |
{ "host_group"
|
|
Packit Service |
a2ae7a |
{ "host" = "+biglab" }
|
|
Packit Service |
a2ae7a |
{ "command" = "ICAL"
|
|
Packit Service |
a2ae7a |
{ "runas_user" = "rpinson" }
|
|
Packit Service |
a2ae7a |
{ "tag" = "NOEXEC" } } }
|
|
Packit Service |
a2ae7a |
{ "host_group"
|
|
Packit Service |
a2ae7a |
{ "host" = "localhost" }
|
|
Packit Service |
a2ae7a |
{ "command" = "/usr/bin/test"
|
|
Packit Service |
a2ae7a |
{ "tag" = "NOPASSWD" } } } }
|
|
Packit Service |
a2ae7a |
{}
|
|
Packit Service |
a2ae7a |
{ "spec"
|
|
Packit Service |
a2ae7a |
{ "user" = "+secretaries" }
|
|
Packit Service |
a2ae7a |
{ "host_group"
|
|
Packit Service |
a2ae7a |
{ "host" = "ALPHA" }
|
|
Packit Service |
a2ae7a |
{ "command" = "/usr/bin/su [!-]*" }
|
|
Packit Service |
a2ae7a |
{ "command" = "/usr/bin/su *root*"
|
|
Packit Service |
a2ae7a |
{ "negate" } } } }
|
|
Packit Service |
a2ae7a |
{}
|
|
Packit Service |
a2ae7a |
{ "spec"
|
|
Packit Service |
a2ae7a |
{ "user" = "@my\ admin\ group" }
|
|
Packit Service |
a2ae7a |
{ "host_group"
|
|
Packit Service |
a2ae7a |
{ "host" = "ALL" }
|
|
Packit Service |
a2ae7a |
{ "command" = "/usr/bin/python /usr/local/sbin/filterlog -iu\\=www /var/log/something.log"
|
|
Packit Service |
a2ae7a |
{ "runas_user" = "root" }
|
|
Packit Service |
a2ae7a |
{ "tag" = "NOPASSWD" }
|
|
Packit Service |
a2ae7a |
}
|
|
Packit Service |
a2ae7a |
}
|
|
Packit Service |
a2ae7a |
}
|
|
Packit Service |
a2ae7a |
{ "#includedir" = "/etc/sudoers.d" }
|
|
Packit Service |
a2ae7a |
{ "#include" = "/etc/sudoers.d" }
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
test Sudoers.parameter_integer_bool
|
|
Packit Service |
a2ae7a |
put "umask = 022"
|
|
Packit Service |
a2ae7a |
after set "/umask/negate" "" = "!umask"
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
test Sudoers.parameter_integer_bool
|
|
Packit Service |
a2ae7a |
put "!!!!!umask"
|
|
Packit Service |
a2ae7a |
after rm "/umask/negate"; set "/umask" "022" = "!!!!umask = 022"
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
test Sudoers.parameter_integer_bool put "!!!!umask = 022" after
|
|
Packit Service |
a2ae7a |
set "/umask/negate" "" = "!!!!!umask"
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
test Sudoers.parameter_integer_bool get "!!!umask = 022" = *
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(* BZ 566134 *)
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let s = "Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin\n"
|
|
Packit Service |
a2ae7a |
test Sudoers.lns get s =
|
|
Packit Service |
a2ae7a |
{ "Defaults"
|
|
Packit Service |
a2ae7a |
{ "secure_path" = "/sbin:/bin:/usr/sbin:/usr/bin" } }
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(* Ticket #206, comments at end of lines *)
|
|
Packit Service |
a2ae7a |
let commenteol = "#
|
|
Packit Service |
a2ae7a |
Defaults targetpw # ask for
|
|
Packit Service |
a2ae7a |
Host_Alias LOCALNET = 192.168.0.0/24 # foo eol
|
|
Packit Service |
a2ae7a |
root ALL=(ALL) ALL # all root\n"
|
|
Packit Service |
a2ae7a |
test Sudoers.lns get commenteol =
|
|
Packit Service |
a2ae7a |
{}
|
|
Packit Service |
a2ae7a |
{ "Defaults"
|
|
Packit Service |
a2ae7a |
{ "targetpw" }
|
|
Packit Service |
a2ae7a |
{ "#comment" = "ask for" } }
|
|
Packit Service |
a2ae7a |
{ "Host_Alias"
|
|
Packit Service |
a2ae7a |
{ "alias"
|
|
Packit Service |
a2ae7a |
{ "name" = "LOCALNET" }
|
|
Packit Service |
a2ae7a |
{ "host" = "192.168.0.0/24" } }
|
|
Packit Service |
a2ae7a |
{ "#comment" = "foo eol" } }
|
|
Packit Service |
a2ae7a |
{ "spec"
|
|
Packit Service |
a2ae7a |
{ "user" = "root" }
|
|
Packit Service |
a2ae7a |
{ "host_group"
|
|
Packit Service |
a2ae7a |
{ "host" = "ALL" }
|
|
Packit Service |
a2ae7a |
{ "command" = "ALL"
|
|
Packit Service |
a2ae7a |
{ "runas_user" = "ALL" } } }
|
|
Packit Service |
a2ae7a |
{ "#comment" = "all root" } }
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(* Allow = in commands *)
|
|
Packit Service |
a2ae7a |
test Sudoers.spec get "root ALL= /usr/bin/mylvmbackup --configfile=/etc/mylvbackup_amanda.conf\n" =
|
|
Packit Service |
a2ae7a |
{ "spec"
|
|
Packit Service |
a2ae7a |
{ "user" = "root" }
|
|
Packit Service |
a2ae7a |
{ "host_group"
|
|
Packit Service |
a2ae7a |
{ "host" = "ALL" }
|
|
Packit Service |
a2ae7a |
{ "command" = "/usr/bin/mylvmbackup --configfile=/etc/mylvbackup_amanda.conf" } } }
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(* Allow commands without full path
|
|
Packit Service |
a2ae7a |
-- if they begin with a lowcase letter *)
|
|
Packit Service |
a2ae7a |
test Sudoers.spec get "root ALL= sudoedit /etc/passwd\n" =
|
|
Packit Service |
a2ae7a |
{ "spec"
|
|
Packit Service |
a2ae7a |
{ "user" = "root" }
|
|
Packit Service |
a2ae7a |
{ "host_group"
|
|
Packit Service |
a2ae7a |
{ "host" = "ALL" }
|
|
Packit Service |
a2ae7a |
{ "command" = "sudoedit /etc/passwd" } } }
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(* Ticket #263, quoted values in defaults line *)
|
|
Packit Service |
a2ae7a |
let defaults_spaces = "Defaults passprompt=\"Your SecurID Passcode: \"\n"
|
|
Packit Service |
a2ae7a |
test Sudoers.lns get defaults_spaces =
|
|
Packit Service |
a2ae7a |
{ "Defaults"
|
|
Packit Service |
a2ae7a |
{ "passprompt" = "\"Your SecurID Passcode: \"" }
|
|
Packit Service |
a2ae7a |
}
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(* Ticket #263, quoted values in defaults line (string/bool parameters) *)
|
|
Packit Service |
a2ae7a |
let defaults_spaces_strbool = "Defaults mailfrom=\"root@example.com\"\n"
|
|
Packit Service |
a2ae7a |
test Sudoers.lns get defaults_spaces_strbool =
|
|
Packit Service |
a2ae7a |
{ "Defaults"
|
|
Packit Service |
a2ae7a |
{ "mailfrom" = "\"root@example.com\"" }
|
|
Packit Service |
a2ae7a |
}
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(* Test: Sudoers.spec
|
|
Packit Service |
a2ae7a |
Spec users can be aliases *)
|
|
Packit Service |
a2ae7a |
test Sudoers.spec get "APACHE_ADMIN ALL= ALL\n" =
|
|
Packit Service |
a2ae7a |
{ "spec"
|
|
Packit Service |
a2ae7a |
{ "user" = "APACHE_ADMIN" }
|
|
Packit Service |
a2ae7a |
{ "host_group"
|
|
Packit Service |
a2ae7a |
{ "host" = "ALL" }
|
|
Packit Service |
a2ae7a |
{ "command" = "ALL" } } }
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(* Test: Sudoers.spec
|
|
Packit Service |
a2ae7a |
Ticket #337: allow period in user names *)
|
|
Packit Service |
a2ae7a |
test Sudoers.spec get "user.one somehost = ALL\n" =
|
|
Packit Service |
a2ae7a |
{ "spec"
|
|
Packit Service |
a2ae7a |
{ "user" = "user.one" }
|
|
Packit Service |
a2ae7a |
{ "host_group"
|
|
Packit Service |
a2ae7a |
{ "host" = "somehost" }
|
|
Packit Service |
a2ae7a |
{ "command" = "ALL" }
|
|
Packit Service |
a2ae7a |
}
|
|
Packit Service |
a2ae7a |
}
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(* Test: Sudoers.spec
|
|
Packit Service |
a2ae7a |
Ticket #370: allow underscore in group names *)
|
|
Packit Service |
a2ae7a |
test Sudoers.spec get "%sudo_users ALL=(ALL) ALL\n" =
|
|
Packit Service |
a2ae7a |
{ "spec"
|
|
Packit Service |
a2ae7a |
{ "user" = "%sudo_users" }
|
|
Packit Service |
a2ae7a |
{ "host_group"
|
|
Packit Service |
a2ae7a |
{ "host" = "ALL" }
|
|
Packit Service |
a2ae7a |
{ "command" = "ALL"
|
|
Packit Service |
a2ae7a |
{ "runas_user" = "ALL" } }
|
|
Packit Service |
a2ae7a |
}
|
|
Packit Service |
a2ae7a |
}
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(* Test: Sudoers.spec
|
|
Packit Service |
a2ae7a |
Ticket #376: allow uppercase characters in user names *)
|
|
Packit Service |
a2ae7a |
test Sudoers.spec get "%GrOup ALL = (ALL) ALL\n" =
|
|
Packit Service |
a2ae7a |
{ "spec"
|
|
Packit Service |
a2ae7a |
{ "user" = "%GrOup" }
|
|
Packit Service |
a2ae7a |
{ "host_group"
|
|
Packit Service |
a2ae7a |
{ "host" = "ALL" }
|
|
Packit Service |
a2ae7a |
{ "command" = "ALL"
|
|
Packit Service |
a2ae7a |
{ "runas_user" = "ALL" } }
|
|
Packit Service |
a2ae7a |
}
|
|
Packit Service |
a2ae7a |
}
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(* Test: Sudoers.spec
|
|
Packit Service |
a2ae7a |
allow + in user-/groupnames *)
|
|
Packit Service |
a2ae7a |
test Sudoers.spec get "group+user somehost = ALL\n" =
|
|
Packit Service |
a2ae7a |
{ "spec"
|
|
Packit Service |
a2ae7a |
{ "user" = "group+user" }
|
|
Packit Service |
a2ae7a |
{ "host_group"
|
|
Packit Service |
a2ae7a |
{ "host" = "somehost" }
|
|
Packit Service |
a2ae7a |
{ "command" = "ALL" }
|
|
Packit Service |
a2ae7a |
}
|
|
Packit Service |
a2ae7a |
}
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(* Test: Sudoers.spec
|
|
Packit Service |
a2ae7a |
GH #262: Sudoers lens doesn't support `!` for command aliases *)
|
|
Packit Service |
a2ae7a |
test Sudoers.spec get "%opssudoers ALL=(ALL) ALL, !!!BANNED\n" =
|
|
Packit Service |
a2ae7a |
{ "spec"
|
|
Packit Service |
a2ae7a |
{ "user" = "%opssudoers" }
|
|
Packit Service |
a2ae7a |
{ "host_group"
|
|
Packit Service |
a2ae7a |
{ "host" = "ALL" }
|
|
Packit Service |
a2ae7a |
{ "command" = "ALL"
|
|
Packit Service |
a2ae7a |
{ "runas_user" = "ALL" } }
|
|
Packit Service |
a2ae7a |
{ "command" = "BANNED"
|
|
Packit Service |
a2ae7a |
{ "negate" } }
|
|
Packit Service |
a2ae7a |
}
|
|
Packit Service |
a2ae7a |
}
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(* Test: Sudoers.spec
|
|
Packit Service |
a2ae7a |
Handle multiple `!` properly in commands *)
|
|
Packit Service |
a2ae7a |
test Sudoers.spec get "%opssudoers ALL=(ALL) ALL, !!!/bin/mount\n" =
|
|
Packit Service |
a2ae7a |
{ "spec"
|
|
Packit Service |
a2ae7a |
{ "user" = "%opssudoers" }
|
|
Packit Service |
a2ae7a |
{ "host_group"
|
|
Packit Service |
a2ae7a |
{ "host" = "ALL" }
|
|
Packit Service |
a2ae7a |
{ "command" = "ALL"
|
|
Packit Service |
a2ae7a |
{ "runas_user" = "ALL" } }
|
|
Packit Service |
a2ae7a |
{ "command" = "/bin/mount"
|
|
Packit Service |
a2ae7a |
{ "negate" } }
|
|
Packit Service |
a2ae7a |
}
|
|
Packit Service |
a2ae7a |
}
|