sudo-project / sudo

Utility to execute a command as another user
https://www.sudo.ws
Other
1.19k stars 220 forks source link

check_syntax(): It may not be necessary to call init_defaults() again #213

Closed BornThisWay closed 1 year ago

BornThisWay commented 1 year ago

https://github.com/sudo-project/sudo/blob/46d286947ec996e153b4ac39ce4d7f1edb9ca706/plugins/sudoers/visudo.c#L974

It's already called at the upper level, and I think this call is redundant.

    /* Setup defaults data structures. */
    if (!init_defaults())
    sudo_fatalx("%s", U_("unable to initialize sudoers default values"));

    if (checkonly) {
    exitcode = check_syntax(sudoers_file, quiet, strict, use_owner,
        use_perms) ? 0 : 1;
    goto done;
    }
millert commented 1 year ago

Merged 9a36698