From 025c439e829e0db9ac511cd9c1b8d5fd53475ead Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 15:14:46 +0200 Subject: Adding upstream version 1.9.15p5. Signed-off-by: Daniel Baumann --- plugins/sudoers/regress/visudo/test1.out.ok | 1 + plugins/sudoers/regress/visudo/test1.sh | 14 +++++++++++ plugins/sudoers/regress/visudo/test10.out.ok | 1 + plugins/sudoers/regress/visudo/test10.sh | 13 ++++++++++ plugins/sudoers/regress/visudo/test2.err.ok | 1 + plugins/sudoers/regress/visudo/test2.out.ok | 0 plugins/sudoers/regress/visudo/test2.sh | 17 +++++++++++++ plugins/sudoers/regress/visudo/test3.err.ok | 2 ++ plugins/sudoers/regress/visudo/test3.out.ok | 1 + plugins/sudoers/regress/visudo/test3.sh | 37 ++++++++++++++++++++++++++++ plugins/sudoers/regress/visudo/test4.out.ok | 1 + plugins/sudoers/regress/visudo/test4.sh | 16 ++++++++++++ plugins/sudoers/regress/visudo/test5.out.ok | 1 + plugins/sudoers/regress/visudo/test5.sh | 10 ++++++++ plugins/sudoers/regress/visudo/test6.out.ok | 1 + plugins/sudoers/regress/visudo/test6.sh | 27 ++++++++++++++++++++ plugins/sudoers/regress/visudo/test7.out.ok | 1 + plugins/sudoers/regress/visudo/test7.sh | 31 +++++++++++++++++++++++ plugins/sudoers/regress/visudo/test8.err.ok | 1 + plugins/sudoers/regress/visudo/test8.out.ok | 1 + plugins/sudoers/regress/visudo/test8.sh | 32 ++++++++++++++++++++++++ plugins/sudoers/regress/visudo/test9.out.ok | 1 + plugins/sudoers/regress/visudo/test9.sh | 14 +++++++++++ 23 files changed, 224 insertions(+) create mode 100644 plugins/sudoers/regress/visudo/test1.out.ok create mode 100755 plugins/sudoers/regress/visudo/test1.sh create mode 100644 plugins/sudoers/regress/visudo/test10.out.ok create mode 100755 plugins/sudoers/regress/visudo/test10.sh create mode 100644 plugins/sudoers/regress/visudo/test2.err.ok create mode 100644 plugins/sudoers/regress/visudo/test2.out.ok create mode 100755 plugins/sudoers/regress/visudo/test2.sh create mode 100644 plugins/sudoers/regress/visudo/test3.err.ok create mode 100644 plugins/sudoers/regress/visudo/test3.out.ok create mode 100755 plugins/sudoers/regress/visudo/test3.sh create mode 100644 plugins/sudoers/regress/visudo/test4.out.ok create mode 100755 plugins/sudoers/regress/visudo/test4.sh create mode 100644 plugins/sudoers/regress/visudo/test5.out.ok create mode 100755 plugins/sudoers/regress/visudo/test5.sh create mode 100644 plugins/sudoers/regress/visudo/test6.out.ok create mode 100755 plugins/sudoers/regress/visudo/test6.sh create mode 100644 plugins/sudoers/regress/visudo/test7.out.ok create mode 100755 plugins/sudoers/regress/visudo/test7.sh create mode 100644 plugins/sudoers/regress/visudo/test8.err.ok create mode 100644 plugins/sudoers/regress/visudo/test8.out.ok create mode 100755 plugins/sudoers/regress/visudo/test8.sh create mode 100644 plugins/sudoers/regress/visudo/test9.out.ok create mode 100755 plugins/sudoers/regress/visudo/test9.sh (limited to 'plugins/sudoers/regress/visudo') diff --git a/plugins/sudoers/regress/visudo/test1.out.ok b/plugins/sudoers/regress/visudo/test1.out.ok new file mode 100644 index 0000000..e5c355c --- /dev/null +++ b/plugins/sudoers/regress/visudo/test1.out.ok @@ -0,0 +1 @@ +stdin: parsed OK diff --git a/plugins/sudoers/regress/visudo/test1.sh b/plugins/sudoers/regress/visudo/test1.sh new file mode 100755 index 0000000..5676eea --- /dev/null +++ b/plugins/sudoers/regress/visudo/test1.sh @@ -0,0 +1,14 @@ +#!/bin/sh +# +# Sudo Bug 519: +# Visudo in strict mode reports "parse error" even if there is no error +# + +: ${VISUDO=visudo} + +$VISUDO -csf - <root !set_logname +Defaults:FULLTIMERS !lecture +Defaults:millert !authenticate +Defaults@SERVERS log_year, logfile=/var/log/sudo.log +Defaults!PAGERS noexec + +Defaults env_keep -= "HOME" +Defaults env_keep = "COLORS DISPLAY HOSTNAME HISTSIZE KDEDIR LS_COLORS" +Defaults env_keep += "MAIL PS1 PS2 QTDIR LANG LC_ADDRESS LC_CTYPE" + +User_Alias FULLTIMERS = millert, mikef, dowdy + +Cmnd_Alias PAGERS = /usr/bin/more, /usr/bin/pg, /usr/bin/less + +Host_Alias SERVERS = primary, mail, www, ns +EOF + +exit 0 diff --git a/plugins/sudoers/regress/visudo/test7.out.ok b/plugins/sudoers/regress/visudo/test7.out.ok new file mode 100644 index 0000000..e5c355c --- /dev/null +++ b/plugins/sudoers/regress/visudo/test7.out.ok @@ -0,0 +1 @@ +stdin: parsed OK diff --git a/plugins/sudoers/regress/visudo/test7.sh b/plugins/sudoers/regress/visudo/test7.sh new file mode 100755 index 0000000..b993fe7 --- /dev/null +++ b/plugins/sudoers/regress/visudo/test7.sh @@ -0,0 +1,31 @@ +#!/bin/sh +# +# Test sudoers_locale early Defaults +# + +: ${VISUDO=visudo} + +LANG=C; export LANG +LC_NUMERIC=fr_FR.UTF-8; export LC_NUMERIC + +# First check that visudo supports non-C locales +# Note that older versions of sudo did not set the locale +# until sudoers was read so this check will fail on them. +$VISUDO -csf - >/dev/null 2>&1 <<-EOF + Defaults sudoers_locale = fr_FR.UTF-8 + Defaults passwd_timeout = "2,5" + EOF + +# Now make sure we can set passwd_timeout to a floating point value +# using a non-C locale. +if [ $? -eq 0 ]; then + $VISUDO -csf - <<-EOF + Defaults passwd_timeout = "2,5" + Defaults sudoers_locale = fr_FR.UTF-8 + EOF +else + # No support for LC_NUMERIC? + echo "stdin: parsed OK" +fi + +exit 0 diff --git a/plugins/sudoers/regress/visudo/test8.err.ok b/plugins/sudoers/regress/visudo/test8.err.ok new file mode 100644 index 0000000..3e71f62 --- /dev/null +++ b/plugins/sudoers/regress/visudo/test8.err.ok @@ -0,0 +1 @@ +visudo: stdin:1: value "2.5" is invalid for option "passwd_timeout" diff --git a/plugins/sudoers/regress/visudo/test8.out.ok b/plugins/sudoers/regress/visudo/test8.out.ok new file mode 100644 index 0000000..16ebc45 --- /dev/null +++ b/plugins/sudoers/regress/visudo/test8.out.ok @@ -0,0 +1 @@ +parse error in stdin near line 1 diff --git a/plugins/sudoers/regress/visudo/test8.sh b/plugins/sudoers/regress/visudo/test8.sh new file mode 100755 index 0000000..85bdd9f --- /dev/null +++ b/plugins/sudoers/regress/visudo/test8.sh @@ -0,0 +1,32 @@ +#!/bin/sh +# +# Test sudoers_locale early Defaults +# + +: ${VISUDO=visudo} + +LANG=C; export LANG +LC_NUMERIC=fr_FR.UTF-8; export LC_NUMERIC + +# First check that visudo supports non-C locales +# Note that older versions of sudo did not set the locale +# until sudoers was read so this check will fail on them. +$VISUDO -csf - >/dev/null 2>&1 <<-EOF + Defaults sudoers_locale = fr_FR.UTF-8 + Defaults passwd_timeout = "2,5" + EOF + +# Now make sure we can set passwd_timeout to a floating point value +# using a non-C locale. +if [ $? -eq 0 ]; then + $VISUDO -csf - <<-EOF + Defaults passwd_timeout = "2.5" + Defaults sudoers_locale = fr_FR.UTF-8 + EOF +else + # No support for LC_NUMERIC? + echo "parse error in stdin near line 1" + echo 'visudo: stdin:1: value "2.5" is invalid for option "passwd_timeout"' 1>&2 +fi + +exit 0 diff --git a/plugins/sudoers/regress/visudo/test9.out.ok b/plugins/sudoers/regress/visudo/test9.out.ok new file mode 100644 index 0000000..e5c355c --- /dev/null +++ b/plugins/sudoers/regress/visudo/test9.out.ok @@ -0,0 +1 @@ +stdin: parsed OK diff --git a/plugins/sudoers/regress/visudo/test9.sh b/plugins/sudoers/regress/visudo/test9.sh new file mode 100755 index 0000000..175ad6e --- /dev/null +++ b/plugins/sudoers/regress/visudo/test9.sh @@ -0,0 +1,14 @@ +#!/bin/sh +# +# Test IP and network address in host-based Defaults statements +# Bugzilla #766 +# + +: ${VISUDO=visudo} + +$VISUDO -cf - <<-EOF + Defaults@127.0.0.1 !authenticate + Defaults@10.0.0.0/8 !always_set_home + EOF + +exit 0 -- cgit v1.2.3