summaryrefslogtreecommitdiffhomepage
path: root/svr-agentfwd.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2008-01-13 03:55:59 +0000
committerMatt Johnston <matt@ucc.asn.au>2008-01-13 03:55:59 +0000
commitbb0548b3b00ca1b0b06e4d0ccf6cb794337eb192 (patch)
tree9692d7d32f6e274634af9345f79c1d436b38aed8 /svr-agentfwd.c
parent25554bc331cc684c3521b3c3ed4c0659c454d5df (diff)
Make a copy of passwd fields since getpwnam()'s retval isn't safe to keep
--HG-- extra : convert_revision : 295b11312e327fe6c4f33512674ea4a1a9790344
Diffstat (limited to 'svr-agentfwd.c')
-rw-r--r--svr-agentfwd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/svr-agentfwd.c b/svr-agentfwd.c
index 5127158..6946d1d 100644
--- a/svr-agentfwd.c
+++ b/svr-agentfwd.c
@@ -150,8 +150,8 @@ void agentcleanup(struct ChanSess * chansess) {
* for themselves */
uid = getuid();
gid = getgid();
- if ((setegid(ses.authstate.pw->pw_gid)) < 0 ||
- (seteuid(ses.authstate.pw->pw_uid)) < 0) {
+ if ((setegid(ses.authstate.pw_gid)) < 0 ||
+ (seteuid(ses.authstate.pw_uid)) < 0) {
dropbear_exit("failed to set euid");
}
@@ -213,8 +213,8 @@ static int bindagent(int fd, struct ChanSess * chansess) {
/* drop to user privs to make the dir/file */
uid = getuid();
gid = getgid();
- if ((setegid(ses.authstate.pw->pw_gid)) < 0 ||
- (seteuid(ses.authstate.pw->pw_uid)) < 0) {
+ if ((setegid(ses.authstate.pw_gid)) < 0 ||
+ (seteuid(ses.authstate.pw_uid)) < 0) {
dropbear_exit("failed to set euid");
}