httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From soc-r...@apache.org
Subject svn commit: r290255 - /httpd/mod_smtpd/trunk/smtp_protocol.c
Date Mon, 19 Sep 2005 20:22:37 GMT
Author: soc-rian
Date: Mon Sep 19 13:22:33 2005
New Revision: 290255

URL: http://svn.apache.org/viewcvs?rev=290255&view=rev
Log:
Made location of spool file more portable with a call into apr, patch submitted
by: Garrett Rooney, rooneg@electricjellyfish.net.

Modified:
    httpd/mod_smtpd/trunk/smtp_protocol.c

Modified: httpd/mod_smtpd/trunk/smtp_protocol.c
URL: http://svn.apache.org/viewcvs/httpd/mod_smtpd/trunk/smtp_protocol.c?rev=290255&r1=290254&r2=290255&view=diff
==============================================================================
--- httpd/mod_smtpd/trunk/smtp_protocol.c (original)
+++ httpd/mod_smtpd/trunk/smtp_protocol.c Mon Sep 19 13:22:33 2005
@@ -500,7 +500,7 @@
     int rv, retval = 0, saw_eos = 0;
     char *tempfile;
     char our_buffer[BUFFER_STR_LEN];
-    const char *string;
+    const char *string, *tempdir;
     apr_file_t *tfp;
     apr_size_t len, total_data = 0;
     apr_bucket_brigade *bb;
@@ -555,8 +555,14 @@
         smtpd_respond_oneline(scr, 503, "Error: need RCPT command");
         return 503;
     }
-    
-    tempfile = apr_pstrdup(str->p, "/tmp/tmp.XXXXXX");
+
+    rv = apr_temp_dir_get(&tempdir, str->p);
+    if (rv) {
+        smtpd_respond_oneline(scr, 421, "Error: Internal");
+        return 0;
+    }
+
+    tempfile = apr_psprintf(str->p, "%s/tmp.XXXXXX", tempdir);
     rv = apr_file_mktemp(&tfp, tempfile,
                          APR_CREATE | APR_WRITE | APR_READ |
                          APR_DELONCLOSE, scr->p);



Mime
View raw message