summaryrefslogtreecommitdiff
path: root/auth1.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2005-06-17 12:44:30 +0000
committerColin Watson <cjwatson@debian.org>2005-06-17 12:44:30 +0000
commit4c2d1c67cea075107aadaa6d81fe456687c69e67 (patch)
tree4f31813c8306491c908948bd75254912385ed651 /auth1.c
parentbed4bb0fe9380912ecb90e5f918bce8825ec0a38 (diff)
Manoj Srivastava:
- Added SELinux capability, and turned it on be default. Added restorecon calls in preinst and postinst (should not matter if the machine is not SELinux aware). By and large, the changes made should have no effect unless the rules file calls --with-selinux; and even then there should be no performance hit for machines not actively running SELinux. - Modified the preinst and postinst to call restorecon to set the security context for the generated public key files. - Added a comment to /etc/pam.d/ssh to indicate that an SELinux system may want to also include pam_selinux.so.
Diffstat (limited to 'auth1.c')
-rw-r--r--auth1.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/auth1.c b/auth1.c
index d08928455..4fe00ddae 100644
--- a/auth1.c
+++ b/auth1.c
@@ -308,7 +308,7 @@ void
308do_authentication(Authctxt *authctxt) 308do_authentication(Authctxt *authctxt)
309{ 309{
310 u_int ulen; 310 u_int ulen;
311 char *user, *style = NULL; 311 char *user, *style = NULL, *role = NULL;
312 312
313 /* Get the name of the user that we wish to log in as. */ 313 /* Get the name of the user that we wish to log in as. */
314 packet_read_expect(SSH_CMSG_USER); 314 packet_read_expect(SSH_CMSG_USER);
@@ -317,11 +317,17 @@ do_authentication(Authctxt *authctxt)
317 user = packet_get_string(&ulen); 317 user = packet_get_string(&ulen);
318 packet_check_eom(); 318 packet_check_eom();
319 319
320 if ((role = strchr(user, '/')) != NULL)
321 *role++ = '\0';
322
320 if ((style = strchr(user, ':')) != NULL) 323 if ((style = strchr(user, ':')) != NULL)
321 *style++ = '\0'; 324 *style++ = '\0';
325 else if (role && (style = strchr(role, ':')) != NULL)
326 *style++ = '\0';
322 327
323 authctxt->user = user; 328 authctxt->user = user;
324 authctxt->style = style; 329 authctxt->style = style;
330 authctxt->role = role;
325 331
326 /* Verify that the user is a valid user. */ 332 /* Verify that the user is a valid user. */
327 if ((authctxt->pw = PRIVSEP(getpwnamallow(user))) != NULL) 333 if ((authctxt->pw = PRIVSEP(getpwnamallow(user))) != NULL)