Fix PR 19089: Environment variable TMP may yield gcc: abort
authorAndrew Pinski <apinski@marvell.com>
Sun, 28 Nov 2021 02:16:50 +0000 (18:16 -0800)
committerAndrew Pinski <apinski@marvell.com>
Mon, 29 Nov 2021 00:42:45 +0000 (00:42 +0000)
commit68332ab7ec58a89660db82569c5f4c2251d59741
tree285de25611e1138bab8aa0838887da4d9654b2d5
parent2f0dd172bc63555457cda42c31e9b19f280dd40a
Fix PR 19089: Environment variable TMP may yield gcc: abort

Even though I cannot reproduce the ICE any more, this is still
a bug. We check already to see if we can access the directory
but never check to see if the path is actually a directory.

This adds the check and now we reject the file as not usable
as a tmp directory.

OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.

libiberty/ChangeLog:

* make-temp-file.c (try_dir): Check to see if the dir
is actually a directory.
libiberty/make-temp-file.c