Pass back the number of files to edit when using sudoedit.

The sudo front-end can use this to determine where the list of files
to edit begins.
This commit is contained in:
Todd C. Miller
2023-01-18 13:38:15 -07:00
parent 334daf92b3
commit 0865e61d9e
9 changed files with 139 additions and 38 deletions

View File

@@ -806,8 +806,9 @@ sudoers_policy_main(int argc, char * const argv[], int pwflag, char *env_add[],
char **edit_argv;
int edit_argc;
sudoedit_nfiles = NewArgc - 1;
free(safe_cmnd);
safe_cmnd = find_editor(NewArgc - 1, NewArgv + 1, &edit_argc,
safe_cmnd = find_editor(sudoedit_nfiles, NewArgv + 1, &edit_argc,
&edit_argv, NULL, &env_editor);
if (safe_cmnd == NULL) {
switch (errno) {