summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2008-12-18 01:41:57 +0100
committerDavid Sommerseth <dazo@users.sourceforge.net>2008-12-18 01:41:57 +0100
commit9ca25eedddf28c8ab378a8ff6cbf6991ff0ef3c7 (patch)
tree673189f4efd483461233fcf6c8292cfa8f806ca7 /common
parent0a8ea6be0a48353ee81641f6553c59f9e1728162 (diff)
downloadeurephia-9ca25eedddf28c8ab378a8ff6cbf6991ff0ef3c7.tar.gz
eurephia-9ca25eedddf28c8ab378a8ff6cbf6991ff0ef3c7.tar.xz
eurephia-9ca25eedddf28c8ab378a8ff6cbf6991ff0ef3c7.zip
Removed everything which was connected to the eurephiaUSERINFO struct.
Diffstat (limited to 'common')
-rw-r--r--common/eurephia_admin_common.c223
-rw-r--r--common/eurephia_admin_common.h57
-rw-r--r--common/eurephia_admin_struct.h33
3 files changed, 0 insertions, 313 deletions
diff --git a/common/eurephia_admin_common.c b/common/eurephia_admin_common.c
deleted file mode 100644
index 3661f11..0000000
--- a/common/eurephia_admin_common.c
+++ /dev/null
@@ -1,223 +0,0 @@
-/* eurephia_admin_common.c -- Common functions used for the admin API
- *
- * GPLv2 - Copyright (C) 2008 David Sommerseth <dazo@users.sourceforge.net>
- *
- * 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; version 2
- * of the License.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-#include <eurephia_nullsafe.h>
-#include <passwd.h>
-
-#define EUREPHIA_ADMIN_COMMON_C
-#include "eurephia_admin_struct.h"
-#include "eurephia_admin_common.h"
-
-
-eurephiaUSERINFO *eAdminPopulateUSERINFO(int uid, const char *uname, const char *pwd,
- const char *activated, const char *deactivd, const char *lastacc)
-{
- eurephiaUSERINFO *newrec = NULL;
-
- newrec = (eurephiaUSERINFO *) malloc(sizeof(eurephiaUSERINFO)+2);
- assert( newrec != NULL );
- memset(newrec, 0, sizeof(eurephiaUSERINFO)+2);
-
- newrec->uid = uid;
- newrec->username = strdup_nullsafe(uname);
- newrec->password = (pwd == NULL ? NULL : passwdhash(pwd));
- newrec->activated = strdup_nullsafe(activated);
- newrec->deactivated = strdup_nullsafe(deactivd);
- newrec->last_accessed = strdup_nullsafe(lastacc);
- newrec->account_flags = 0;
- newrec->setnull_flags = 0;
- newrec->next = NULL;
-
- return newrec;
-}
-
-
-void _eAdminFreeUSERINFO_func(eurephiaUSERINFO *p) {
- if( p == NULL ) {
- return;
- }
- eAdminFreeCERTLIST(p->certlist);
- eAdminFreeUSERINFO(p->next);
- free_nullsafe(p->username);
- free_nullsafe(p->password);
- free_nullsafe(p->activated);
- free_nullsafe(p->deactivated);
- free_nullsafe(p->last_accessed);
- p->next = NULL;
- free(p);
-}
-
-void _eAdminFreeUSERLIST_func(eurephiaUSERLIST *p) {
- if( p == NULL ) {
- return;
- }
-
- eAdminFreeUSERINFO(p->users);
- free(p);
-}
-
-
-eurephiaCERTLIST *eAdminCreateCERTLIST() {
- eurephiaCERTLIST *lst = NULL;
-
- lst = (eurephiaCERTLIST *) malloc(sizeof(eurephiaCERTLIST)+2);
- memset(lst, 0, sizeof(eurephiaCERTLIST)+2);
- lst->num_certs = 0;
- return lst;
-}
-
-eurephiaCERTINFO *eAdminPopulateCERTINFO(int certid, int depth, const char *digest,
- const char *cname, const char *org, const char *email, const char *reg)
-{
- eurephiaCERTINFO *newrec = NULL;
-
- newrec = (eurephiaCERTINFO *) malloc(sizeof(eurephiaCERTINFO)+2);
- assert( newrec != NULL );
- memset(newrec, 0, sizeof(eurephiaCERTINFO)+2);
-
- newrec->certid = certid;
- newrec->depth = depth;
- newrec->digest = strdup_nullsafe(digest);
- newrec->common_name = strdup_nullsafe(cname);
- newrec->organisation = strdup_nullsafe(org);
- newrec->email = strdup_nullsafe(email);
- newrec->registered = strdup_nullsafe(reg);
- newrec->next = NULL;
-
- return newrec;
-}
-
-void eAdminInsertCERTINFO(eurephiaCERTLIST *list, eurephiaCERTINFO *cert) {
- assert( list != NULL );
-
- if( list->certs != NULL ) {
- cert->next = list->certs;
- list->certs = cert;
- list->num_certs++;
- } else {
- list->certs = cert;
- list->num_certs = 1;
- }
-}
-
-void _eAdminFreeCERTINFO_func(eurephiaCERTINFO *p) {
- if( p == NULL ) {
- return;
- }
- eAdminFreeCERTINFO(p->next);
- free_nullsafe(p->digest);
- free_nullsafe(p->common_name);
- free_nullsafe(p->organisation);
- free_nullsafe(p->email);
- free_nullsafe(p->registered);
- p->access = NULL;
- p->next = NULL;
- free(p);
-}
-
-void _eAdminFreeCERTLIST_func(eurephiaCERTLIST *p) {
-#ifdef FIREWALL
- eurephiaACCESSLIST *aclst = NULL;
-#endif
- if( p == NULL ) {
- return;
- }
-
-#ifdef FIREWALL
- aclst = ((p->certs != NULL) && (p->certs->access != NULL)) ? p->certs->access->_head : NULL;
- eAdminFreeACCESSLIST(aclst);
-#endif
- eAdminFreeCERTINFO(p->certs);
- free(p);
-}
-
-#ifdef FIREWALL
-eurephiaACCESSINFO *eAdminRegisterACCESSINFO(eurephiaACCESSLIST *aclst, int accprofid,
- const char *fwprofile, const char *accdescr) {
- eurephiaACCESSINFO *ptr = NULL;
-
- assert( aclst != NULL );
-
- for( ptr = aclst->profiles; ptr != NULL; ptr = ptr->next) {
- if( ptr->accessprofile == accprofid ) {
- return ptr;
- }
- }
-
- // If no record was found, register it automatically
- if( ptr == NULL ) {
- ptr = (eurephiaACCESSINFO *) malloc(sizeof(eurephiaACCESSINFO)+2);
- assert(ptr != NULL);
- memset(ptr, 0, sizeof(eurephiaACCESSINFO)+2);
-
- ptr->accessprofile = accprofid;
- ptr->fwprofile = strdup_nullsafe(fwprofile);
- ptr->access_descr = strdup_nullsafe(accdescr);
- ptr->_head = aclst;
-
- if( aclst->profiles == NULL ) {
- aclst->profiles = ptr;
- aclst->num_profiles = 1;
- } else {
- ptr->next = aclst->profiles;
- aclst->profiles = ptr;
- aclst->num_profiles++;
- }
- }
- return ptr;
-}
-
-
-eurephiaACCESSLIST *eAdminCreateACCESSLIST() {
- eurephiaACCESSLIST *ptr = NULL;
-
- ptr = (eurephiaACCESSLIST *) malloc(sizeof(eurephiaACCESSLIST)+2);
- assert(ptr != NULL);
- memset(ptr, 0, sizeof(eurephiaACCESSLIST)+2);
- return ptr;
-}
-
-
-void _eAdminFreeACCESSINFO_func(eurephiaACCESSINFO *p) {
- if( p == NULL ) {
- return;
- }
- eAdminFreeACCESSINFO(p->next);
- free_nullsafe(p->access_descr);
- free_nullsafe(p->fwprofile);
- p->_head = NULL;
- p->accessprofile = 0;
- free(p);
-}
-
-void _eAdminFreeACCESSLIST_func(eurephiaACCESSLIST *p) {
- if( p == NULL ) {
- return;
- }
- eAdminFreeACCESSINFO(p->profiles);
- p->num_profiles = 0;
- free(p);
-}
-#endif // FIREWALL
diff --git a/common/eurephia_admin_common.h b/common/eurephia_admin_common.h
deleted file mode 100644
index 57304b5..0000000
--- a/common/eurephia_admin_common.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* eurephia_admin_common.h -- Common functions used for the admin API
- *
- * GPLv2 - Copyright (C) 2008 David Sommerseth <dazo@users.sourceforge.net>
- *
- * 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; version 2
- * of the License.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef EUREPHIA_ADMIN_COMMON_H_
-# define EUREPHIA_ADMIN_COMMON_H_
-
-eurephiaUSERINFO *eAdminPopulateUSERINFO(int uid, const char *uname, const char *pwd,
- const char *activated, const char *deactivd, const char *lastacc);
-
-void _eAdminFreeUSERINFO_func(eurephiaUSERINFO *);
-#define eAdminFreeUSERINFO(x) { _eAdminFreeUSERINFO_func(x); x = NULL; }
-
-void _eAdminFreeUSERLIST_func(eurephiaUSERLIST *);
-#define eAdminFreeUSERLIST(x) { _eAdminFreeUSERLIST_func(x); x = NULL; }
-
-
-eurephiaCERTLIST *eAdminCreateCERTLIST();
-
-eurephiaCERTINFO *eAdminPopulateCERTINFO(int certid, int depth, const char *digest,
- const char *cname, const char *org, const char *email, const char *reg);
-
-void eAdminInsertCERTINFO(eurephiaCERTLIST *list, eurephiaCERTINFO *cert);
-
-void _eAdminFreeCERTINFO_func(eurephiaCERTINFO *);
-#define eAdminFreeCERTINFO(x) { _eAdminFreeCERTINFO_func(x); x = NULL; }
-
-void _eAdminFreeCERTLIST_func(eurephiaCERTLIST *);
-#define eAdminFreeCERTLIST(x) { _eAdminFreeCERTLIST_func(x); x = NULL; }
-
-eurephiaACCESSLIST *eAdminCreateACCESSLIST();
-eurephiaACCESSINFO *eAdminRegisterACCESSINFO(eurephiaACCESSLIST *aclst, int accprofid,
- const char *fwprofile, const char *accdescr);
-
-void _eAdminFreeACCESSINFO_func(eurephiaACCESSINFO *);
-#define eAdminFreeACCESSINFO(x) { _eAdminFreeACCESSINFO_func(x); x = NULL; }
-
-void _eAdminFreeACCESSLIST_func(eurephiaACCESSLIST *);
-#define eAdminFreeACCESSLIST(x) { _eAdminFreeACCESSLIST_func(x); x = NULL; }
-
-#endif /* !EUREPHIA_ADMIN_COMMON_H_ */
diff --git a/common/eurephia_admin_struct.h b/common/eurephia_admin_struct.h
index 2015f95..da7429c 100644
--- a/common/eurephia_admin_struct.h
+++ b/common/eurephia_admin_struct.h
@@ -29,19 +29,6 @@
#define ACCFLAG_RSETLASTUSED 0x020
#define ACCFLAG_RSETLOGINCNT 0x040
-typedef struct _eurephiaACCESSINFO_s {
- int accessprofile;
- char *fwprofile;
- char *access_descr;
- struct _eurephiaACCESSINFO_s *next;
- void *_head;
-} eurephiaACCESSINFO;
-
-typedef struct _eurephiaACCESSLIST_s {
- eurephiaACCESSINFO *profiles;
- int num_profiles;
-} eurephiaACCESSLIST;
-
typedef struct _eurephiaCERTINFO_s {
int info_available;
@@ -52,7 +39,6 @@ typedef struct _eurephiaCERTINFO_s {
char *email;
char *registered;
int certid;
- eurephiaACCESSINFO *access;
struct _eurephiaCERTINFO_s *next;
} eurephiaCERTINFO;
@@ -63,25 +49,6 @@ typedef struct {
int maxlen[];
} eurephiaCERTLIST;
-typedef struct _eurephiaUSERINFO_s {
- char *username;
- char *password;
- char *activated;
- char *deactivated;
- char *last_accessed;
- int uid;
- int logincount;
- long int account_flags;
- long int setnull_flags;
- eurephiaCERTLIST *certlist;
- struct _eurephiaUSERINFO_s *next;
-} eurephiaUSERINFO;
-
-typedef struct {
- eurephiaUSERINFO *users;
- int num_users;
- int maxlen[];
-} eurephiaUSERLIST;
typedef struct _eurephiaLOGENTRY_s {
int id;