Re: [EXIM] queryprogram shell script?

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Paul Slootman
Fecha:  
A: exim-users
Asunto: Re: [EXIM] queryprogram shell script?
On Mon 16 Mar 1998, Dave C. wrote:
> On Mon, 16 Mar 1998, Philip Hazel wrote:
> > From: Philip Hazel <ph10@???>
> > On Fri, 13 Mar 1998, Dave C. wrote:
> >
> > > my_router:
> > > driver = queryprogram
> > > self = send
> > > domains = process.my.domain
> > > command = "/path/to/program $local_part"
> > > transport = my_transport
> > >
> > > /path/to/program:
> > >
> > > #!/bin/sh
> > > echo "OK + + + +"
> > > exit 0
> > >
> > > I keep getting:
> > >
> > > bad command yield: shell-init: could not get current directory: getwd:
> > > cannot access parent directories\nOK + + + +
> > >
> > > from this router doing a -v queue run ???
> > >
> > > A. Why can't bash access its current directory or parent directories?
> > > Even if it is running as nobody, it should be in a directory that is at
> > > least mode 755, readable to all UIDS including "nobody".
> >
> > I can't answer the question, I'm afraid.
>
> I guess its some weird bug in bash.. sigh.. Bash is also the only
> Bourne-shell equivalent available, and its what I write all my scripts
> in.


This will happen if any directory in the path to the current directory
is not readable. Note that /var/spool/exim in my installation is mod
750, i.e. not readable for "nobody".

The current directory of exim when exim calls the script apparently is
somewhere under a directory that isn't readable. The permissions of the
directory itself isn't directly relevant.

Quick hack:

command = "/path/to/program $local_part 2> /dev/null"

Also, when the script does something more significant than just "echo",
try adding a "cd /" at the top.

Paul Slootman
--
home: paul@??? | work: paul@???
http://www.wurtel.demon.nl | Murphy Software, Enschede, the Netherlands
Support Randal Schwartz!
See http://www.lightlink.com/fors/ or send empty email to fund@???

--
*** Exim information can be found at http://www.exim.org/ ***