diff options
author | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-03-09 16:31:10 +0000 |
---|---|---|
committer | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-03-09 16:31:10 +0000 |
commit | 21446aa677b6e97e4f268b0a7dd4bf97080c1495 (patch) | |
tree | 447e599c90728b8c18a77694840a6da26925decd /usr.sbin/smtpd | |
parent | 9782627f4871eb4426b3cef4f0affa7899c77a4e (diff) |
Drop ALIAS_TEXT, plain maps got implemented in a different way; ok gilles@
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r-- | usr.sbin/smtpd/lka.c | 3 | ||||
-rw-r--r-- | usr.sbin/smtpd/makemap.c | 24 | ||||
-rw-r--r-- | usr.sbin/smtpd/smtpd.h | 9 |
3 files changed, 8 insertions, 28 deletions
diff --git a/usr.sbin/smtpd/lka.c b/usr.sbin/smtpd/lka.c index 50b8609efc2..45c6b891194 100644 --- a/usr.sbin/smtpd/lka.c +++ b/usr.sbin/smtpd/lka.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lka.c,v 1.33 2009/03/09 01:43:19 gilles Exp $ */ +/* $OpenBSD: lka.c,v 1.34 2009/03/09 16:31:09 jacekm Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -974,7 +974,6 @@ lka_resolve_alias(struct path *path, struct alias *alias) log_debug("ADDRESS: %s@%s", alias->u.path.user, alias->u.path.domain); *path = alias->u.path; break; - case ALIAS_TEXT: case ALIAS_INCLUDE: fatalx("lka_resolve_alias: unexpected type"); break; diff --git a/usr.sbin/smtpd/makemap.c b/usr.sbin/smtpd/makemap.c index c73828754d7..cee2a462be3 100644 --- a/usr.sbin/smtpd/makemap.c +++ b/usr.sbin/smtpd/makemap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: makemap.c,v 1.13 2009/03/06 23:32:34 gilles Exp $ */ +/* $OpenBSD: makemap.c,v 1.14 2009/03/09 16:31:09 jacekm Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -266,25 +266,11 @@ bad: int make_plain(DBT *val, char *text) { - struct alias *a; + val->data = strdup(text); + if (val->data == NULL) + err(1, "malloc"); - a = calloc(1, sizeof(struct alias)); - if (a == NULL) - err(1, "calloc"); - - a->type = ALIAS_TEXT; - val->data = a->u.text; - val->size = strlcpy(a->u.text, text, sizeof(a->u.text)); - - if (val->size >= sizeof(a->u.text)) { - free(a); - return 0; - } - - /* unlike make_aliases, we deal with a C string, so - * val->size should include the nul-byte. - */ - val->size++; + val->size = strlen(text) + 1; return (val->size); } diff --git a/usr.sbin/smtpd/smtpd.h b/usr.sbin/smtpd/smtpd.h index 75d06d44e8e..9e2cbe537a8 100644 --- a/usr.sbin/smtpd/smtpd.h +++ b/usr.sbin/smtpd/smtpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpd.h,v 1.87 2009/03/09 01:43:19 gilles Exp $ */ +/* $OpenBSD: smtpd.h,v 1.88 2009/03/09 16:31:09 jacekm Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -34,9 +34,6 @@ /* return and forward path size */ #define MAX_PATH_SIZE 256 -/* makemap mapped value text length */ -#define MAX_MAKEMAP_SIZE 256 - /*#define SMTPD_CONNECT_TIMEOUT (60)*/ #define SMTPD_CONNECT_TIMEOUT (10) #define SMTPD_QUEUE_INTERVAL (15 * 60) @@ -393,8 +390,7 @@ enum alias_type { ALIAS_FILENAME, ALIAS_FILTER, ALIAS_INCLUDE, - ALIAS_ADDRESS, - ALIAS_TEXT + ALIAS_ADDRESS }; struct alias { @@ -404,7 +400,6 @@ struct alias { char username[MAXLOGNAME]; char filename[MAXPATHLEN]; char filter[MAXPATHLEN]; - char text[MAX_MAKEMAP_SIZE]; struct path path; } u; }; |