[prev in list] [next in list] [prev in thread] [next in thread] 

List:       majordomo-users
Subject:    Re: Can't stat .
From:       dwolfe () risc ! sps ! mot ! com (Dave Wolfe)
Date:       1995-08-28 15:13:10
[Download RAW message or body]

[ Peter Heimann writes: ]
> 
> On the majordomo-users list, you write
> 
> > I put some diagnostic prints in majordomo.cf to verify that $listdir
> > is defined at that point and to check what `pwd` returned (nothing,
> > undefined, but generates another "can't stat ." message). The problem
> > seems to be that perl has no current directory when started via
> > sendmail. 
> 
> I would guess: it has a current directory, inherited from the sendmail 
> process, but this directory is not readable to the majordomo user.
> This results in pwd's "can't stat ." message.

Of course! I was overlooking the obvious. It's not that there's no
current directory, archive2.pl just doesn't have permission to read it
(and the shell invoked by the glob wants to know where it is as part of
its initialization). I guess I was assuming that wrapper handled that.
Since a lot of the Mj scripts do chdir($homedir) anyway, I suggest that
it be added to wrapper.c just before the exec.

It looks like the immediate fix for my problem is to add a
chdir($ENV{'HOME'}) to archive2.pl:

*** archive2.pl.orig    Wed Mar  1 08:43:29 1995
--- archive2.pl Mon Aug 28 10:09:52 1995
***************
*** 46,51 ****
--- 46,54 ----
  # come along in the 1.91 patch I guess.
  $main'program_name = 'mj_archive';
  
+ # Change directory to our home
+ chdir($ENV{'HOME'}) if $ENV{'HOME'};
+ 
  # Read and execute the .cf file
  $cf = $ENV{"MAJORDOMO_CF"} || "/etc/majordomo.cf";
  if ($ARGV[0] eq "-C") {

Thanks to all who responded, especially to Peter.

-- 
 Dave Wolfe    *Not a spokesman for Motorola*  (512) 891-3246
 Motorola MMTG  6501 Wm. Cannon Dr. W. OE112  Austin  TX  78735-8598

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic