[exim-dev] [patch] mime-decode problem log

Top Page
Delete this message
Reply to this message
Author: Komar A. Maxim
Date:  
To: exim-dev
Subject: [exim-dev] [patch] mime-decode problem log
I think this patch help solve problems, when directory or file for decoded
mime file can't be create (permision deny for example). I lost some time
with problem like that, and exim log not help me with this prolem :-)

--
Signature invent in progress 18% #.........
diff -ru exim-4.60/src/mime.c exim-4.60.komar.fix/src/mime.c
--- exim-4.60/src/mime.c    2006-01-14 10:55:28.000000000 +0200
+++ exim-4.60.komar.fix/src/mime.c    2006-01-14 14:19:33.000000000 +0200
@@ -328,7 +328,11 @@
       memset(&statbuf,0,sizeof(statbuf));


       /* assume either path or path+file name */
-      if ( (stat(CS option, &statbuf) == 0) && S_ISDIR(statbuf.st_mode) )
+      if (stat(CS option, &statbuf) != 0 && errno != ENOENT)
+        /* something wrong, abuse to log */
+        log_write(0, LOG_MAIN, "decode modifier warning - %s:[%d] %s",
+                  option, errno, strerror(errno));
+      else if ( S_ISDIR(statbuf.st_mode) )
         /* is directory, use it as decode_path */
         decode_file = mime_get_decode_file(option, NULL);
       else