From 8bf279b11e5ed0304ae3542bc3ec049b43dda37a Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 20 Sep 2018 15:10:15 -0600 Subject: [PATCH] Add regress test for bug #853 --- MANIFEST | 2 ++ .../sudoers/regress/cvtsudoers/test30.out.ok | 26 +++++++++++++++++++ plugins/sudoers/regress/cvtsudoers/test30.sh | 14 ++++++++++ 3 files changed, 42 insertions(+) create mode 100644 plugins/sudoers/regress/cvtsudoers/test30.out.ok create mode 100755 plugins/sudoers/regress/cvtsudoers/test30.sh diff --git a/MANIFEST b/MANIFEST index cd6f510cc..82070142a 100644 --- a/MANIFEST +++ b/MANIFEST @@ -452,6 +452,8 @@ 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.sh +plugins/sudoers/regress/cvtsudoers/test30.out.ok +plugins/sudoers/regress/cvtsudoers/test30.sh plugins/sudoers/regress/cvtsudoers/test4.out.ok plugins/sudoers/regress/cvtsudoers/test4.sh plugins/sudoers/regress/cvtsudoers/test5.out.ok diff --git a/plugins/sudoers/regress/cvtsudoers/test30.out.ok b/plugins/sudoers/regress/cvtsudoers/test30.out.ok new file mode 100644 index 000000000..009a54e85 --- /dev/null +++ b/plugins/sudoers/regress/cvtsudoers/test30.out.ok @@ -0,0 +1,26 @@ +{ + "User_Specs": [ + { + "User_List": [ + { "username": "user1" }, + { "username": "user2" }, + { "username": "user3" } + ], + "Host_List": [ + { "hostname": "ALL" } + ], + "Cmnd_Specs": [ + { + "Commands": [ + { "command": "/path/to/cmda" }, + { + "command": "/path/to/cmdb", + "negated": true + }, + { "command": "/path/to/cmdc" } + ] + } + ] + } + ] +} diff --git a/plugins/sudoers/regress/cvtsudoers/test30.sh b/plugins/sudoers/regress/cvtsudoers/test30.sh new file mode 100755 index 000000000..80b08a574 --- /dev/null +++ b/plugins/sudoers/regress/cvtsudoers/test30.sh @@ -0,0 +1,14 @@ +#!/bin/sh +# +# Test alias expasion when converting to JSON. +# See https://bugzilla.sudo.ws/show_bug.cgi?id=853 +# + +exec 2>&1 +./cvtsudoers -c "" -e -f json <