+++ /dev/null
-/*
-** Copyright (C) 2006 Thadeu Lima de Souza Cascardo <cascardo@minaslivre.org>
-** Copyright (C) 2009 Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-*/
-
-#include <string.h>
-#include <gdbm.h>
-#include "usermap.h"
-
-int ACCESS_DEFAULT = ACCESS_DENY;
-
-int
-usermap_perm (char *user)
-{
- GDBM_FILE allow_db = NULL;
- GDBM_FILE deny_db = NULL;
- int allow = 0;
- int deny = 0;
- datum key;
- key.dptr = user;
- key.dsize = strlen (user);
- allow_db = gdbm_open ("/var/lib/popproxy/allow.db",
- 0, GDBM_READER, 0, NULL);
- deny_db = gdbm_open ("/var/lib/popproxy/deny.db",
- 0, GDBM_READER, 0, NULL);
- if (allow_db)
- {
- allow = gdbm_exists (allow_db, key);
- gdbm_close (allow_db);
- }
- if (deny_db)
- {
- deny = gdbm_exists (deny_db, key);
- gdbm_close (deny_db);
- }
- if (deny)
- return ACCESS_DENY;
- if (allow)
- return ACCESS_ALLOW;
- return ACCESS_DEFAULT;
-}