summaryrefslogtreecommitdiffstats
path: root/sesman/scp_v0.c
diff options
context:
space:
mode:
authornorrarvid <norrarvid@gmail.com>2012-05-31 16:57:17 +0200
committernorrarvid <norrarvid@gmail.com>2012-05-31 16:57:17 +0200
commit10fdc5c17f7aec2df8885d2cf7354f6681af76f6 (patch)
treeb6f06d3c08430ebee080c36a5d9f1744a87ee575 /sesman/scp_v0.c
parent60b052965634be151d88f7011149d0edc71f23d8 (diff)
downloadxrdp-proprietary-10fdc5c17f7aec2df8885d2cf7354f6681af76f6.tar.gz
xrdp-proprietary-10fdc5c17f7aec2df8885d2cf7354f6681af76f6.zip
separate pam authentication for gateways
Diffstat (limited to 'sesman/scp_v0.c')
-rw-r--r--sesman/scp_v0.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/sesman/scp_v0.c b/sesman/scp_v0.c
index 0b4dc791..71b1ffad 100644
--- a/sesman/scp_v0.c
+++ b/sesman/scp_v0.c
@@ -38,9 +38,28 @@ scp_v0_process(struct SCP_CONNECTION* c, struct SCP_SESSION* s)
struct session_item* s_item;
data = auth_userpass(s->username, s->password);
-
- if (data)
+ if(s->type==SCP_GW_AUTHENTICATION)
{
+ /* this is just authentication in a gateway situation */
+ /* g_writeln("SCP_GW_AUTHENTICATION message received"); */
+ if(data){
+ if (1 == access_login_allowed(s->username))
+ {
+ /* the user is member of the correct groups. */
+ scp_v0s_replyauthentication(c,0);
+ /* g_writeln("Connection allowed"); */
+ }else{
+ scp_v0s_replyauthentication(c,3);
+ /* g_writeln("user password ok, but group problem"); */
+ }
+ }else{
+ /* g_writeln("username or password error"); */
+ scp_v0s_replyauthentication(c,2);
+ }
+ auth_end(data);
+ }
+ else if (data)
+ {
s_item = session_get_bydata(s->username, s->width, s->height, s->bpp, s->type);
if (s_item != 0)
{