3 |
#include <string.h> |
#include <string.h> |
4 |
#include <ctype.h> |
#include <ctype.h> |
5 |
#include <limits.h> |
#include <limits.h> |
6 |
#include <sys/types.h> /* IEEE Std 1003.1-2001 transitional. */ |
#include <sys/types.h> /* For POSIX.1-2001 non-conformant systems. */ |
7 |
#include <regex.h> |
#include <regex.h> |
8 |
|
|
9 |
#include "config.h" |
#include "config.h" |
68 |
init_account(a); |
init_account(a); |
69 |
|
|
70 |
strncat(a->key, line + m[1].rm_so, min(m[1].rm_eo - m[1].rm_so, |
strncat(a->key, line + m[1].rm_so, min(m[1].rm_eo - m[1].rm_so, |
71 |
KEY_LEN - 1)); |
KEY_LEN - 1)); |
72 |
|
|
73 |
debug("account: '%s'\n", a->key); |
debug("account: '%s'\n", a->key); |
74 |
|
|
99 |
} else |
} else |
100 |
flags |= FLAG_BLANKPASS; |
flags |= FLAG_BLANKPASS; |
101 |
|
|
102 |
strncat(a->server, line + m[6].rm_so, |
strncat(a->server, line + m[6].rm_so, min(m[6].rm_eo - m[6].rm_so, |
103 |
min(m[6].rm_eo - m[6].rm_so, SERVER_LEN - 1)); |
SERVER_LEN - 1)); |
104 |
|
|
105 |
debug("server: '%s'\n", a->server); |
debug("server: '%s'\n", a->server); |
106 |
|
|
140 |
|
|
141 |
for (a = accounts; a != NULL; a = a->next) |
for (a = accounts; a != NULL; a = a->next) |
142 |
if (a->pass_attr == PASS_ATTR_NONE && |
if (a->pass_attr == PASS_ATTR_NONE && |
143 |
!strcmp(a->server, serv) && |
!strcmp(a->server, serv) && !strcmp(a->user, user)) { |
|
!strcmp(a->user, user)) { |
|
144 |
a->pass_attr = PASS_ATTR_CRYPT; |
a->pass_attr = PASS_ATTR_CRYPT; |
145 |
return a->pass; |
return a->pass; |
146 |
} |
} |
182 |
init_mboxgrp(g); |
init_mboxgrp(g); |
183 |
|
|
184 |
strncat(g->key, line + m[1].rm_so, min(m[1].rm_eo - m[1].rm_so, |
strncat(g->key, line + m[1].rm_so, min(m[1].rm_eo - m[1].rm_so, |
185 |
KEY_LEN - 1)); |
KEY_LEN - 1)); |
186 |
|
|
187 |
debug("folder: '%s'\n", g->key); |
debug("folder: '%s'\n", g->key); |
188 |
|
|
189 |
strncat(mboxs, line + m[2].rm_so, min(m[2].rm_eo - m[2].rm_so, |
strncat(mboxs, line + m[2].rm_so, min(m[2].rm_eo - m[2].rm_so, |
190 |
LINE_MAX - 1)); |
LINE_MAX - 1)); |
191 |
|
|
192 |
process_mboxgrp(g, mboxs); |
process_mboxgrp(g, mboxs); |
193 |
|
|
198 |
|
|
199 |
|
|
200 |
/* |
/* |
201 |
* Calls set_mbox() in order to create mailboxes that are part of |
* Calls set_mbox() in order to create mailboxes that are part of the |
202 |
* the mailbox-group. |
* mailbox-group. |
203 |
*/ |
*/ |
204 |
void |
void |
205 |
process_mboxgrp(mboxgrp_t * g, char *mboxs) |
process_mboxgrp(mboxgrp_t * g, char *mboxs) |
289 |
hex[2] = '\0'; |
hex[2] = '\0'; |
290 |
|
|
291 |
if (!isprint((unsigned char)(*str = (char)strtoul(hex, |
if (!isprint((unsigned char)(*str = (char)strtoul(hex, |
292 |
NULL, 16)))) |
NULL, 16)))) |
293 |
return ERROR_PARSER; |
return ERROR_PARSER; |
294 |
|
|
295 |
str++; |
str++; |