Skip to content

cvtsudoers outputs invalid JSON #369

@es-fabricemarie

Description

@es-fabricemarie

Using the following sudoers file in /etc/sudoers.d/test3:

user0   ALL = CHROOT=/var/www CWD=/htdocs /bin/ksh

Using the command:

cvtsudoers --defaults=all --output-format=JSON --input-format=SUDOERS --output=- /etc/sudoers.d/test3

We get the following invalid JSON output:

{
    "User_Specs": [
        {
            "User_List": [
                { "username": "user0" }
            ],
            "Host_List": [
                { "hostname": "ALL" }
            ],
            "Cmnd_Specs": [
                {
                    "Options": [
                        "runchroot": "/var/www",
                        "runcwd": "/htdocs"
                    ],
                    "Commands": [
                        { "command": "/bin/ksh" }
                    ]
                }
            ]
        }
    ]
}

The invalid part is here:

"Options": [
    "runchroot": "/var/www",
    "runcwd": "/htdocs"
],

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions