Gitweb:
https://git.exim.org/exim.git/commitdiff/6ede5516b1b75fcbdea965a07240c3d4d02e081a
Commit: 6ede5516b1b75fcbdea965a07240c3d4d02e081a
Parent: 74e249ac9bb950420f90c770850998a0337f14fc
Author: Jeremy Harris <jgh146exb@???>
AuthorDate: Sat Jun 5 20:47:12 2021 +0100
Committer: Jeremy Harris <jgh146exb@???>
CommitDate: Sat Jun 5 20:47:12 2021 +0100
Fix SSL creds file watching on kevent platforms (BSDs) for symlinks
---
src/src/tls.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/src/src/tls.c b/src/src/tls.c
index e073ead..3de417e 100644
--- a/src/src/tls.c
+++ b/src/src/tls.c
@@ -158,8 +158,8 @@ return FALSE;
# endif
# ifdef EXIM_HAVE_KEVENT
{
-uschar * s;
-int fd1, fd2, i, cnt = 0;
+uschar * s, * t;
+int fd1, fd2, i, j, cnt = 0;
struct stat sb;
#ifdef OpenBSD
struct kevent k_dummy;
@@ -209,11 +209,14 @@ for (;;)
if (!(S_ISLNK(sb.st_mode))) break;
- s = store_get(1024, FALSE);
- if ((i = readlink(CCS filename, (void *)s, 1024)) < 0) { s = US"readlink"; goto bad; }
- filename = s;
- *(s += i) = '\0';
- store_release_above(s+1);
+ t = store_get(1024, FALSE);
+ Ustrncpy(t, s, 1022);
+ j = Ustrlen(s);
+ t[j++] = '/';
+ if ((i = readlink(CCS filename, (void *)(t+j), 1023-j)) < 0) { s = US"readlink"; goto bad; }
+ filename = t;
+ *(t += i+j) = '\0';
+ store_release_above(t+1);
}
#ifdef OpenBSD