https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8050

--- Comment #21 from RvdH <ruud.vd.h...@gmail.com> ---
1. it was ONLY a issue when running spamassassin from command line (example:
spamassassin --debug --lint)

> It seems Util::portable_getpwuid sets "/" as user home on Windows. Not sure
> if this is the best practice, but probably better not to mess with it.

ALLUSERSPROFILE=C:\ProgramData is the right place for a GLOBAL state
.spamassassin directory to be placed on Windows, $ENV{'ALLUSERSPROFILE'} 

2. there was NO issue with spamd and global_state_dir, running as user or by
parameter --helper-home-dir=

3. with current fix the behavior of spamd on Windows differs from for example
Linux

eg: it is getpwuid stuff in spamassassin (i'll repeat: not spamd!) that is not
working on Windows, but in my opinion calling spamd with --helper-home-dir
parameter should, just like on other OS'es respect supplied --helper-home-dir
directory as global_state_dir. With current patch it ALWAYS uses
{LOCAL_STATE_DIR} which in my opinion is not right, it should not for spamd.

The next question is, would you like to use {LOCAL_STATE_DIR} for spamassassin? 
Wouldn't it be the same amount of work to change it more like, for example:
(PS: non tested code, just from scraps)

if (am_running_on_windows()) {
  my $dir = File::Spec->catdir($ENV{'ALLUSERSPROFILE'}, ".spamassassin");
  return if $self->test_global_state_dir($dir);
}
else {
        # try user home (if different from helper home)
        my $home = (Mail::SpamAssassin::Util::portable_getpwuid ($>))[7];
        if ($home && $home ne $helper_dir) {
          my $dir = File::Spec->catdir($home, ".spamassassin");
          return if $self->test_global_state_dir($dir);
        }
}

Just suggestions, not here to criticize your work and efforts to get this fixed

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to