diff svr-authpubkey.c @ 1633:592a18dac250

Support servers without multiple user support (#76)
author Patrick Stewart <patstew@gmail.com>
date Wed, 20 Mar 2019 14:44:49 +0000
parents 9579377b5f8b
children 76189c9ffea2
line wrap: on
line diff
--- a/svr-authpubkey.c	Wed Mar 20 17:33:15 2019 +0300
+++ b/svr-authpubkey.c	Wed Mar 20 14:44:49 2019 +0000
@@ -347,6 +347,7 @@
 	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 @@
 		(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;