You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by so...@apache.org on 2005/09/19 22:22:37 UTC

svn commit: r290255 - /httpd/mod_smtpd/trunk/smtp_protocol.c

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);