summaryrefslogtreecommitdiffhomepage
path: root/svr-authpubkey.c
diff options
context:
space:
mode:
Diffstat (limited to 'svr-authpubkey.c')
-rw-r--r--svr-authpubkey.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/svr-authpubkey.c b/svr-authpubkey.c
index dafa99a..4f27986 100644
--- a/svr-authpubkey.c
+++ b/svr-authpubkey.c
@@ -347,6 +347,7 @@ static int checkpubkey(const char* algo, unsigned int algolen,
snprintf(filename, len + 22, "%s/.ssh/authorized_keys",
ses.authstate.pw_dir);
+#if DROPBEAR_SVR_MULTIUSER
/* open the file as the authenticating user. */
origuid = getuid();
origgid = getgid();
@@ -354,13 +355,16 @@ static int checkpubkey(const char* algo, unsigned int algolen,
(seteuid(ses.authstate.pw_uid)) < 0) {
dropbear_exit("Failed to set euid");
}
+#endif
authfile = fopen(filename, "r");
+#if DROPBEAR_SVR_MULTIUSER
if ((seteuid(origuid)) < 0 ||
(setegid(origgid)) < 0) {
dropbear_exit("Failed to revert euid");
}
+#endif
if (authfile == NULL) {
goto out;