Return settings from parse_args as struct sudo_settings and format

for the plugin at plugin open time.  This will allow for additional,
plugin-specific settings to be added to the array.
This commit is contained in:
Todd C. Miller
2014-10-22 13:13:00 -06:00
parent f71d4abd7b
commit 1e0b8903f2
3 changed files with 79 additions and 42 deletions

View File

@@ -85,6 +85,12 @@
#define TGP_MASK 0x08 /* mask user input when reading */
#define TGP_NOECHO_TRY 0x10 /* turn off echo if possible */
/* name/value pairs for command line settings. */
struct sudo_settings {
const char *name;
const char *value;
};
struct user_details {
pid_t pid;
pid_t ppid;
@@ -186,7 +192,7 @@ int sudo_execute(struct command_details *details, struct command_status *cstat);
/* parse_args.c */
int parse_args(int argc, char **argv, int *nargc, char ***nargv,
char ***settingsp, char ***env_addp);
struct sudo_settings **settingsp, char ***env_addp);
extern int tgetpass_flags;
/* get_pty.c */