From bb0548b3b00ca1b0b06e4d0ccf6cb794337eb192 Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Sun, 13 Jan 2008 03:55:59 +0000 Subject: Make a copy of passwd fields since getpwnam()'s retval isn't safe to keep --HG-- extra : convert_revision : 295b11312e327fe6c4f33512674ea4a1a9790344 --- svr-agentfwd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'svr-agentfwd.c') 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"); } -- cgit v1.2.3