diff options
author | Joerg Jung <jung@cvs.openbsd.org> | 2016-01-04 13:30:21 +0000 |
---|---|---|
committer | Joerg Jung <jung@cvs.openbsd.org> | 2016-01-04 13:30:21 +0000 |
commit | 0ebe3fc40a673c11fda9e80f3e19e2552dd8b498 (patch) | |
tree | d098da878eb9b64f02df6f4c9b5a5a80fa7ca6bb /usr.sbin/smtpd | |
parent | 740e3410fe18216b560b840497dfb0a7ab6fd8b2 (diff) |
switch to /usr/local/libexec when looking for -extras and drop loop iterating
paths
this effectively reverts table.c r1.21 which was mainly introduced for a smooth
transition in -current
ok gilles
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r-- | usr.sbin/smtpd/parse.y | 4 | ||||
-rw-r--r-- | usr.sbin/smtpd/smtpd.c | 4 | ||||
-rw-r--r-- | usr.sbin/smtpd/smtpd.h | 5 | ||||
-rw-r--r-- | usr.sbin/smtpd/table.c | 37 |
4 files changed, 21 insertions, 29 deletions
diff --git a/usr.sbin/smtpd/parse.y b/usr.sbin/smtpd/parse.y index 1ae9b789db3..777673e4853 100644 --- a/usr.sbin/smtpd/parse.y +++ b/usr.sbin/smtpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.178 2015/12/28 22:08:30 jung Exp $ */ +/* $OpenBSD: parse.y,v 1.179 2016/01/04 13:30:20 jung Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org> @@ -2497,7 +2497,7 @@ create_filter_proc(char *name, char *prog) return (NULL); } - if (asprintf(&path, "%s/filter-%s", PATH_LIBEXEC_DEPRECATED, prog) == -1) { + if (asprintf(&path, "%s/filter-%s", PATH_LIBEXEC, prog) == -1) { yyerror("filter \"%s\" asprintf failed", name); return (0); } diff --git a/usr.sbin/smtpd/smtpd.c b/usr.sbin/smtpd/smtpd.c index 2fd69397bd4..dc77deb4c06 100644 --- a/usr.sbin/smtpd/smtpd.c +++ b/usr.sbin/smtpd/smtpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpd.c,v 1.269 2015/12/28 22:08:30 jung Exp $ */ +/* $OpenBSD: smtpd.c,v 1.270 2016/01/04 13:30:20 jung Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org> @@ -813,7 +813,7 @@ fork_proc_backend(const char *key, const char *conf, const char *procname) if (arg) *arg++ = '\0'; - if (snprintf(path, sizeof(path), PATH_LIBEXEC_DEPRECATED "/%s-%s", key, name) >= + if (snprintf(path, sizeof(path), PATH_LIBEXEC "/%s-%s", key, name) >= (ssize_t)sizeof(path)) { log_warn("warn: %s-proc: exec path too long", key); return (-1); diff --git a/usr.sbin/smtpd/smtpd.h b/usr.sbin/smtpd/smtpd.h index 13d78fb722b..a74b51c0641 100644 --- a/usr.sbin/smtpd/smtpd.h +++ b/usr.sbin/smtpd/smtpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpd.h,v 1.508 2015/12/13 11:06:13 gilles Exp $ */ +/* $OpenBSD: smtpd.h,v 1.509 2016/01/04 13:30:20 jung Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org> @@ -57,8 +57,7 @@ #define PATH_PURGE "/purge" #define PATH_TEMPORARY "/temporary" -#define PATH_LIBEXEC_DEPRECATED "/usr/libexec/smtpd" -#define PATH_LIBEXEC "/usr/local/libexec/smtpd:/usr/libexec/smtpd" +#define PATH_LIBEXEC "/usr/local/libexec/smtpd" /* diff --git a/usr.sbin/smtpd/table.c b/usr.sbin/smtpd/table.c index 143aceba001..21ee2372860 100644 --- a/usr.sbin/smtpd/table.c +++ b/usr.sbin/smtpd/table.c @@ -1,4 +1,4 @@ -/* $OpenBSD: table.c,v 1.22 2015/12/28 22:08:30 jung Exp $ */ +/* $OpenBSD: table.c,v 1.23 2016/01/04 13:30:20 jung Exp $ */ /* * Copyright (c) 2013 Eric Faurot <eric@openbsd.org> @@ -191,11 +191,8 @@ table_create(const char *backend, const char *name, const char *tag, { struct table *t; struct table_backend *tb; - char *ps; - char *p; char buf[LINE_MAX]; char path[LINE_MAX]; - char pathsplit[LINE_MAX]; size_t n; struct stat sb; @@ -211,25 +208,21 @@ table_create(const char *backend, const char *name, const char *tag, fatalx("table_create: table \"%s\" already defined", name); if ((tb = table_backend_lookup(backend)) == NULL) { - (void)strlcpy(pathsplit, PATH_LIBEXEC, sizeof pathsplit); - for (ps = pathsplit; (p = strsep(&ps, ":")) != NULL;) { - if ((size_t)snprintf(path, sizeof(path), "%s/table-%s", - p, backend) >= sizeof(path)) { - fatalx("table_create: path too long \"" - "%s/table-%s\"", p, backend); - } - if (stat(path, &sb) == 0) { - tb = table_backend_lookup("proc"); - (void)strlcpy(path, backend, sizeof(path)); - if (config) { - (void)strlcat(path, ":", sizeof(path)); - if (strlcat(path, config, sizeof(path)) - >= sizeof(path)) - fatalx("table_create: config file path too long"); - } - config = path; - break; + if ((size_t)snprintf(path, sizeof(path), PATH_LIBEXEC"/table-%s", + backend) >= sizeof(path)) { + fatalx("table_create: path too long \"" + PATH_LIBEXEC"/table-%s\"", backend); + } + if (stat(path, &sb) == 0) { + tb = table_backend_lookup("proc"); + (void)strlcpy(path, backend, sizeof(path)); + if (config) { + (void)strlcat(path, ":", sizeof(path)); + if (strlcat(path, config, sizeof(path)) + >= sizeof(path)) + fatalx("table_create: config file path too long"); } + config = path; } } |