aboutsummaryrefslogtreecommitdiff
path: root/duser.h
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunk@stsci.edu>2011-04-05 15:53:11 -0400
committerJoseph Hunkeler <jhunk@stsci.edu>2011-04-05 15:53:11 -0400
commit9caebb1675517798570aea81a831ca2ec1f23153 (patch)
tree6469bedc18b53aaf445cec6836f23ee3d8376ed0 /duser.h
parenta3cdfe38ce0d9f5804270ce5a5d573b7acea6274 (diff)
downloadduser-9caebb1675517798570aea81a831ca2ec1f23153.tar.gz
Added cfg_open(), cfg_get_key(), and cfg_close()
Added configuration file parsing, and removed constants (list_path, LOGFILE). CFG_PATH is defined in duser.h and will need to be changed before compiling. Removed basename in favor of libgen.h Log no longer reports DELETE ALL/SINGLE. Just DELETE. Fixed a ridiculous file truncation mistake in user_del(). Removed dependency on libtre... it sucks. Decided to go with libc searching -- seems to work better. (strfind()) We now validate strings passed as arguments to make sure they cannot cause arbitrary code execution, or accidental damage. (strval()) Added match column to list output. user_add was truncating files... fixed. CMD_FLAG_ADD will verify adding addresses to a mailing list. CMD_FLAG_MOD will display a temporary error (not done) If a corrupt record ever occurs it returns -1.
Diffstat (limited to 'duser.h')
-rw-r--r--duser.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/duser.h b/duser.h
index 764ff76..2ed8674 100644
--- a/duser.h
+++ b/duser.h
@@ -3,10 +3,7 @@
#include <limits.h>
#define REGEX_MAX 255
-#define regex_fmt "\%s$"
-//#define regex_fmt "m/%s$/"
-#define list_path "/internal/1/domotest/opt/majordomo/majordomo-1.94.3/lists/"
-#define LOGFILE "/var/log/duser"
+#define CFG_PATH "/usr/local/etc/duser"
#define SELF __FUNCTION__
typedef struct stats_t
{
@@ -31,9 +28,11 @@ typedef struct record_t
int pad3;
} record_t;
+int cfg_open(const char* filename);
+void cfg_close();
+int cfg_get_key(char* val, const char* key);
int logcleanup();
int COM(const char* func, char *format, ...);
-char* basename(const char* path);
record_t* find_in_file(const char* filename, const char* needle);
int get_file_count(const char* path);
char** get_file_list(const char* path, int count);