projects
/
openssh.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Import debian 5.9p1-1
[openssh.git]
/
auth1.c
diff --git
a/auth1.c
b/auth1.c
index
cc85aec
..
9079b73
100644
(file)
--- a/
auth1.c
+++ b/
auth1.c
@@
-383,7
+383,7
@@
void
do_authentication(Authctxt *authctxt)
{
u_int ulen;
do_authentication(Authctxt *authctxt)
{
u_int ulen;
- char *user, *style = NULL;
+ char *user, *style = NULL
, *role = NULL
;
/* Get the name of the user that we wish to log in as. */
packet_read_expect(SSH_CMSG_USER);
/* Get the name of the user that we wish to log in as. */
packet_read_expect(SSH_CMSG_USER);
@@
-392,11
+392,17
@@
do_authentication(Authctxt *authctxt)
user = packet_get_cstring(&ulen);
packet_check_eom();
user = packet_get_cstring(&ulen);
packet_check_eom();
+ if ((role = strchr(user, '/')) != NULL)
+ *role++ = '\0';
+
if ((style = strchr(user, ':')) != NULL)
*style++ = '\0';
if ((style = strchr(user, ':')) != NULL)
*style++ = '\0';
+ else if (role && (style = strchr(role, ':')) != NULL)
+ *style++ = '\0';
authctxt->user = user;
authctxt->style = style;
authctxt->user = user;
authctxt->style = style;
+ authctxt->role = role;
/* Verify that the user is a valid user. */
if ((authctxt->pw = PRIVSEP(getpwnamallow(user))) != NULL)
/* Verify that the user is a valid user. */
if ((authctxt->pw = PRIVSEP(getpwnamallow(user))) != NULL)