Skip to content

Commit

Permalink
opensmtpd: revert non-retro-compatible 6.0.2p1 -> 6.0.3p1 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
Ekleog authored and obadz committed Jun 21, 2018
1 parent cec9192 commit 68e02f8
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 11 deletions.
10 changes: 5 additions & 5 deletions pkgs/servers/mail/opensmtpd/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@
# see also https://github.com/OpenSMTPD/OpenSMTPD/issues/678
, unpriviledged_smtpctl_encrypt ? true

# Deprecated: use the subaddressing-delimiter in the config file going forward
# This enables you to override the '+' character which typically separates the user from the tag in user+tag@domain.tld
, tag_char ? null
}:

stdenv.mkDerivation rec {
name = "opensmtpd-${version}";
version = "6.0.3p1";
version = "6.0.2p1";

nativeBuildInputs = [ autoconf automake libtool bison ];
buildInputs = [ libasr libevent zlib openssl db pam ];

src = fetchurl {
url = "https://www.opensmtpd.org/archives/${name}.tar.gz";
sha256 = "291881862888655565e8bbe3cfb743310f5dc0edb6fd28a889a9a547ad767a81";
sha256 = "1b4h64w45hpmfq5721smhg4s0shs64gbcjqjpx3fbiw4hz8bdy9a";
};

patches = [
./proc_path.diff
(fetchpatch {
url = "https://github.com/OpenSMTPD/OpenSMTPD/commit/725ba4fa2ddf23bbcd1ff9ec92e86bbfaa6825c8.diff";
sha256 = "19rla0b2r53jpdiz25fcza29c2msz6j6paivxhp9jcy1xl457dqa";
url = "https://github.com/Ekleog/OpenSMTPD/commit/80172fb0cd3c90c112bdd9c04fe05d84e6f562c6.diff";
sha256 = "1xgfm0mydhv70ndn212fsvlwaf3axl3wdg2v1nqnrbyl919y5a10";
})
];

Expand Down
37 changes: 31 additions & 6 deletions pkgs/servers/mail/opensmtpd/proc_path.diff
Original file line number Diff line number Diff line change
@@ -1,16 +1,41 @@
diff --git a/smtpd/parse.y b/smtpd/parse.y
index ab02719..c1c77d9 100644
--- a/smtpd/parse.y
+++ b/smtpd/parse.y
@@ -2534,13 +2534,19 @@ create_filter_proc(char *name, char *prog)
{
struct filter_conf *f;
char *path;
+ const char *proc_path;

if (dict_get(&conf->sc_filters, name)) {
yyerror("filter \"%s\" already defined", name);
return (NULL);
}

- if (asprintf(&path, "%s/filter-%s", PATH_LIBEXEC, prog) == -1) {
+ proc_path = getenv("OPENSMTPD_PROC_PATH");
+ if (proc_path == NULL) {
+ proc_path = PATH_LIBEXEC;
+ }
+
+ if (asprintf(&path, "%s/filter-%s", proc_path, prog) == -1) {
yyerror("filter \"%s\" asprintf failed", name);
return (0);
}
diff --git a/smtpd/smtpd.c b/smtpd/smtpd.c
index e049f07c..a1bd03a0 100644
index afc8891..9b0a80f 100644
--- a/smtpd/smtpd.c
+++ b/smtpd/smtpd.c
@@ -1157,6 +1157,7 @@ fork_proc_backend(const char *key, const char *conf, const char *procname)
@@ -795,6 +795,7 @@ fork_proc_backend(const char *key, const char *conf, const char *procname)
char path[PATH_MAX];
char name[PATH_MAX];
char *arg;
+ char *proc_path;

if (strlcpy(name, conf, sizeof(name)) >= sizeof(name)) {
log_warnx("warn: %s-proc: conf too long", key);
@@ -1167,7 +1168,12 @@ fork_proc_backend(const char *key, const char *conf, const char *procname)
@@ -805,7 +806,12 @@ fork_proc_backend(const char *key, const char *conf, const char *procname)
if (arg)
*arg++ = '\0';

Expand All @@ -25,18 +50,18 @@ index e049f07c..a1bd03a0 100644
log_warn("warn: %s-proc: exec path too long", key);
return (-1);
diff --git a/smtpd/table.c b/smtpd/table.c
index 9cfdfb99..24dfcca4 100644
index 21ee237..95b5164 100644
--- a/smtpd/table.c
+++ b/smtpd/table.c
@@ -201,6 +201,7 @@ table_create(const char *backend, const char *name, const char *tag,
@@ -193,6 +193,7 @@ table_create(const char *backend, const char *name, const char *tag,
struct table_backend *tb;
char buf[LINE_MAX];
char path[LINE_MAX];
+ const char *proc_path;
size_t n;
struct stat sb;

@@ -215,11 +216,16 @@ table_create(const char *backend, const char *name, const char *tag,
@@ -207,11 +208,16 @@ table_create(const char *backend, const char *name, const char *tag,
if (name && table_find(name, NULL))
fatalx("table_create: table \"%s\" already defined", name);

Expand Down

0 comments on commit 68e02f8

Please sign in to comment.