|
Bugzilla – Full Text Bug Listing |
| Summary: | malformed json created by cvtsudoers when using -e | ||
|---|---|---|---|
| Product: | Sudo | Reporter: | Jim Westfall <jwestfall> |
| Component: | Sudoers | Assignee: | Todd C. Miller <Todd.Miller> |
| Status: | RESOLVED FIXED | ||
| Severity: | low | CC: | mario.garcia.ortiz |
| Priority: | low | ||
| Version: | 1.8.25 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Attachments: | Patch to fix errant commas in JSON output when expanding aliases | ||
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. |
$ 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