**
*/
-#include <gnet.h>
#include <glib.h>
#include <string.h>
#include "nethook.h"
#include "pop.h"
+#include "usermap.h"
typedef struct
{
{
pop_t *pop = hook->data;
g_string_append_len (pop->buffer, buffer, len);
- hook->data = pop->orig_data;
while (pop_getline (pop) == 0)
{
if (pop_check_user (pop) == 0)
- g_message ("User is trying to authenticate as %s.", pop->user);
+ {
+ g_message ("User is trying to authenticate as %s.", pop->user);
+ if (usermap_perm (pop->user) == ACCESS_DENY)
+ {
+ g_message ("Denying access to user %s.", pop->user);
+ pop_destroy (hook);
+ hc_conn_close (hook->peer->conn);
+ hc_conn_close (hook->conn);
+ return;
+ }
+ }
+ hook->data = pop->orig_data;
pop->orig_read (hook, pop->line->str, pop->line->len);
+ hook->data = pop;
}
- hook->data = pop;
}
net_hook_t *