From bcdd8acdf2aba066a5aa21a3ff92a5c229adae08 Mon Sep 17 00:00:00 2001 From: Gilles Chehade Date: Tue, 1 Dec 2020 00:21:02 +0100 Subject: Revert "use get_progname() to fix proctitle" This reverts commit 032ce80372d31b595c95281aa582fdc1e62d2821. --- usr.sbin/smtpd/smtpd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/smtpd/smtpd.c b/usr.sbin/smtpd/smtpd.c index 45e37c33..ad0ebdea 100644 --- a/usr.sbin/smtpd/smtpd.c +++ b/usr.sbin/smtpd/smtpd.c @@ -521,7 +521,7 @@ main(int argc, char *argv[]) struct smtpd *conf; #ifndef HAVE___PROGNAME - __progname = get_progname(argv[0]); + __progname = ssh_get_progname(argv[0]); #endif #ifndef HAVE_SETPROCTITLE -- cgit v1.2.3-59-g8ed1b From 83e2d3cdbbae18026a4e51c70ee08b4db88fb113 Mon Sep 17 00:00:00 2001 From: Ihor Antonov Date: Mon, 30 Nov 2020 15:22:32 -0800 Subject: Remove broken link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ce5f1a3e..91b8cfb7 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![Coverity Scan analysis](https://scan.coverity.com/projects/278/badge.svg)](https://scan.coverity.com/projects/opensmtpd-opensmtpd) [![Packaging status](https://repology.org/badge/tiny-repos/opensmtpd.svg)](https://repology.org/project/opensmtpd/versions) [![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://www.isc.org/licenses/) -[![Clang Analysis](https://opensmtpd.email/reports/clang/badge.svg)](https://opensmtpd.email/reports/clang/index.html) + OpenSMTPD is a FREE implementation of the server-side SMTP protocol as -- cgit v1.2.3-59-g8ed1b From 53f0cdf454449c1e0bd7441bdb9992a49012428d Mon Sep 17 00:00:00 2001 From: Ihor Antonov Date: Mon, 30 Nov 2020 15:23:37 -0800 Subject: Update version badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 91b8cfb7..bc35c16b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # OpenSMTPD -[![Version](https://img.shields.io/badge/Version-6.6.3p1-brihtgreen.svg)](https://github.com/OpenSMTPD/OpenSMTPD/releases/tag/6.6.3p1) +[![Version](https://img.shields.io/badge/Version-6.7.1p1-brihtgreen.svg)](https://github.com/OpenSMTPD/OpenSMTPD/releases/tag/6.7.1p1) [![Coverity Scan analysis](https://scan.coverity.com/projects/278/badge.svg)](https://scan.coverity.com/projects/opensmtpd-opensmtpd) [![Packaging status](https://repology.org/badge/tiny-repos/opensmtpd.svg)](https://repology.org/project/opensmtpd/versions) [![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://www.isc.org/licenses/) -- cgit v1.2.3-59-g8ed1b From e94cc12211d1fbbd52bc4c50c3e530342d3e95ee Mon Sep 17 00:00:00 2001 From: Gilles Chehade Date: Tue, 1 Dec 2020 23:41:34 +0100 Subject: fix get_progname() and setproctitle() detection --- configure.ac | 4 ++++ openbsd-compat/openbsd-compat.h | 2 +- openbsd-compat/setproctitle.c | 5 +---- usr.sbin/smtpd/smtpd.c | 9 +++++---- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 28f1be1f..d46aeae7 100644 --- a/configure.ac +++ b/configure.ac @@ -2046,6 +2046,10 @@ AM_CONDITIONAL([NEED_PROGNAME], [test "x$ac_cv_libc_defines___progname" != "xyes ## +AM_COND_IF([NEED_PROGNAME], [AC_DEFINE([NEED_PROGNAME], [1], [Define to 1 if NEED_PROGNAME])]) +AM_COND_IF([NEED_SETPROCTITLE], [AC_DEFINE([NEED_SETPROCTITLE], [1], [Define to 1 if NEED_SETPROCTITLE])]) + + AC_CONFIG_FILES([Makefile openbsd-compat/Makefile mk/Makefile diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h index ec0ae516..dcb643f1 100644 --- a/openbsd-compat/openbsd-compat.h +++ b/openbsd-compat/openbsd-compat.h @@ -96,7 +96,7 @@ const char *inet_ntop(int af, const void *src, char *dst, socklen_t size); char *strsep(char **stringp, const char *delim); #endif -#ifndef HAVE_SETPROCTITLE +#ifdef NEED_SETPROCTITLE void setproctitle(const char *fmt, ...); void compat_init_setproctitle(int argc, char *argv[]); #endif diff --git a/openbsd-compat/setproctitle.c b/openbsd-compat/setproctitle.c index eef70c14..71e1595e 100644 --- a/openbsd-compat/setproctitle.c +++ b/openbsd-compat/setproctitle.c @@ -68,8 +68,7 @@ static size_t argv_env_len = 0; void compat_init_setproctitle(int argc, char *argv[]) { -#if !defined(HAVE_SETPROCTITLE) && \ - defined(SPT_TYPE) && SPT_TYPE == SPT_REUSEARGV +#if defined(SPT_TYPE) && SPT_TYPE == SPT_REUSEARGV extern char **environ; char *lastargv = NULL; char **envp = environ; @@ -156,8 +155,6 @@ setproctitle(const char *fmt, ...) pst.pst_command = ptitle; pstat(PSTAT_SETCMD, pst, strlen(ptitle), 0, 0); #elif SPT_TYPE == SPT_REUSEARGV -/* debug("setproctitle: copy \"%s\" into len %d", - buf, argv_env_len); */ len = strlcpy(argv_start, ptitle, argv_env_len); for(; len < argv_env_len; len++) argv_start[len] = SPT_PADCHAR; diff --git a/usr.sbin/smtpd/smtpd.c b/usr.sbin/smtpd/smtpd.c index ad0ebdea..9307fc3b 100644 --- a/usr.sbin/smtpd/smtpd.c +++ b/usr.sbin/smtpd/smtpd.c @@ -520,11 +520,11 @@ main(int argc, char *argv[]) char *rexec = NULL; struct smtpd *conf; -#ifndef HAVE___PROGNAME - __progname = ssh_get_progname(argv[0]); +#ifdef NEED_PROGNAME + __progname = get_progname(argv[0]); #endif + __progname = xstrdup(__progname); -#ifndef HAVE_SETPROCTITLE /* Save argv. Duplicate so setproctitle emulation doesn't clobber it */ saved_argc = argc; saved_argv = xcalloc(argc + 1, sizeof(*saved_argv)); @@ -532,14 +532,15 @@ main(int argc, char *argv[]) saved_argv[i] = xstrdup(argv[i]); saved_argv[i] = NULL; +#ifdef NEED_SETPROCTITLE /* 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); -- cgit v1.2.3-59-g8ed1b From de08d76923fdb779c53c01191a4ab3ac18e33024 Mon Sep 17 00:00:00 2001 From: Gilles Chehade Date: Tue, 1 Dec 2020 23:58:21 +0100 Subject: proper get_progname use in smtpctl --- usr.sbin/smtpd/smtpctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/smtpd/smtpctl.c b/usr.sbin/smtpd/smtpctl.c index b255ed3d..1cc37994 100644 --- a/usr.sbin/smtpd/smtpctl.c +++ b/usr.sbin/smtpd/smtpctl.c @@ -1066,8 +1066,8 @@ main(int argc, char **argv) int privileged; char *argv_mailq[] = { "show", "queue", NULL }; -#ifndef HAVE___PROGNAME - __progname = ssh_get_progname(argv[0]); +#ifdef NEED_PROGNAME + __progname = get_progname(argv[0]); #endif /* check that smtpctl was installed setgid */ -- cgit v1.2.3-59-g8ed1b