[exim-dev] [Bug 2507] dlerror() incorrectly called twice thu…

Top Page
Delete this message
Reply to this message
Author: admin
Date:  
To: exim-dev
Old-Topics: [exim-dev] [Bug 2507] New: dlerror() incorrectly called twice thus loosing error information in logs
Subject: [exim-dev] [Bug 2507] dlerror() incorrectly called twice thus losing error information in logs
https://bugs.exim.org/show_bug.cgi?id=2507

--- Comment #2 from Git Commit <git@???> ---
Git commit:
https://git.exim.org/exim.git/commitdiff/3fc07bd5708d5b42e5a9a3bcf7ea1928a35eccb3

commit 3fc07bd5708d5b42e5a9a3bcf7ea1928a35eccb3
Author:     Arkadiusz Miskiewicz <arekm@???>
AuthorDate: Wed Jan 8 16:43:46 2020 +0000
Commit:     Jeremy Harris <jgh146exb@???>
CommitDate: Wed Jan 8 16:46:54 2020 +0000


    Fix error logging for dynamically-loaded modules.  Bug 2507
---
 src/src/drtables.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)


diff --git a/src/src/drtables.c b/src/src/drtables.c
index 5583590..b1380df 100644
--- a/src/src/drtables.c
+++ b/src/src/drtables.c
@@ -753,10 +753,10 @@ else

       if (!(dl = dlopen(CS big_buffer, RTLD_NOW)))
     {
-    errormessage = dlerror();
-    fprintf(stderr, "Error loading %s: %s\n", name, errormessage);
+    errormsg = dlerror();
+    fprintf(stderr, "Error loading %s: %s\n", name, errormsg);
+    log_write(0, LOG_MAIN|LOG_PANIC, "Error loading lookup module %s: %s\n",
name, errormsg);
     moduleerrors++;
-    log_write(0, LOG_MAIN|LOG_PANIC, "Error loading lookup module %s: %s\n",
name, errormessage);
     continue;
     }


@@ -771,17 +771,17 @@ else
       if ((errormsg = dlerror()))
     {
     fprintf(stderr, "%s does not appear to be a lookup module (%s)\n", name,
errormsg);
+    log_write(0, LOG_MAIN|LOG_PANIC, "%s does not appear to be a lookup module
(%s)\n", name, errormsg);
     dlclose(dl);
     moduleerrors++;
-    log_write(0, LOG_MAIN|LOG_PANIC, "%s does not appear to be a lookup module
(%s)\n", name, errormsg);
     continue;
     }
       if (info->magic != LOOKUP_MODULE_INFO_MAGIC)
     {
     fprintf(stderr, "Lookup module %s is not compatible with this version of
Exim\n", name);
+    log_write(0, LOG_MAIN|LOG_PANIC, "Lookup module %s is not compatible with
this version of Exim\n", name);
     dlclose(dl);
     moduleerrors++;
-    log_write(0, LOG_MAIN|LOG_PANIC, "Lookup module %s is not compatible with
this version of Exim\n", name);
     continue;
     }


--
You are receiving this mail because:
You are on the CC list for the bug.