aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGilles Chehade <gilles@poolp.org>2019-11-17 21:32:48 +0100
committerGilles Chehade <gilles@poolp.org>2019-11-17 21:32:48 +0100
commitc139eb1610e931739d6cde4194c9560124b08165 (patch)
tree8beb8e440b5745543b6c6a830e904538e12d6029
parentconditionally build progname (diff)
downloadOpenSMTPD-c139eb1610e931739d6cde4194c9560124b08165.tar.xz
OpenSMTPD-c139eb1610e931739d6cde4194c9560124b08165.zip
fix pledge() detection and fix argv on systems with setproctitle
-rw-r--r--configure.ac2
-rw-r--r--openbsd-compat/openbsd-compat.h5
-rw-r--r--smtpd/smtpd.c4
3 files changed, 3 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index 2febfdfb..354a80d0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -564,6 +564,7 @@ AC_CHECK_FUNCS([ \
nanosleep \
nsleep \
pidfile \
+ pledge \
reallocarray \
recallocarray \
res_hnok \
@@ -599,7 +600,6 @@ AC_CHECK_FUNCS([ \
warn \
warnx \
])
-AC_DEFINE([HAVE_PLEDGE], [0], [compat layer is not pledge ready])
AC_CHECK_DECL([strsep],
[AC_CHECK_FUNCS([strsep])],
diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h
index b59ac6e8..6c73e5b5 100644
--- a/openbsd-compat/openbsd-compat.h
+++ b/openbsd-compat/openbsd-compat.h
@@ -289,8 +289,6 @@ char * strndup(const char *, size_t);
char * strnlen(const char *, size_t);
#endif
-
-
#ifndef HAVE_STRUCT_TIMEVAL
struct timeval {
long tv_sec;
@@ -337,7 +335,4 @@ int usleep(unsigned int useconds);
char *get_progname(char *);
-
-
-
#endif /* _OPENBSD_COMPAT_H */
diff --git a/smtpd/smtpd.c b/smtpd/smtpd.c
index f7f711d5..662e103a 100644
--- a/smtpd/smtpd.c
+++ b/smtpd/smtpd.c
@@ -516,7 +516,7 @@ main(int argc, char *argv[])
char **save_argv = argv;
char *rexec = NULL;
struct smtpd *conf;
-
+
#ifndef HAVE___PROGNAME
__progname = ssh_get_progname(argv[0]);
#endif
@@ -532,11 +532,11 @@ main(int argc, char *argv[])
/* Prepare for later setproctitle emulation */
compat_init_setproctitle(argc, argv);
argv = saved_argv;
-#endif
/* this is to work around GNU getopt + portable setproctitle() fuckery */
save_argc = saved_argc;
save_argv = saved_argv;
+#endif
if ((conf = config_default()) == NULL)
err(1, NULL);