aboutsummaryrefslogtreecommitdiff
path: root/security/courier-authlib/files/patch-libs_liblock_locktest.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/courier-authlib/files/patch-libs_liblock_locktest.c')
-rw-r--r--security/courier-authlib/files/patch-libs_liblock_locktest.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/security/courier-authlib/files/patch-libs_liblock_locktest.c b/security/courier-authlib/files/patch-libs_liblock_locktest.c
new file mode 100644
index 000000000000..a55b4bcfac39
--- /dev/null
+++ b/security/courier-authlib/files/patch-libs_liblock_locktest.c
@@ -0,0 +1,38 @@
+--- libs/liblock/locktest.c.orig 2014-07-13 13:58:08 UTC
++++ libs/liblock/locktest.c
+@@ -3,6 +3,7 @@
+ ** distribution information.
+ */
+
++#include <paths.h>
+ #include "liblock.h"
+ #if USE_FCNTL
+ #include "lockfcntl.c"
+@@ -20,7 +21,7 @@
+
+ int main()
+ {
+-#define FILENAME "courier-imap.locktest.XXXXXXXXXX"
++#define FILENAME "courier-authlib.locktest.XXXXXXXXXX"
+ int fd[2];
+ pid_t p;
+ int s;
+@@ -29,7 +30,7 @@ int f;
+ char *name;
+ const char *tmpdir;
+ if ((tmpdir = (char *)getenv("TMPDIR")) == NULL || !*tmpdir)
+- tmpdir = "/tmp";
++ tmpdir = _PATH_TMP;
+
+ if ((name=malloc(strlen(tmpdir)+sizeof(FILENAME)+1)) == NULL)
+ {
+@@ -37,7 +38,8 @@ int f;
+ exit(1);
+ }
+
+- (void)sprintf(name, "%s/%s", tmpdir, FILENAME);
++ (void)sprintf(name, "%s%s%s", tmpdir,
++ (tmpdir[strlen(tmpdir) - 1] == '/') ? "" : "/", FILENAME);
+
+ signal(SIGCHLD, SIG_DFL);
+ if (pipe(fd))