This one time, at band camp, Alexander Samad said:
> On Thu, Aug 24, 2006 at 02:02:33AM +0100, Stephen Gran wrote:
> > This one time, at band camp, Alexander Samad said:
> > > libpam-tmpdir sets the TMP & TMPDIR environments variables, because the
> > > the daemon changes uid after starting it is unable to create its tmp
> > > directory in /tmp/user/0/....
> > 
> > It sounds like you're looking for the TemporaryDirectory config fiule
> > option.  If this fixes it for you, or if you need further help, please
> > let me know.
> 
> Hi I found it, but it doesn't solve the problem.
> 
> libpam_tmpdir, creates a (!)more secure tmp directory along the lines of
> /tmp/users/$(id -x)/ and sets TMP to /tmp/users/$(id -x) the problem
> with the way that clamav-deamon starts is /etc/init.d/clamav-deamon
> starts as root and TMP & TMPDIR is equal to /tmp/user/0 which
> clamav-deamon can't write to once it changes to clamav user.  If I set
> the tmp directory in /etc/default/clamav to /tmp/users/$(id -x clamav)
> it works, but I also need to create the directory because the change of
> uid doesn't invoke libpam_tmpdir
> 
> 
> ID=$(id -u clamav)
> if [ ! -d /tmp/user/$ID ]
> then
>         mkdir -p /tmp/user/$ID
>         chown $ID.0 /tmp/user/$ID
>         chmod go= /tmp/user/$ID
> fi
> #export TMPDIR=/dev/shm
> #export TMP=/var/tmp
> export TMPDIR=/dev/shm
> export TMP=/tmp/user/$ID

Since you have a rather unusual environment, what i was actually
thinking of was something along the lines of 
mkdir /var/lib/clamav/tmp

Then add 
TemporaryDirectory /var/lib/clamav/tmp 
to clamd.conf

That should solve your problem.
-- 
 -----------------------------------------------------------------
|   ,''`.                                            Stephen Gran |
|  : :' :                                        [EMAIL PROTECTED] |
|  `. `'                        Debian user, admin, and developer |
|    `-                                     http://www.debian.org |
 -----------------------------------------------------------------

Attachment: signature.asc
Description: Digital signature

Reply via email to