Req #44972 [Com]: Feature Request: overriding sys_get_tmp_dir

2010-09-06 Thread brian at macserve dot net
Edit report at http://bugs.php.net/bug.php?id=44972&edit=1

 ID: 44972
 Comment by: brian at macserve dot net
 Reported by:timtowdi at yahoo dot com
 Summary:Feature Request: overriding sys_get_tmp_dir
 Status: Open
 Type:   Feature/Change Request
 Package:Feature/Change Request
 Operating System:   FreeBSD
 PHP Version:5.2.6
 Block user comment: N

 New Comment:

1. the suggested php.ini setting for "uploaded files" has ZERO effect on
the original requestors report. the directory returned by the
sys_get_tmp_dir() function cannot be overriden from within PHP or
php.ini; only where uploaded files are placed can be overridden which
only coincidentally is the same when you do NOT define upload_tmp_dir in
php.ini.



the original request stands as a valid critique.





2. your url is missing an "el" at the end of manual.

corrected:

http://www.php.net/manual/en/ini.core.php#ini.upload-tmp-dir





3. The security environment of the original request is interesting and
perhaps up for debate, but is not relevant to this discussion.



There may be valid technical reasons for locating TMPDIR for PHP to
another location other than the TMPDIR environment variable that comes
into Apache. Perhaps temp files for PHP need to live on a different disk
for performance and/or security reasons.



Being able to define this with a php.ini setting is completely
reasonable.





4. Sorry to be a noodge, but this request over 2 years old and not
resolved?



./main/php_open_temporary_file.c : php_get_temporary_directory() needs
just a little bit of code it looks like.



Thanks!


Previous Comments:

[2008-05-12 15:46:49] paj...@php.net

One is already possible:



http://www.php.net/manua/en/ini.core.php#ini.upload-tmp-dir



About the temp directory, you will have to teach your ISP how to
configure php correctly. Not having the tmp dir in the open_basedir
lists (and having only one global tmp dir instead of per user) is so
wrong.



However a temp_dir ini setting (settable per vhost) would be nice. Let
see what's the other say (I'm not a fan of ENV variables ;).


[2008-05-12 15:30:47] timtowdi at yahoo dot com

Description:

On a server with open_basedir in effect, sys_get_temp_dir() still uses
the default TMPDIR environment variable (which in this case is '/tmp'). 
This effectively renders sys_get_temp_dir useless for me, and there is
no way to override it.



It would be EXTREMELY useful to be able to set the default temp
directory from an ini directive, such as the session temp dir and the
uploaded files temp dir.







-- 
Edit this bug report at http://bugs.php.net/bug.php?id=44972&edit=1


#35906 [NEW]: Date Header produces non-RFC date

2006-01-05 Thread brian at macserve dot net
From: brian at macserve dot net
Operating system: OS X
PHP version:  4.4.1
PHP Bug Type: Mail related
Bug description:  Date Header produces non-RFC date

Description:

The Date header that is generated in the mail() command is not RFC
compliant in that it generates 2 spaces right before the day of the month,
when there should only be one.

This trips spam filters that are looking for sloppy programming by
spammers.

Interstingly, date('r') produces a correctly spaced date:
Thu, 05 Jan 2006 08:51:13 -0600

Probably because the day of month is padded.

line 716 from 4.4.1's sendmail.c:
sprintf(header_buffer, "Date: %s, %02d %s %04d %02d:%02d:%02d
%s%02d%02d\r\n",


Looks like this was fixed in the 5.x branch by changing this to
effectively use: date('r') in response to bug # 29334

line 706:
char *dt = php_format_date("r", 1, tNow, 1 TSRMLS_CC);
sprintf(header_buffer, "Date: %s\r\n", dt);




Reproduce code:
---
$toAddress = '[EMAIL PROTECTED]';
$fromAddress = '[EMAIL PROTECTED]';
$extraParams = '-f'.$fromAddress;
$subj = 'Test Date Hdr';
$emailMsg = 'Test Message';
echo mail($toAddress, $subj, $emailMsg, '', $extraParams);


Expected result:

Date: Thu, 5 Jan 2006 08:51:03 -0600 (CST)


Actual result:
--
Date: Thu,  5 Jan 2006 08:51:03 -0600 (CST)


-- 
Edit bug report at http://bugs.php.net/?id=35906&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=35906&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=35906&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=35906&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=35906&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=35906&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=35906&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=35906&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=35906&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=35906&r=support
Expected behavior:http://bugs.php.net/fix.php?id=35906&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=35906&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=35906&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35906&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=35906&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35906&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=35906&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=35906&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=35906&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=35906&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=35906&r=mysqlcfg


#35906 [Fbk->Opn]: Date Header produces non-RFC date (works with PHP 5.1)

2006-01-05 Thread brian at macserve dot net
 ID:   35906
 User updated by:  brian at macserve dot net
 Reported By:  brian at macserve dot net
-Status:   Feedback
+Status:   Open
 Bug Type: Mail related
 Operating System: Windows
 PHP Version:  4.4.1
 New Comment:

I don't have Windows either.

I was seeing this under Mac OS 10.3.9 (Postfix/sendmail), so looking at
the code and the bug fixes told me it was still around.

I guess it's Postfix fixup that is the culprit here.

2 Questions:

1. What logic was applied that determined that *nix PHP can't  utilize
the SMTP engine that is present in Win32PHP?

2. For consistency sake, wouldn't it be better to have the code for
outputting messages across the same platforms do the same thing
regardless of final SMTP chain injection method?

As in, the same code that is used to detect/add Date: headers (in the
proper format) should be used on messages submitted through mail() on
ALL platforms.

This should have zero effect on *nix platforms as the "sendmail"
emulators shouldn't add another Date header, if already present.


Brian


Previous Comments:


[2006-01-06 01:36:20] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

I just committed a fix for this. Please test in about 6 hours.



[2006-01-05 23:15:50] [EMAIL PROTECTED]

I am not the maintainer of Win32 mail code, I don't even have windows
so I can't test this. This is not a problem on any other OS than
Windows either, as that doesn't use the sendmail.c code.



[2006-01-05 21:33:38] [EMAIL PROTECTED]

Assigned to the maintainer.

----------------

[2006-01-05 16:27:17] brian at macserve dot net

Description:

The Date header that is generated in the mail() command is not RFC
compliant in that it generates 2 spaces right before the day of the
month, when there should only be one.

This trips spam filters that are looking for sloppy programming by
spammers.

Interstingly, date('r') produces a correctly spaced date:
Thu, 05 Jan 2006 08:51:13 -0600

Probably because the day of month is padded.

line 716 from 4.4.1's sendmail.c:
sprintf(header_buffer, "Date: %s, %02d %s %04d %02d:%02d:%02d
%s%02d%02d\r\n",


Looks like this was fixed in the 5.x branch by changing this to
effectively use: date('r') in response to bug # 29334

line 706:
char *dt = php_format_date("r", 1, tNow, 1 TSRMLS_CC);
sprintf(header_buffer, "Date: %s\r\n", dt);




Reproduce code:
---
$toAddress = '[EMAIL PROTECTED]';
$fromAddress = '[EMAIL PROTECTED]';
$extraParams = '-f'.$fromAddress;
$subj = 'Test Date Hdr';
$emailMsg = 'Test Message';
echo mail($toAddress, $subj, $emailMsg, '', $extraParams);


Expected result:

Date: Thu, 5 Jan 2006 08:51:03 -0600 (CST)


Actual result:
--
Date: Thu,  5 Jan 2006 08:51:03 -0600 (CST)






-- 
Edit this bug report at http://bugs.php.net/?id=35906&edit=1


#35906 [Csd]: Date Header produces non-RFC date (works with PHP 5.1)

2006-01-05 Thread brian at macserve dot net
 ID:  35906
 User updated by: brian at macserve dot net
 Reported By: brian at macserve dot net
 Status:  Closed
 Bug Type:Mail related
 PHP Version: 4.4.1
 New Comment:

I understand that this is now fixed under Windows.

My extended comments were stating that the the real culprit for MY
particular issue with this was being caused by Postfix.

Since the mail() command calls the "sendmail" binary to submit a new
email message, it's not PHP's fault that Postfix is creating a non-RFC
compliant Date header.

I THOUGHT is was PHP's fault and investigating it brought the issue for
Windows mail() code to light.

My other questions still stand as to improving the intelligence of the
mail() command under non-Windows systems so as to create as close to
parity in calling mail() across all platforms.

Why does the Windows code only get the Date header checking code, when
the non-Windows code would benefit just as greatly.


Previous Comments:


[2006-01-06 02:13:26] [EMAIL PROTECTED]

I don't know what you're talking about, but the sendmail.c you pointed
at is only used within Windows. And that part is now fixed.

--------

[2006-01-06 01:59:56] brian at macserve dot net

I don't have Windows either.

I was seeing this under Mac OS 10.3.9 (Postfix/sendmail), so looking at
the code and the bug fixes told me it was still around.

I guess it's Postfix fixup that is the culprit here.

2 Questions:

1. What logic was applied that determined that *nix PHP can't  utilize
the SMTP engine that is present in Win32PHP?

2. For consistency sake, wouldn't it be better to have the code for
outputting messages across the same platforms do the same thing
regardless of final SMTP chain injection method?

As in, the same code that is used to detect/add Date: headers (in the
proper format) should be used on messages submitted through mail() on
ALL platforms.

This should have zero effect on *nix platforms as the "sendmail"
emulators shouldn't add another Date header, if already present.


Brian



[2006-01-06 01:36:20] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

I just committed a fix for this. Please test in about 6 hours.



[2006-01-05 23:15:50] [EMAIL PROTECTED]

I am not the maintainer of Win32 mail code, I don't even have windows
so I can't test this. This is not a problem on any other OS than
Windows either, as that doesn't use the sendmail.c code.



[2006-01-05 21:33:38] [EMAIL PROTECTED]

Assigned to the maintainer.



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/35906

-- 
Edit this bug report at http://bugs.php.net/?id=35906&edit=1