summaryrefslogtreecommitdiffhomepage
path: root/svr-auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'svr-auth.c')
-rw-r--r--svr-auth.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/svr-auth.c b/svr-auth.c
index c9a75c0..64d97aa 100644
--- a/svr-auth.c
+++ b/svr-auth.c
@@ -197,6 +197,7 @@ out:
m_free(methodname);
}
+#ifdef HAVE_GETGROUPLIST
/* returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE */
static int check_group_membership(gid_t check_gid, const char* username, gid_t user_gid) {
int ngroups, i, ret;
@@ -230,7 +231,7 @@ static int check_group_membership(gid_t check_gid, const char* username, gid_t u
return match;
}
-
+#endif
/* Check that the username exists and isn't disallowed (root), and has a valid shell.
* returns DROPBEAR_SUCCESS on valid username, DROPBEAR_FAILURE on failure */
@@ -300,6 +301,7 @@ static int checkusername(const char *username, unsigned int userlen) {
}
/* check for login restricted to certain group if desired */
+#ifdef HAVE_GETGROUPLIST
if (svr_opts.restrict_group) {
if (check_group_membership(svr_opts.restrict_group_gid,
ses.authstate.pw_name, ses.authstate.pw_gid) == DROPBEAR_FAILURE) {
@@ -310,6 +312,7 @@ static int checkusername(const char *username, unsigned int userlen) {
return DROPBEAR_FAILURE;
}
}
+#endif HAVE_GETGROUPLIST
TRACE(("shell is %s", ses.authstate.pw_shell))