Re: Help testing release candidate / mc-4.8.28-rc1



On Mon, Mar 21, 2022 at 09:44:45AM +0300, Andrew Borodin wrote:
mc-wrapper.sh doesn't create a file.

i know, but i'm using my own function (for historical reasons):

mc ()
{
    local tf=$(mktemp);
    /usr/local/bin/mc -P $tf "$@" && test -r $tf && cd "$(<$tf)";
    rm -f $tf
}

... which, *cannot* have ever worked. it's somewhat unsurprising that i didn't notice, as my kde-based workflows don't rely on it working.

still, it seemed beizarre that i did't notice for a whole two decades,
so i looked around ... and each of my two other machines has a different working version: one has tf=/tmp/mc-`whoami`/wd$$, which i presume is the oldest one, and one has tf=$XDG_RUNTIME_DIR/mc-wd-$$. so i suppose i'm sleepwalking. :'-D

A workaround is to apply `mktemp -u` or even `mktemp -u -t`, but is it portable?

dunno. but it would be a mediocre idea anyway, and absolutely terrible without the O_EXCL (because symlink attacks).

but anyway, this is an entirely self-made problem. sorry for the noise.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]