22 |
unsigned int interval = 0; /* Poll at the specified interval. */ |
unsigned int interval = 0; /* Poll at the specified interval. */ |
23 |
char logfile[PATH_MAX]; /* Log file. */ |
char logfile[PATH_MAX]; /* Log file. */ |
24 |
char *home = NULL; /* User's home directory. */ |
char *home = NULL; /* User's home directory. */ |
25 |
|
#ifdef MEMORY_LOCK |
26 |
uid_t ruid, euid; /* Real and effective UID. */ |
uid_t ruid, euid; /* Real and effective UID. */ |
27 |
jmp_buf acctloop; |
jmp_buf acctloop; |
28 |
|
|
38 |
account_t *ca; /* Current account. */ |
account_t *ca; /* Current account. */ |
39 |
mbox_t *cm; /* Current mailbox. */ |
mbox_t *cm; /* Current mailbox. */ |
40 |
|
|
41 |
|
#ifdef MEMORY_LOCK |
42 |
ruid = getuid(); |
ruid = getuid(); |
43 |
euid = geteuid(); |
euid = geteuid(); |
44 |
seteuid(ruid); /* Drop root privileges. */ |
seteuid(ruid); /* Drop root privileges. */ |
45 |
|
#endif |
46 |
|
|
47 |
home = getenv("HOME"); |
home = getenv("HOME"); |
48 |
options = (OPTION_DETAILS_NORMAL | OPTION_NAMESPACE | OPTION_WARNING); |
options = (OPTION_DETAILS_NORMAL | OPTION_NAMESPACE | OPTION_WARNING); |
183 |
fatal(ERROR_FORK, "imapfilter: forking; %s\n", strerror(errno)); |
fatal(ERROR_FORK, "imapfilter: forking; %s\n", strerror(errno)); |
184 |
break; |
break; |
185 |
case 0: |
case 0: |
186 |
|
#ifdef MEMORY_LOCK |
187 |
secmem_lock(); |
secmem_lock(); |
188 |
setuid(ruid); /* Capability to regain root privileges will |
setuid(ruid); /* Capability to regain root privileges will |
189 |
not be needed any more. */ |
not be needed any more. */ |
190 |
|
#endif |
191 |
lockfile_create(); |
lockfile_create(); |
192 |
corefile_disable(); |
corefile_disable(); |
193 |
break; |
break; |