Call initgroups() when dropping privilege, in order that Exim runs with
[exim.git] / src / src / mime.c
index 486fd3d1f9822b7edc78bd300929dab195ebf32e..c215b7bcf159d430f6f631a34a2b6fb2a4ab92a2 100644 (file)
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/mime.c,v 1.12 2005/08/16 12:32:32 tom Exp $ */
+/* $Cambridge: exim/src/src/mime.c,v 1.14 2006/02/22 14:46:44 ph10 Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -241,10 +241,10 @@ FILE *mime_get_decode_file(uschar *pname, uschar *fname) {
 
   if ((pname != NULL) && (fname != NULL)) {
     (void)string_format(filename, 2048, "%s/%s", pname, fname);
-    f = fopen(CS filename,"wb+");
+    f = modefopen(filename,"wb+",SPOOL_MODE);
   }
   else if (pname == NULL) {
-    f = fopen(CS fname,"wb+");
+    f = modefopen(fname,"wb+",SPOOL_MODE);
   }
   else if (fname == NULL) {
     int file_nr = 0;
@@ -261,7 +261,7 @@ FILE *mime_get_decode_file(uschar *pname, uschar *fname) {
       result = stat(CS filename,&mystat);
     }
     while(result != -1);
-    f = fopen(CS filename,"wb+");
+    f = modefopen(filename,"wb+",SPOOL_MODE);
   };
 
   /* set expansion variable */
@@ -619,7 +619,7 @@ int mime_acl_check(uschar *acl, FILE *f, struct mime_boundary_context *context,
                 memset(param_value,0,param_value_len+1);
                 q = p + mime_parameter_list[j].namelen;
                 Ustrncpy(param_value, q, param_value_len);
-                param_value = rfc2047_decode(param_value, TRUE, NULL, 32, &param_value_len, &q);
+                param_value = rfc2047_decode(param_value, check_rfc2047_length, NULL, 32, &param_value_len, &q);
                 debug_printf("Found %s MIME parameter in %s header, value is '%s'\n", mime_parameter_list[j].name, mime_header_list[i].name, param_value);
                 *((uschar **)(mime_parameter_list[j].value)) = param_value;
                 p += (mime_parameter_list[j].namelen + param_value_len + 1);