diff options
Diffstat (limited to 'monitor.c')
-rw-r--r-- | monitor.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -111,6 +111,7 @@ int mm_answer_sign(int, Buffer *); | |||
111 | int mm_answer_pwnamallow(int, Buffer *); | 111 | int mm_answer_pwnamallow(int, Buffer *); |
112 | int mm_answer_auth2_read_banner(int, Buffer *); | 112 | int mm_answer_auth2_read_banner(int, Buffer *); |
113 | int mm_answer_authserv(int, Buffer *); | 113 | int mm_answer_authserv(int, Buffer *); |
114 | int mm_answer_authrole(int, Buffer *); | ||
114 | int mm_answer_authpassword(int, Buffer *); | 115 | int mm_answer_authpassword(int, Buffer *); |
115 | int mm_answer_bsdauthquery(int, Buffer *); | 116 | int mm_answer_bsdauthquery(int, Buffer *); |
116 | int mm_answer_bsdauthrespond(int, Buffer *); | 117 | int mm_answer_bsdauthrespond(int, Buffer *); |
@@ -182,6 +183,7 @@ struct mon_table mon_dispatch_proto20[] = { | |||
182 | {MONITOR_REQ_SIGN, MON_ONCE, mm_answer_sign}, | 183 | {MONITOR_REQ_SIGN, MON_ONCE, mm_answer_sign}, |
183 | {MONITOR_REQ_PWNAM, MON_ONCE, mm_answer_pwnamallow}, | 184 | {MONITOR_REQ_PWNAM, MON_ONCE, mm_answer_pwnamallow}, |
184 | {MONITOR_REQ_AUTHSERV, MON_ONCE, mm_answer_authserv}, | 185 | {MONITOR_REQ_AUTHSERV, MON_ONCE, mm_answer_authserv}, |
186 | {MONITOR_REQ_AUTHROLE, MON_ONCE, mm_answer_authrole}, | ||
185 | {MONITOR_REQ_AUTH2_READ_BANNER, MON_ONCE, mm_answer_auth2_read_banner}, | 187 | {MONITOR_REQ_AUTH2_READ_BANNER, MON_ONCE, mm_answer_auth2_read_banner}, |
186 | {MONITOR_REQ_AUTHPASSWORD, MON_AUTH, mm_answer_authpassword}, | 188 | {MONITOR_REQ_AUTHPASSWORD, MON_AUTH, mm_answer_authpassword}, |
187 | #ifdef USE_PAM | 189 | #ifdef USE_PAM |
@@ -638,6 +640,7 @@ mm_answer_pwnamallow(int sock, Buffer *m) | |||
638 | else { | 640 | else { |
639 | /* Allow service/style information on the auth context */ | 641 | /* Allow service/style information on the auth context */ |
640 | monitor_permit(mon_dispatch, MONITOR_REQ_AUTHSERV, 1); | 642 | monitor_permit(mon_dispatch, MONITOR_REQ_AUTHSERV, 1); |
643 | monitor_permit(mon_dispatch, MONITOR_REQ_AUTHROLE, 1); | ||
641 | monitor_permit(mon_dispatch, MONITOR_REQ_AUTH2_READ_BANNER, 1); | 644 | monitor_permit(mon_dispatch, MONITOR_REQ_AUTH2_READ_BANNER, 1); |
642 | } | 645 | } |
643 | 646 | ||
@@ -692,6 +695,23 @@ mm_answer_authserv(int sock, Buffer *m) | |||
692 | } | 695 | } |
693 | 696 | ||
694 | int | 697 | int |
698 | mm_answer_authrole(int sock, Buffer *m) | ||
699 | { | ||
700 | monitor_permit_authentications(1); | ||
701 | |||
702 | authctxt->role = buffer_get_string(m, NULL); | ||
703 | debug3("%s: role=%s", | ||
704 | __func__, authctxt->role); | ||
705 | |||
706 | if (strlen(authctxt->role) == 0) { | ||
707 | xfree(authctxt->role); | ||
708 | authctxt->role = NULL; | ||
709 | } | ||
710 | |||
711 | return (0); | ||
712 | } | ||
713 | |||
714 | int | ||
695 | mm_answer_authpassword(int sock, Buffer *m) | 715 | mm_answer_authpassword(int sock, Buffer *m) |
696 | { | 716 | { |
697 | static int call_count; | 717 | static int call_count; |