[Pkg-clamav-devel] Lintian override (Was: Re: repo set up)

Michael Tautschnig mt at debian.org
Tue Sep 9 13:18:25 UTC 2008


> This one time, at band camp, Michael Meskes said:
> > On Mon, Sep 08, 2008 at 12:45:43AM +0100, Stephen Gran wrote:
> > > > As you started cleaning out the lintian warnings: We also have a warning about
> > > > insecure tmp usage, because of that line in the clamav-base postinst:
> > > > 
> > > > [ -z "$TemporaryDirectory" ] && TemporaryDirectory='/tmp'
> > 
> > The big question is where/how is this used?
> 
> Most of the variables in the script wind up as config settings in the
> daemon config files.
> 
> steve at vancouver:~$ grep TemporaryDirectory /etc/clamav/clamd.conf
> /etc/clamav/clamd.conf:TemporaryDirectory /tmp
> 
> clamd/clamd.c:
>     /* set the temporary dir */
>     if((cpt = cfgopt(copt, "TemporaryDirectory"))->enabled)
>         cl_settempdir(cpt->strarg, 0);
> 
> libclamav/others.c:
> void cl_settempdir(const char *dir, short leavetemps) {
>     char *var;
>     if(dir) {
>         var = (char *) cli_malloc(8 + strlen(dir));
>         sprintf(var, "TMPDIR=%s", dir);
>         if(!putenv(var))
>         ....
> 
> char *cli_gentemp(const char *dir) {
>     char *name, *tmp;
>     const char *mdir;
>     unsigned char salt[16 + 32];
>     int i;
> 
>     if(!dir) {
>         if((mdir = getenv("TMPDIR")) == NULL)
>             mdir = "/tmp";
>     } else
>         mdir = dir;
>     ....
> 
> So, effectively, TemporaryDirectory is a way to set the environment
> variable TEMPDIR that later calls to the internal `mktemp -d` will use
> as a parent directory.
> 

[...]

After reading the above pieces of code I wonder what the added value of setting
TemporaryDirectory to /tmp is at all? Apparently, that would be the default
anyway? 

Not that this would make things better in any way, it just seems even simpler
than adding a lintian override.

Best,
Michael


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-clamav-devel/attachments/20080909/62464c00/attachment.pgp 


More information about the Pkg-clamav-devel mailing list