Retain orig. filename as suffix for tmp. filename

Pavel Roskin proski at gnu.org
Mon Feb 24 07:22:16 UTC 2003


Hello, Adam!

> It is worth noting, that the getlocalcopy has already supported file
> 'extension' as a suffix (mclocalcopyXXXXX.tgz in our case, btw it was
> implemented in a quite ugly way: 6 lines of code could be easily
> substituted with simple strrchr), but it is not enough IMO:
>
>  * Something we call 'extension' is not native to the *nix
>    nomenclature, in unix filename is atomic (of course we treat part
>    after the last dot as the 'extension', but it is mostly
>    conventional) - AFAIK, correct me if I'm wrong...

If you preserve the whole filename, you are more likely to have spaces for
some other special characters in the filename.  Some programs have
problems with spaces in the filename (e.g. rpm 4.1).

Even worse, some programs could be exploited by giving them bogus
filenames as arguments.  I like your idea, but the security issue should
be addressed (actually, it exists already because the extension can have
bad stuff too).

-- 
Regards,
Pavel Roskin



More information about the mc-devel mailing list