From b9bfd810a74c2a71cd4ae67dfc51c10b6da38fe9 Mon Sep 17 00:00:00 2001 From: Jason Tibbitts Date: May 25 2017 15:33:34 +0000 Subject: Add source files/patches. --- diff --git a/cassandane-redirect-syslog.c b/cassandane-redirect-syslog.c new file mode 100644 index 0000000..37ad53e --- /dev/null +++ b/cassandane-redirect-syslog.c @@ -0,0 +1,17 @@ +/* This is used to build an LD_PRELOAD library to redirect syslog calls. */ + +#include +#include +#include + +void openlog(const char *ident, int option, int facility) { return; } +void closelog(void) { return; } + +void syslog(int priority, const char *format, ...) { + va_list va; + va_start(va, format); + vfprintf(stderr, format, va); + va_end(va); +} + + diff --git a/patch-cassandane-no-syslog b/patch-cassandane-no-syslog new file mode 100644 index 0000000..67d30b3 --- /dev/null +++ b/patch-cassandane-no-syslog @@ -0,0 +1,21 @@ +diff --git a/Cassandane/Util/Log.pm b/Cassandane/Util/Log.pm +index 9cd93d5..8d3b3c1 100644 +--- a/Cassandane/Util/Log.pm ++++ b/Cassandane/Util/Log.pm +@@ -52,16 +52,12 @@ our @EXPORT = qw( + + my $verbose = 0; + +-openlog('cassandane', '', LOG_LOCAL6) +- or die "Cannot openlog"; +- + sub xlog + { + my ($pkg, $file, $line) = caller; + $pkg =~ s/^Cassandane:://; + my $msg = "=====> " . $pkg . "[" . $line . "] " . join(' ', @_); + print STDERR "$msg\n"; +- syslog(LOG_ERR, "$msg"); + } + + sub set_verbose diff --git a/patch-neuter-become-cyrus b/patch-neuter-become-cyrus new file mode 100644 index 0000000..ecfe06e --- /dev/null +++ b/patch-neuter-become-cyrus @@ -0,0 +1,29 @@ +diff --git a/lib/util.c b/lib/util.c +index 62ad7bd..37f0463 100644 +--- a/lib/util.c ++++ b/lib/util.c +@@ -605,7 +605,7 @@ EXPORTED int become_cyrus(int is_master) + p = getpwnam(cyrus); + if (p == NULL) { + syslog(LOG_ERR, "no entry in /etc/passwd for user %s", cyrus); +- return -1; ++ return 0; + } + + /* Save these in case initgroups does a getpw*() */ +@@ -625,13 +625,13 @@ EXPORTED int become_cyrus(int is_master) + if (initgroups(cyrus, newgid)) { + syslog(LOG_ERR, "unable to initialize groups for user %s: %s", + cyrus, strerror(errno)); +- return -1; ++ return 0; + } + + if (setgid(newgid)) { + syslog(LOG_ERR, "unable to set group id to %d for user %s: %s", + newgid, cyrus, strerror(errno)); +- return -1; ++ return 0; + } + + result = cap_setuid(newuid, is_master);