summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2008-12-11 23:04:46 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2008-12-11 23:04:46 +0000
commit0d00bb94bb5de5a803b9e3f2f40502957d3bdc97 (patch)
treefeeb79ce30b66d6ca401571fb8a765b01a5225ea /usr.sbin/smtpd
parent91afdfb6c0efb316110bb2e2223c8af413e26f73 (diff)
- snprintf -> bsnprintf
- makemap and newaliases need util.c now
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r--usr.sbin/smtpd/aliases.c18
-rw-r--r--usr.sbin/smtpd/makemap/Makefile4
-rw-r--r--usr.sbin/smtpd/newaliases/Makefile4
3 files changed, 11 insertions, 15 deletions
diff --git a/usr.sbin/smtpd/aliases.c b/usr.sbin/smtpd/aliases.c
index 60bf90e2917..800dad308bd 100644
--- a/usr.sbin/smtpd/aliases.c
+++ b/usr.sbin/smtpd/aliases.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aliases.c,v 1.10 2008/12/10 23:04:24 jacekm Exp $ */
+/* $OpenBSD: aliases.c,v 1.11 2008/12/11 23:04:45 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -139,7 +139,6 @@ aliases_virtual_exist(struct smtpd *env, struct path *path)
DB *aliasesdb;
struct map *map;
char strkey[MAX_LINE_SIZE];
- int spret;
map = map_findbyname(env, "virtual");
if (map == NULL)
@@ -149,8 +148,8 @@ aliases_virtual_exist(struct smtpd *env, struct path *path)
if (aliasesdb == NULL)
return 0;
- spret = snprintf(strkey, MAX_LINE_SIZE, "%s@%s", path->user, path->domain);
- if (spret == -1 || spret >= MAX_LINE_SIZE) {
+ if (! bsnprintf(strkey, MAX_LINE_SIZE, "%s@%s", path->user,
+ path->domain)) {
aliasesdb->close(aliasesdb);
return 0;
}
@@ -160,8 +159,7 @@ aliases_virtual_exist(struct smtpd *env, struct path *path)
if ((ret = aliasesdb->get(aliasesdb, &key, &val, 0)) != 0) {
- spret = snprintf(strkey, MAX_LINE_SIZE, "@%s", path->domain);
- if (spret == -1 || spret >= MAX_LINE_SIZE) {
+ if (! bsnprintf(strkey, MAX_LINE_SIZE, "@%s", path->domain)) {
aliasesdb->close(aliasesdb);
return 0;
}
@@ -193,7 +191,6 @@ aliases_virtual_get(struct smtpd *env, struct aliaseslist *aliases,
struct alias *nextalias;
struct map *map;
char strkey[MAX_LINE_SIZE];
- int spret;
map = map_findbyname(env, "virtual");
if (map == NULL)
@@ -203,8 +200,8 @@ aliases_virtual_get(struct smtpd *env, struct aliaseslist *aliases,
if (aliasesdb == NULL)
return 0;
- spret = snprintf(strkey, MAX_LINE_SIZE, "%s@%s", path->user, path->domain);
- if (spret == -1 || spret >= MAX_LINE_SIZE) {
+ if (! bsnprintf(strkey, MAX_LINE_SIZE, "%s@%s", path->user,
+ path->domain)) {
aliasesdb->close(aliasesdb);
return 0;
}
@@ -214,8 +211,7 @@ aliases_virtual_get(struct smtpd *env, struct aliaseslist *aliases,
if ((ret = aliasesdb->get(aliasesdb, &key, &val, 0)) != 0) {
- spret = snprintf(strkey, MAX_LINE_SIZE, "@%s", path->domain);
- if (spret == -1 || spret >= MAX_LINE_SIZE) {
+ if (! bsnprintf(strkey, MAX_LINE_SIZE, "@%s", path->domain)) {
aliasesdb->close(aliasesdb);
return 0;
}
diff --git a/usr.sbin/smtpd/makemap/Makefile b/usr.sbin/smtpd/makemap/Makefile
index 56c1a8654d8..00bb6db2290 100644
--- a/usr.sbin/smtpd/makemap/Makefile
+++ b/usr.sbin/smtpd/makemap/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.1 2008/12/03 21:20:20 gilles Exp $
+# $OpenBSD: Makefile,v 1.2 2008/12/11 23:04:45 gilles Exp $
.PATH: ${.CURDIR}/..
@@ -10,6 +10,6 @@ BINMODE?=555
BINDIR= /usr/bin
MAN= makemap.8
-SRCS= makemap.c aliases.c map.c log.c
+SRCS= makemap.c aliases.c map.c log.c util.c
LDFLAGS= -lutil
.include <bsd.prog.mk>
diff --git a/usr.sbin/smtpd/newaliases/Makefile b/usr.sbin/smtpd/newaliases/Makefile
index 467cff799fe..9322dc11cda 100644
--- a/usr.sbin/smtpd/newaliases/Makefile
+++ b/usr.sbin/smtpd/newaliases/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.1 2008/12/03 21:13:18 gilles Exp $
+# $OpenBSD: Makefile,v 1.2 2008/12/11 23:04:45 gilles Exp $
.PATH: ${.CURDIR}/..
@@ -10,6 +10,6 @@ BINMODE?=555
BINDIR= /usr/bin
MAN= newaliases.8
-SRCS= newaliases.c aliases.c map.c log.c
+SRCS= newaliases.c aliases.c map.c log.c util.c
LDFLAGS= -lutil
.include <bsd.prog.mk>