summaryrefslogtreecommitdiff
path: root/ext/standard/mail.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2003-09-11 04:46:10 +0000
committerIlia Alshanetsky <iliaa@php.net>2003-09-11 04:46:10 +0000
commitf3f3b772b28e5565928c02ec8c98d96865036165 (patch)
tree73d8bf078cfc1c0e4eddbd3689bec7258739b974 /ext/standard/mail.c
parent1c30f5bcf00eae40435d0a4ef4abe1bb21393a7e (diff)
downloadphp-git-f3f3b772b28e5565928c02ec8c98d96865036165.tar.gz
Cleanup r1.76 patch
Diffstat (limited to 'ext/standard/mail.c')
-rw-r--r--ext/standard/mail.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/ext/standard/mail.c b/ext/standard/mail.c
index df95c60266..0585be99a7 100644
--- a/ext/standard/mail.c
+++ b/ext/standard/mail.c
@@ -201,21 +201,25 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char
/* make sure that sendmail_path contains a valid executable, failure to do
* would make PHP abruptly exit without a useful error message. */
{
- char *s=NULL, p;
+ char *s=NULL, *p;
if ((s = strchr(sendmail_path, ' '))) {
- p = *s;
- *s = '\0';
+ p = estrndup(sendmail_path, s - sendmail_path);
+ } else {
+ p = sendmail_path;
}
- if (access(sendmail_path, X_OK)) {
+ if (VCWD_ACCESS(p, 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 (extra_cmd != NULL) {
+ efree(sendmail_cmd);
+ }
if (s) {
- *s = p;
+ efree(p);
}
return 0;
}
if (s) {
- *s = p;
+ efree(p);
}
}