[GRASS5] [bug #2961] (grass) lib/gis/unix_socks.c fails unless $TMPDIR is /tmp

Paul Kelly paul-grass at stjohnspoint.co.uk
Thu Feb 3 04:36:17 EST 2005


On Thu, 3 Feb 2005, Request Tracker wrote:

> I just did a little audit and I think my recenct security fix to init.sh introduced a bug. I'd like to fix it ASAP - if not I'll remove the $TMPDIR capability and revert to always using /tmp (maybe in the next 24 hours).
>
> The bug is this:
>
> init.sh now uses $TMPDIR (if it exists) to place the temporary session files in. If $TMPDIR doesn't exist it uses /tmp. Now lib/gis/unix_socks.c has "/tmp" hardcoded and I don't know how to do the 'if(! $TMPDIR) then "/tmp"' test in C.
>
> It might still work, but would leave files scattered about, reintroduce the security issues, etc..
>
> Can someone show me how to do this?

I haven't looked at any of the source files but what about a GRASS 
variable TMPDIR that would contain either the system TMPDIR or /tmp 
depending on the checks at startup. Then in the C file you could access it 
as G_getenv("TMPDIR") or something and you wouldn't have to repeat the 
logic checking if TMPDIR is set.




More information about the grass-dev mailing list