85 |
list_destroy (plist); |
list_destroy (plist); |
86 |
return string; |
return string; |
87 |
} |
} |
88 |
|
|
89 |
static list_t unix_group_to_list __P((char *name)); |
static list_t unix_group_to_list __P((char *name)); |
90 |
static list_t unix_gid_to_list __P((char *name)); |
static list_t unix_gid_to_list __P((char *name)); |
91 |
static list_t unix_passwd_to_list __P((void)); |
static list_t unix_passwd_to_list __P((void)); |
111 |
input : /* empty */ |
input : /* empty */ |
112 |
| alias_list |
| alias_list |
113 |
| alias_list nl |
| alias_list nl |
114 |
|
| nl alias_list |
115 |
|
| nl alias_list nl |
116 |
; |
; |
117 |
|
|
118 |
alias_list : alias |
alias_list : alias |
131 |
| nl '\n' |
| nl '\n' |
132 |
; |
; |
133 |
|
|
134 |
alias : STRING ':' address_group |
alias : STRING ':' { ali_verbatim (1); } address_group |
135 |
{ |
{ |
136 |
|
ali_verbatim (0); |
137 |
$$ = xmalloc (sizeof (*$$)); |
$$ = xmalloc (sizeof (*$$)); |
138 |
$$->name = $1; |
$$->name = $1; |
139 |
$$->rcpt_list = $3; |
$$->rcpt_list = $4; |
140 |
$$->inclusive = 0; |
$$->inclusive = 0; |
141 |
} |
} |
142 |
| STRING ';' address_group |
| STRING ';' { ali_verbatim (1); } address_group |
143 |
{ |
{ |
144 |
|
ali_verbatim (0); |
145 |
$$ = xmalloc (sizeof (*$$)); |
$$ = xmalloc (sizeof (*$$)); |
146 |
$$->name = $1; |
$$->name = $1; |
147 |
$$->rcpt_list = $3; |
$$->rcpt_list = $4; |
148 |
$$->inclusive = 1; |
$$->inclusive = 1; |
149 |
} |
} |
150 |
; |
; |
227 |
ali_member (list_t list, char *name) |
ali_member (list_t list, char *name) |
228 |
{ |
{ |
229 |
iterator_t itr; |
iterator_t itr; |
230 |
int rc = 1; |
int found = 0; |
231 |
|
|
232 |
if (iterator_create (&itr, list)) |
if (iterator_create (&itr, list)) |
233 |
return 1; |
return 0; |
234 |
for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr)) |
for (iterator_first (itr); !found && !iterator_is_done (itr); |
235 |
|
iterator_next (itr)) |
236 |
{ |
{ |
237 |
char *item; |
char *item; |
238 |
|
address_t tmp; |
239 |
|
|
240 |
iterator_current (itr, (void **)&item); |
iterator_current (itr, (void **)&item); |
241 |
if (strcmp (name, item) == 0) |
if (strcmp (item, name) == 0) |
242 |
|
found = 1; |
243 |
|
else if (address_create (&tmp, item) == 0) |
244 |
{ |
{ |
245 |
rc = 0; |
found = address_contains_email (tmp, name); |
246 |
break; |
address_destroy (&tmp); |
247 |
} |
} |
248 |
} |
} |
249 |
iterator_destroy (&itr); |
iterator_destroy (&itr); |
250 |
return rc; |
return found; |
251 |
} |
} |
252 |
|
|
253 |
int |
int |
422 |
{ |
{ |
423 |
struct mh_alias *alias; |
struct mh_alias *alias; |
424 |
iterator_current (itr, (void **)&alias); |
iterator_current (itr, (void **)&alias); |
425 |
if (ali_member (alias->rcpt_list, uname) == 0) |
if (ali_member (alias->rcpt_list, uname)) |
426 |
{ |
{ |
427 |
if (*return_list == NULL && list_create (return_list)) |
if (*return_list == NULL && list_create (return_list)) |
428 |
break; |
break; |