Re: [EXIM] Force root?

Top Page
Delete this message
Reply to this message
Author: James FitzGibbon
Date:  
To: eximlist
CC: exim-users
Subject: Re: [EXIM] Force root?
* eximlist@??? (eximlist@???) [990414 12:07]:

> How can I force a file lookup in a directory to be done with root
> permissions? I'm looking data up in a file in a users home directory, and
> there is no guarantee that the home dir will be world readable (or
> readable by the exim user).


I'm not sure about the exists check, but in the documentation for
require_files:

(http://www.exim.org/exim-html-2.00/doc/html/spec_19.html#SEC514)

The `stat()' function is normally run under the exim uid (or root if such is
not defined). However, it is possible to arrange for this test to be run
under a specific uid and gid (which is set by means of `seteuid()' and
`setegid()'). If an item in a `require_files' list does not contain any
forward slash characters, it is taken to be the user (and optional group,
separated by a comma) to be used for testing subsequent files in the list.
If no group is specified but the user is specified symbolically, then the
gid associated with the uid is used; otherwise the gid is not changed. For
example:

require_files = mail:/some/file
require_files = ${local_part}:${home}/.procmailrc

The second example works because the `require_files' string is expanded
before use.


Having looked at the 'exists' code in expand.c, I don't think that this
would work, because the magic that decides if seteuid/setegid should be
called isn't present in that part of the code.

--
j.

James FitzGibbon (JF647)                                        james@???
EHLO Solutions                                         Voice/Fax (416)410-0100


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