Mercurial > masqmail
comparison src/conf.c @ 378:5781ba87df95
Removed ident. This had been discussed on the mailing list in Oct 2011.
Ident is hardly useful in typical setups for masqmail. Probably Oliver
had used it in his setup; that would make sense. Now, I know of nobody
who needs it.
author | markus schnalke <meillo@marmaro.de> |
---|---|
date | Sat, 14 Jan 2012 21:36:58 +0100 |
parents | b27f66555ba8 |
children | a408411ff8df |
comparison
equal
deleted
inserted
replaced
377:9bc3e47b0222 | 378:5781ba87df95 |
---|---|
246 iface->port = def_port; | 246 iface->port = def_port; |
247 DEBUG(9) fprintf(stderr,"rval=%s, address:port=%s:%i\n",line, iface->address, iface->port); | 247 DEBUG(9) fprintf(stderr,"rval=%s, address:port=%s:%i\n",line, iface->address, iface->port); |
248 | 248 |
249 return iface; | 249 return iface; |
250 } | 250 } |
251 | |
252 #ifdef ENABLE_IDENT /* so far used for that only */ | |
253 static struct in_addr* | |
254 parse_network(gchar *line, gint def_port) | |
255 { | |
256 gchar buf[256]; | |
257 gchar *p, *q; | |
258 struct in_addr addr, mask_addr, net_addr, *p_net_addr; | |
259 guint n; | |
260 | |
261 DEBUG(9) fprintf(stderr, "parse_network: %s\n", line); | |
262 | |
263 p = line; | |
264 q = buf; | |
265 while (*p && (*p != '/') && (q < buf + 255)) | |
266 *(q++) = *(p++); | |
267 *q = '\0'; | |
268 | |
269 if ((addr.s_addr = inet_addr(buf)) == INADDR_NONE) { | |
270 fprintf(stderr, "'%s' is not a valid address (must be ip)\n", buf); | |
271 exit(1); | |
272 } | |
273 | |
274 if (*p) { | |
275 guint i; | |
276 p++; | |
277 i = atoi(p); | |
278 if ((i >= 0) && (i <= 32)) | |
279 n = i ? ~((1 << (32 - i)) - 1) : 0; | |
280 else { | |
281 fprintf(stderr, "'%d' is not a valid net mask (must be >= 0 and <= 32)\n", i); | |
282 exit(1); | |
283 } | |
284 } else | |
285 n = 0; | |
286 | |
287 mask_addr.s_addr = htonl(n); | |
288 net_addr.s_addr = mask_addr.s_addr & addr.s_addr; | |
289 | |
290 p_net_addr = g_malloc(sizeof(struct in_addr)); | |
291 p_net_addr->s_addr = net_addr.s_addr; | |
292 return p_net_addr; | |
293 } | |
294 #endif | |
295 | 251 |
296 static gboolean | 252 static gboolean |
297 eat_comments(FILE *in) | 253 eat_comments(FILE *in) |
298 { | 254 { |
299 gint c; | 255 gint c; |
542 foreach(tmp_list, node) { | 498 foreach(tmp_list, node) { |
543 conf.listen_addresses = g_list_append(conf.listen_addresses, parse_interface((gchar *) (node-> data), 25)); | 499 conf.listen_addresses = g_list_append(conf.listen_addresses, parse_interface((gchar *) (node-> data), 25)); |
544 g_free(node->data); | 500 g_free(node->data); |
545 } | 501 } |
546 g_list_free(tmp_list); | 502 g_list_free(tmp_list); |
547 } else if (strcmp(lval, "ident_trusted_nets") == 0) { | |
548 #ifdef ENABLE_IDENT | |
549 GList *node; | |
550 GList *tmp_list = parse_list(rval, FALSE); | |
551 | |
552 conf.ident_trusted_nets = NULL; | |
553 foreach(tmp_list, node) { | |
554 conf.ident_trusted_nets = g_list_append(conf.ident_trusted_nets, parse_network((gchar *) (node->data), 25)); | |
555 g_free(node->data); | |
556 } | |
557 g_list_free(tmp_list); | |
558 #else | |
559 logwrite(LOG_WARNING, "%s ignored: not compiled with ident support\n", lval); | |
560 #endif | |
561 } else if (strncmp(lval, "query_routes.", 13) == 0) { | 503 } else if (strncmp(lval, "query_routes.", 13) == 0) { |
562 GList *file_list = parse_list(rval, FALSE); | 504 GList *file_list = parse_list(rval, FALSE); |
563 table_pair *pair = create_pair(lval+13, file_list); | 505 table_pair *pair = create_pair(lval+13, file_list); |
564 conf.query_routes = g_list_append(conf.query_routes, pair); | 506 conf.query_routes = g_list_append(conf.query_routes, pair); |
565 } else if (strcmp(lval, "permanent_routes") == 0) { | 507 } else if (strcmp(lval, "permanent_routes") == 0) { |