cvs: php-src /ext/standard mail.c
| From: | Ilia Alshanetsky | Date: | Mon, 08 Sep 2003 20:15:36 +0000 |
| Subject: | cvs: php-src /ext/standard mail.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-23693@lists.php.net to get a copy of this message | ||
iliaa Mon Sep 8 16:15:36 2003 EDT
Modified files:
/php-src/ext/standard mail.c
Log:
Re-enable sendmail binary check, now with parameter detection.
Index: php-src/ext/standard/mail.c
diff -u php-src/ext/standard/mail.c:1.75 php-src/ext/standard/mail.c:1.76
--- php-src/ext/standard/mail.c:1.75 Mon Sep 1 04:20:17 2003
+++ php-src/ext/standard/mail.c Mon Sep 8 16:15:35 2003
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mail.c,v 1.75 2003/09/01 08:20:17 stas Exp $ */
+/* $Id: mail.c,v 1.76 2003/09/08 20:15:35 iliaa Exp $ */
#include <stdlib.h>
#include <ctype.h>
@@ -200,11 +200,24 @@
#else
/* make sure that sendmail_path contains a valid executable, failure to do
* would make PHP abruptly exit without a useful error message. */
-/* if (access(sendmail_path, X_OK)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Permission denied: unable to execute shell to
run mail delivery binary '%s'", sendmail_path);
- return 0;
+ {
+ char *s=NULL, p;
+
+ if ((s = strchr(sendmail_path, ' '))) {
+ p = *s;
+ *s = '\0';
+ }
+ if (access(sendmail_path, X_OK)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Permission denied: unable to execute shell to
run mail delivery binary '%s'", sendmail_path);
+ if (s) {
+ *s = p;
+ }
+ return 0;
+ }
+ if (s) {
+ *s = p;
+ }
}
-*/
/* Since popen() doesn't indicate if the internal fork() doesn't work
* (e.g. the shell can't be executed) we explicitely set it to 0 to be