summaryrefslogtreecommitdiff
path: root/usr.bin/sudo/env.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-04-25 15:49:04 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-04-25 15:49:04 +0000
commit0177f1e0d7b791817d4c6fb1b8ffe7688d7b2cc0 (patch)
tree7598f930b890058cc6e75258a56f434e6bcbe74a /usr.bin/sudo/env.c
parent14b8b5d2aa7b438deeec468009118f4478d90116 (diff)
Update to sudo 1.6.6
Diffstat (limited to 'usr.bin/sudo/env.c')
-rw-r--r--usr.bin/sudo/env.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/usr.bin/sudo/env.c b/usr.bin/sudo/env.c
index 7bf3a0f3812..f49e51e37d5 100644
--- a/usr.bin/sudo/env.c
+++ b/usr.bin/sudo/env.c
@@ -62,7 +62,7 @@
#include "sudo.h"
#ifndef lint
-static const char rcsid[] = "$Sudo: env.c,v 1.15 2002/01/15 23:43:58 millert Exp $";
+static const char rcsid[] = "$Sudo: env.c,v 1.16 2002/04/18 15:38:52 millert Exp $";
#endif /* lint */
/*
@@ -434,19 +434,16 @@ rebuild_env(sudo_mode, envp)
/* Add the SUDO_COMMAND envariable (cmnd + args). */
if (user_args) {
- cp = emalloc(strlen(user_cmnd) + strlen(user_args) + 15);
- sprintf(cp, "SUDO_COMMAND=%s %s", user_cmnd, user_args);
+ easprintf(&cp, "SUDO_COMMAND=%s %s", user_cmnd, user_args);
insert_env(newenvp, cp);
} else
insert_env(newenvp, format_env("SUDO_COMMAND", user_cmnd));
/* Add the SUDO_USER, SUDO_UID, SUDO_GID environment variables. */
insert_env(newenvp, format_env("SUDO_USER", user_name));
- cp = emalloc(MAX_UID_T_LEN + 10);
- sprintf(cp, "SUDO_UID=%ld", (long) user_uid);
+ easprintf(&cp, "SUDO_UID=%ld", (long) user_uid);
insert_env(newenvp, cp);
- cp = emalloc(MAX_UID_T_LEN + 10);
- sprintf(cp, "SUDO_GID=%ld", (long) user_gid);
+ easprintf(&cp, "SUDO_GID=%ld", (long) user_gid);
insert_env(newenvp, cp);
return(newenvp);