http://bugzilla.spamassassin.org/show_bug.cgi?id=4001
[EMAIL PROTECTED] changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|Future |3.1.0
------- Additional Comments From [EMAIL PROTECTED] 2004-11-26 15:52 -------
Excerpts that cover the discussion so far on sa-dev:
sidney:
I just tried a quick build and make test in Windows XP to see what it would do,
and
[...]
2. I got lots and lots of
Use of uninitialized value in concatenation (.) or string at
..\lib/Mail/SpamAssassin/ArchiveIterator.pm line 1023.
--------
malte:
Hm. The line is
$path =~ s!^~/!$ENV{'HOME'}/!;
so probably HOME is not set. The question is, what should this routine do
if HOME is not set; probably the value from (getpwuid($<))[7] (before $< is
changed). What does getpwuid() say on Windows?
---------
sidney:
The error message from ArchiveIterator.pm is because Windows does not define
$HOME environment variable by default. It has $HOMEDRIVE and $HOMEPATH which
together server the same purpose. The code in ArchiveIterator.pm has to be
changed to check for Windows, or else we can document the need to set a $HOME.
Do we use $HOME anywhere else?
I just found it because I used to have HOME defined in my XP environment for
other reasons.
----------
Theo, replying to Malte:
Doesn't matter really, we use M::SA::Util::portable_getpwuid() ... :)
---------
Malte:
Ah, cool :) So maybe we should add a M::SA::Util::get_home() which first
tries $ENV{HOME}, then on Windows $ENV{HOMEDRIVE}\$ENV{HOMEDIR}, then
portable_getpwuid()[7], then... foo?
--------
sidney:
You can't use getpwuid in Windows. The usual portable implementation checks for
running under Windows and uses $ENV{'HOMEDRIVE'} . $ENV{'HOMEPATH'} if it is
instead of $ENV{'HOME'}, being careful about the former using '\' separators
instead of '/'.
[...]
portable_getpwuid() doesn't seem to do anything useful under Windows for this
purpose and shouldn't be needed anyway. It just returns 'unknown' for the name,
which works when you don't care about the actual user name.
The first two steps are fine, and probably enough, except that you would not
have to add the '\' separator, it is already in HOMEDIR.
Question: In ArchiveIterator.pm does everything work if that is what it uses for
HOME or does anything have to be done to convert \ to / ?
--------
Malte (referring to first draft of patch which will be attached here)
What do you think about the attached patch? Try it with
perl -Ilib -MMail::SpamAssassin::Util \
-le 'print Mail::SpamAssassin::Util::get_home()'
---------
sidney:
It's HOMEPATH not HOMEDIR, but with that change the Windows branch of it works
fine as long as you use " instead of ' in the brain damaged Windows command line
:-)
-------
sidney:
I spoke too soon about it working. When I add a -w to the perl command it barfs
in catpath, I think because it expects to be passed all three arguments, volume,
dir, and file. I'll try adding a third argument of '' and see what it does. Or I
could try reading the doc on catpath first :)
-----
malte:
*grr*, you're right. I was pretty sure I said -w when I tried it... I
checked in a version of the code into ArchiveIterator, could you please fix
it there? Now that I think about it should it probably also check if those
other environment vars are defined.
---------
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.