Make user_details extern so tgetpass can get at the uid and gid.

Set uid/gid to user before executing askpass program.
Check environment for SUDO_ASKPASS and use that if set.
TODO: a way for the policy to set the askpass program itself
This commit is contained in:
Todd C. Miller
2010-02-24 19:53:45 -05:00
parent f3b2c9ac1d
commit 9e5ff964ad
2 changed files with 37 additions and 27 deletions

View File

@@ -103,6 +103,9 @@ extern const char *list_user, *runas_user, *runas_group;
int Argc;
char **Argv;
/* Needed by tgetpass when executing askpass helper */
struct user_details user_details;
#if defined(RLIMIT_CORE) && !defined(SUDO_DEVEL)
static struct rlimit corelimit;
#endif /* RLIMIT_CORE && !SUDO_DEVEL */
@@ -116,7 +119,6 @@ main(int argc, char *argv[], char *envp[])
char **nargv, **settings, **env_add;
char **user_info, **command_info, **argv_out, **user_env_out;
struct plugin_container *plugin;
struct user_details user_details;
struct command_details command_details;
int ok;
#if defined(SUDO_DEVEL) && defined(__OpenBSD__)