diff options
Diffstat (limited to 'src/authorization/anastasis_authorization_plugin.c')
-rw-r--r-- | src/authorization/anastasis_authorization_plugin.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/authorization/anastasis_authorization_plugin.c b/src/authorization/anastasis_authorization_plugin.c index da28f40..6683ff3 100644 --- a/src/authorization/anastasis_authorization_plugin.c +++ b/src/authorization/anastasis_authorization_plugin.c | |||
@@ -20,7 +20,7 @@ | |||
20 | * @author Dominik Meister | 20 | * @author Dominik Meister |
21 | */ | 21 | */ |
22 | #include "platform.h" | 22 | #include "platform.h" |
23 | #include "anastasis_authorization_plugin.h" | 23 | #include "anastasis_authorization_lib.h" |
24 | #include <ltdl.h> | 24 | #include <ltdl.h> |
25 | 25 | ||
26 | 26 | ||
@@ -66,12 +66,18 @@ struct AuthPlugin | |||
66 | */ | 66 | */ |
67 | char *lib_name; | 67 | char *lib_name; |
68 | 68 | ||
69 | /** | ||
70 | * Authorization context passed to the plugin. | ||
71 | */ | ||
72 | struct ANASTASIS_AuthorizationContext ac; | ||
73 | |||
69 | }; | 74 | }; |
70 | 75 | ||
71 | 76 | ||
72 | struct ANASTASIS_AuthorizationPlugin * | 77 | struct ANASTASIS_AuthorizationPlugin * |
73 | ANASTASIS_authorization_plugin_load ( | 78 | ANASTASIS_authorization_plugin_load ( |
74 | const char *method, | 79 | const char *method, |
80 | struct ANASTASIS_DatabasePlugin *db, | ||
75 | const struct GNUNET_CONFIGURATION_Handle *AH_cfg) | 81 | const struct GNUNET_CONFIGURATION_Handle *AH_cfg) |
76 | { | 82 | { |
77 | struct ANASTASIS_AuthorizationPlugin *authorization; | 83 | struct ANASTASIS_AuthorizationPlugin *authorization; |
@@ -90,6 +96,8 @@ ANASTASIS_authorization_plugin_load ( | |||
90 | ¤cy)) | 96 | ¤cy)) |
91 | return NULL; | 97 | return NULL; |
92 | ap = GNUNET_new (struct AuthPlugin); | 98 | ap = GNUNET_new (struct AuthPlugin); |
99 | ap->ac.db = db; | ||
100 | ap->ac.cfg = AH_cfg; | ||
93 | GNUNET_asprintf (&sec_name, | 101 | GNUNET_asprintf (&sec_name, |
94 | "authorization-%s", | 102 | "authorization-%s", |
95 | method); | 103 | method); |
@@ -127,7 +135,7 @@ ANASTASIS_authorization_plugin_load ( | |||
127 | "libanastasis_plugin_authorization_%s", | 135 | "libanastasis_plugin_authorization_%s", |
128 | method); | 136 | method); |
129 | authorization = GNUNET_PLUGIN_load (lib_name, | 137 | authorization = GNUNET_PLUGIN_load (lib_name, |
130 | (void *) AH_cfg); | 138 | &ap->ac); |
131 | if (NULL == authorization) | 139 | if (NULL == authorization) |
132 | { | 140 | { |
133 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 141 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |