Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: cec9192c6d3e
Choose a base ref
...
head repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 68e02f8ff216
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Jun 21, 2018

  1. Copy the full SHA
    68e02f8 View commit details
Showing with 36 additions and 11 deletions.
  1. +5 −5 pkgs/servers/mail/opensmtpd/default.nix
  2. +31 −6 pkgs/servers/mail/opensmtpd/proc_path.diff
10 changes: 5 additions & 5 deletions pkgs/servers/mail/opensmtpd/default.nix
Original file line number Diff line number Diff line change
@@ -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";
})
];

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';

@@ -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);