diff options
author | 2012-03-07 23:22:53 +0000 | |
---|---|---|
committer | 2012-03-07 23:22:53 +0000 | |
commit | a8b00f30da8e38190b58226aa96bd3a315270f9d (patch) | |
tree | 41c92a99cd346901e81da35777994ebd4b9510db | |
parent | - db.h not needed here, already removed by chl@ but I fscked up previous (diff) | |
download | wireguard-openbsd-a8b00f30da8e38190b58226aa96bd3a315270f9d.tar.xz wireguard-openbsd-a8b00f30da8e38190b58226aa96bd3a315270f9d.zip |
- remove some map_find() calls that are no longer needed, they are followed
by a map_lookup() call that does the map_find() internally
spotted and diff by Mathieu <ptr.jetable@gmail.com>
-rw-r--r-- | usr.sbin/smtpd/aliases.c | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/usr.sbin/smtpd/aliases.c b/usr.sbin/smtpd/aliases.c index 8d1cc300168..28a01ed142b 100644 --- a/usr.sbin/smtpd/aliases.c +++ b/usr.sbin/smtpd/aliases.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aliases.c,v 1.44 2011/10/11 17:57:10 gilles Exp $ */ +/* $OpenBSD: aliases.c,v 1.45 2012/03/07 23:22:53 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -43,14 +43,9 @@ static int alias_is_include(struct expandnode *, char *, size_t); int aliases_exist(objid_t mapid, char *username) { - struct map *map; struct map_alias *map_alias; char buf[MAX_LOCALPART_SIZE]; - map = map_find(mapid); - if (map == NULL) - return 0; - lowercase(buf, username, sizeof(buf)); map_alias = map_lookup(mapid, buf, K_ALIAS); if (map_alias == NULL) @@ -69,16 +64,11 @@ aliases_exist(objid_t mapid, char *username) int aliases_get(objid_t mapid, struct expandtree *expandtree, char *username) { - struct map *map; struct map_alias *map_alias; struct expandnode *expnode; char buf[MAX_LOCALPART_SIZE]; size_t nbaliases; - map = map_find(mapid); - if (map == NULL) - return 0; - lowercase(buf, username, sizeof(buf)); map_alias = map_lookup(mapid, buf, K_ALIAS); if (map_alias == NULL) @@ -105,14 +95,9 @@ aliases_get(objid_t mapid, struct expandtree *expandtree, char *username) int aliases_vdomain_exists(objid_t mapid, char *hostname) { - struct map *map; struct map_virtual *map_virtual; char buf[MAXHOSTNAMELEN]; - map = map_find(mapid); - if (map == NULL) - return 0; - lowercase(buf, hostname, sizeof(buf)); map_virtual = map_lookup(mapid, buf, K_VIRTUAL); if (map_virtual == NULL) @@ -123,22 +108,16 @@ aliases_vdomain_exists(objid_t mapid, char *hostname) expandtree_free_nodes(&map_virtual->expandtree); free(map_virtual); - return 1; } int aliases_virtual_exist(objid_t mapid, struct mailaddr *maddr) { - struct map *map; struct map_virtual *map_virtual; char buf[MAX_LINE_SIZE]; char *pbuf = buf; - map = map_find(mapid); - if (map == NULL) - return 0; - if (! bsnprintf(buf, sizeof(buf), "%s@%s", maddr->user, maddr->domain)) return 0; @@ -163,17 +142,12 @@ int aliases_virtual_get(objid_t mapid, struct expandtree *expandtree, struct mailaddr *maddr) { - struct map *map; struct map_virtual *map_virtual; struct expandnode *expnode; char buf[MAX_LINE_SIZE]; char *pbuf = buf; int nbaliases; - map = map_find(mapid); - if (map == NULL) - return 0; - if (! bsnprintf(buf, sizeof(buf), "%s@%s", maddr->user, maddr->domain)) return 0; |