Hi, Sorry for the delay! rixed@happyleptic.org skribis: > I'm refering to the ensure-writable-dir function. > I've stumbled upon this problem recently : I have a program that's suid root > but calls guile. The guile compiler then creates some directories in > .cache/guile but then check (with access()) that he can write in there, which > he can't since access revoke the effective uid for the caller uid. We thus have > this situation: the compiler creates a bunch of directories then complains he > cannot write in them. > > It's not obvious to me why the compiler should ensure a directory is writable > just to throw an error. Wouldn't it be better to just call opens and writes > and let these fails and report these more acurate errors instead (or, in my > case, let them succeed) ? Agreed, not to mention time-of-check-to-time-of-use-errors. We basically want ‘mkdir -p’, but we can even omit the stat(2) call upon EEXIST, because if DIR doesn’t point to a directory, the error will be caught soon after anyway. I’ll install the following patch if there’s no objection: