3 ms·
Hi, this is due to the fact that zDir may contain spaces especially under windows which confuse the command processor to interpret it as multiple arguments and
by symisc_devel 11y ago
Hi, this is due to the fact that zDir may contain spaces especially under windows which confuse the command processor to interpret it as multiple arguments and not a single one as with single or double quotes (http://libcox.net/arch.html http://libcox.net/arch.html)
- geofft 11y agoWhat happens if zDir contains single quotes?
- stefs 11y agoYou need to escape them, like in every other instance where strings may contain control characters. That'd be my guess, at least, but, i guess, single quotes aren't valid characters for zDir.
- geofft 11y agoSo what are the quote parsing rules for libcox, and given an arbitrary string, how do I correctly escape them? (In the absence of this, and certainly in the absence of official docs/examples that do the right thing, that's a security vulnerability waiting to happen.)
- symisc_devel 11y agoString escaping follows the same rules of C/C++ or you could use the str_escape command to do job for you.
- heinrich5991 11y agoWhy do you take care of space escaping but not others (quotation marks)? This might lead to false expectations, i.e. that you take care of everything, security-wise.