Bugzilla – Bug 853
malformed json created by cvtsudoers when using -e
Last modified: 2020-04-02 11:30:33 MDT
$ cvtsudoers -V cvtsudoers version 1.8.25p1 cvtsudoers grammar version 46 $ cat sudoer-bad-json Cmnd_Alias CMDA=/path/to/cmda Cmnd_Alias CMDB=/path/to/cmdb %user ALL=CMDA,CMDB $ cvtsudoers -e -f json sudoer-bad-json { "User_Specs": [ { "User_List": [ { "usergroup": "user" } ], "Host_List": [ { "hostname": "ALL" } ], "Cmnd_Specs": [ { "Commands": [ { "command": "/path/to/cmda" }, , { "command": "/path/to/cmdb" } ] } ] } ] } note the rogue common at the beginning of the 2nd command line
Created attachment 516 [details] Patch to fix errant commas in JSON output when expanding aliases The following patch should fix the problem. I'm still testing to make sure there are no other side-effects.
patch fixes the issue and doesn't cause any other json formatting issues on our sudoers file.
Fixed in sudo 1.8.26.
*** Bug 920 has been marked as a duplicate of this bug. ***