src/server/daemon/acl.c

changeset 141
ff311b63c3af
parent 109
8a0a7754f123
child 202
c374d11d6720
--- a/src/server/daemon/acl.c	Thu Dec 29 10:15:43 2016 +0100
+++ b/src/server/daemon/acl.c	Fri Dec 30 14:15:52 2016 +0100
@@ -32,10 +32,13 @@
 
 #include "../util/util.h"
 #include "../util/pool.h"
+#include "../util/pblock.h"
 #include "../safs/auth.h"
 #include "log.h"
 #include "acl.h"
 
+#define AUTH_TYPE_BASIC "basic"
+
 void acllist_createhandle(Session *sn, Request *rq) {
     ACLListHandle *handle = pool_malloc(sn->pool, sizeof(ACLListHandle));
     handle->defaultauthdb = NULL;
@@ -114,6 +117,16 @@
                 return NULL;
             }
             // ok - user is authenticated
+            pblock_kvinsert(
+                    pb_key_auth_user,
+                    user->name,
+                    strlen(user->name),
+                    rq->vars);
+            pblock_kvinsert(
+                    pb_key_auth_type,
+                    AUTH_TYPE_BASIC,
+                    sizeof(AUTH_TYPE_BASIC)-1,
+                    rq->vars);
         }
     }
     

mercurial