Go to the documentation of this file.
43 #include <sys/types.h>
54 #define CFGFILE "elogd.cfg"
59 #define DEFAULT_PORT 80
66 #define DIR_SEPARATOR '\\'
67 #define DIR_SEPARATOR_STR "\\"
69 #define snprintf _snprintf
95 #define DIR_SEPARATOR '/'
96 #define DIR_SEPARATOR_STR "/"
99 #define DEFAULT_USER "nobody"
102 #ifndef DEFAULT_GROUP
103 #define DEFAULT_GROUP "nogroup"
107 #define PIDFILE "/var/run/elogd.pid"
113 #include <netinet/in.h>
114 #include <arpa/inet.h>
115 #include <sys/socket.h>
116 #include <sys/time.h>
117 #include <sys/types.h>
118 #include <sys/stat.h>
119 #include <sys/wait.h>
131 #define closesocket(s) close(s)
134 #define stricmp(s1, s2) strcasecmp(s1, s2)
141 #include <openssl/ssl.h>
149 #define SYSLOG_PRIORITY LOG_NOTICE
151 #define TELL(fh) lseek(fh, 0, SEEK_CUR)
154 #define TRUNCATE(fh) chsize(fh, TELL(fh))
156 #define TRUNCATE(fh) ftruncate(fh, TELL(fh))
159 #define NAME_LENGTH 1500
161 #define DEFAULT_TIME_FORMAT "%c"
162 #define DEFAULT_DATE_FORMAT "%x"
164 #define DEFAULT_HTTP_CHARSET "ISO-8859-1"
170 #define EL_FIRST_MSG 2
171 #define EL_LAST_MSG 3
173 #define EL_FILE_ERROR 5
176 #define EL_MEM_ERROR 8
177 #define EL_DUPLICATE 9
178 #define EL_INVAL_FILE 10
185 #define MAX_GROUPS 32
186 #define MAX_PARAM 200
187 #define MAX_ATTACHMENTS 50
188 #define MAX_N_LIST 100
189 #define MAX_N_ATTR 100
190 #define MAX_N_EMAIL 500
191 #define MAX_REPLY_TO 100
192 #define CMD_SIZE 10000
193 #define TEXT_SIZE 250000
194 #define MAX_PATH_LENGTH 256
196 #define MAX_CONTENT_LENGTH 10*1024*1024
199 #define AF_REQUIRED (1<<0)
200 #define AF_LOCKED (1<<1)
201 #define AF_MULTI (1<<2)
202 #define AF_FIXED_EDIT (1<<3)
203 #define AF_FIXED_REPLY (1<<4)
204 #define AF_ICON (1<<5)
205 #define AF_RADIO (1<<6)
206 #define AF_EXTENDABLE (1<<7)
207 #define AF_DATE (1<<8)
208 #define AF_DATETIME (1<<9)
209 #define AF_TIME (1<<10)
210 #define AF_NUMERIC (1<<11)
211 #define AF_USERLIST (1<<12)
212 #define AF_MUSERLIST (1<<13)
213 #define AF_USEREMAIL (1<<14)
214 #define AF_MUSEREMAIL (1<<15)
217 #define AFF_SAME_LINE 1
218 #define AFF_MULTI_LINE 2
220 #define AFF_EXTENDABLE 8
229 unsigned char md5_digest[16];
245 unsigned char md5_digest[16];
248 typedef struct LBNODE *LBLIST;
274 extern void eprintf(
const char *, ...);
277 BOOL email_notify[1000], time_t * last_access,
int *inactive);
298 int getcfg(
char *group,
char *param,
char *value,
int vsize);
308 char *
loc(
char *orig);
311 char *
stristr(
const char *str,
const char *pattern);
323 int get_thumb_name(
const char *file_name,
char *thumb_name,
int size,
int index);
327 void do_crypt(
const char *s,
char *d,
int size);
333 int auth_change_password(
LOGBOOK *lbs,
const char *user,
const char *old_pwd,
const char *new_pwd,
char *error_str,
int error_size);
LBLIST get_logbook_hierarchy(void)
int strbreak(char *str, char list[][NAME_LENGTH], int size, char *brk, BOOL ignore_quotes)
int set_user_inactive(LOGBOOK *lbs, char *user, int inactive)
BOOL enum_user_line(LOGBOOK *lbs, int n, char *user, int size)
PMXML_NODE load_password_file(LOGBOOK *lbs, char *error, int error_size)
int load_password_files(void)
void free_logbook_hierarchy(LBLIST root)
void show_elog_list(LOGBOOK *lbs, int past_n, int last_n, int page_n, BOOL default_page, char *info)
int ascii_compare(const void *s1, const void *s2)
int get_user_line(LOGBOOK *lbs, char *user, char *password, char *full_name, char *email, BOOL email_notify[1000], time_t *last_access, int *inactive)
int set_attributes(LOGBOOK *lbs, char attributes[][NAME_LENGTH], int n)
char * getparam(char *param)
int create_thumbnail(LOGBOOK *lbs, char *file_name)
void show_error(char *error)
int is_inline_attachment(char *encoding, int message_id, char *text, int i, char *att)
void strencode2(char *b, const char *text, int size)
int change_config_line(LOGBOOK *lbs, char *option, char *old_value, char *new_value)
void eprintf(const char *,...)
void show_elog_entry(LOGBOOK *lbs, char *dec_path, char *command)
int build_subst_list(LOGBOOK *lbs, char list[][NAME_LENGTH], char value[][NAME_LENGTH], char attrib[][NAME_LENGTH], BOOL format_date)
int parse_config_file(char *config_file)
void highlight_searchtext(regex_t *re_buf, char *src, char *dst, BOOL hidden)
char * stristr(const char *str, const char *pattern)
int execute_shell(LOGBOOK *lbs, int message_id, char attrib[MAX_N_ATTR][NAME_LENGTH], char att_file[MAX_ATTACHMENTS][256], char *sh_cmd)
void show_top_text(LOGBOOK *lbs)
BOOL is_admin_user_global(char *user)
LOGBOOK * get_first_lbs_with_global_passwd(void)
int scan_attributes(char *logbook)
BOOL check_login(LOGBOOK *lbs, char *sid)
void remove_crlf(char *buffer)
BOOL is_admin_user(LOGBOOK *lbs, char *user)
BOOL check_login_user(LOGBOOK *lbs, char *user)
void strencode(char *text)
time_t convert_datetime(char *date_string)
int ascii_compare2(const void *s1, const void *s2)
int auth_verify_password_krb5(LOGBOOK *lbs, const char *user, const char *password, char *error_str, int error_size)
int get_full_name(LOGBOOK *lbs, char *uname, char *full_name)
int auth_change_password_krb5(LOGBOOK *lbs, const char *user, const char *old_pwd, const char *new_pwd, char *error, int error_size)
int auth_verify_password(LOGBOOK *lbs, const char *user, const char *password, char *error_str, int error_size)
BOOL isparam(char *param)
void load_config_section(char *section, char **buffer, char *error)
void strencode_nouml(char *text)
BOOL is_logbook_in_group(LBLIST pgrp, char *logbook)
void show_bottom_text(LOGBOOK *lbs)
void do_crypt(const char *s, char *d, int size)
int read_password(char *pwd, int size)
time_t convert_date(char *date_string)
int auth_change_password(LOGBOOK *lbs, const char *user, const char *old_pwd, const char *new_pwd, char *error_str, int error_size)
void compose_base_url(LOGBOOK *lbs, char *base_url, int size, BOOL email_notify)
BOOL get_password_file(LOGBOOK *lbs, char *file_name, int size)
int getcfg(char *group, char *param, char *value, int vsize)
int get_thumb_name(const char *file_name, char *thumb_name, int size, int index)
void write_logfile(LOGBOOK *lbs, const char *str)