Mercurial > dropbear
comparison svr-agentfwd.c @ 5:bc6477a6c393
syntactical fixups - it compiles, but channel handling code requires fixing.
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Tue, 01 Jun 2004 04:20:12 +0000 |
parents | fe6bca95afa7 |
children | f76c9389e9e0 |
comparison
equal
deleted
inserted
replaced
4:fe6bca95afa7 | 5:bc6477a6c393 |
---|---|
139 | 139 |
140 /* Remove the dir as the user. That way they can't cause problems except | 140 /* Remove the dir as the user. That way they can't cause problems except |
141 * for themselves */ | 141 * for themselves */ |
142 uid = getuid(); | 142 uid = getuid(); |
143 gid = getgid(); | 143 gid = getgid(); |
144 if ((setegid(ses.authstate.pw->pw_gid)) < 0 || | 144 if ((setegid(svr_ses.authstate.pw->pw_gid)) < 0 || |
145 (seteuid(ses.authstate.pw->pw_uid)) < 0) { | 145 (seteuid(svr_ses.authstate.pw->pw_uid)) < 0) { |
146 dropbear_exit("failed to set euid"); | 146 dropbear_exit("failed to set euid"); |
147 } | 147 } |
148 | 148 |
149 /* 2 for "/" and "\0" */ | 149 /* 2 for "/" and "\0" */ |
150 len = strlen(chansess->agentdir) + strlen(chansess->agentfile) + 2; | 150 len = strlen(chansess->agentdir) + strlen(chansess->agentfile) + 2; |
192 int ret = DROPBEAR_FAILURE; | 192 int ret = DROPBEAR_FAILURE; |
193 | 193 |
194 /* drop to user privs to make the dir/file */ | 194 /* drop to user privs to make the dir/file */ |
195 uid = getuid(); | 195 uid = getuid(); |
196 gid = getgid(); | 196 gid = getgid(); |
197 if ((setegid(ses.authstate.pw->pw_gid)) < 0 || | 197 if ((setegid(svr_ses.authstate.pw->pw_gid)) < 0 || |
198 (seteuid(ses.authstate.pw->pw_uid)) < 0) { | 198 (seteuid(svr_ses.authstate.pw->pw_uid)) < 0) { |
199 dropbear_exit("failed to set euid"); | 199 dropbear_exit("failed to set euid"); |
200 } | 200 } |
201 | 201 |
202 memset((void*)&addr, 0x0, sizeof(addr)); | 202 memset((void*)&addr, 0x0, sizeof(addr)); |
203 addr.sun_family = AF_UNIX; | 203 addr.sun_family = AF_UNIX; |