3 ms·
I agree with your statement even though it seems to completely miss the original point that I have made. Yes, you are correct, if you are running a suid binary
by phoe-krk 6y ago
I agree with your statement even though it seems to completely miss the original point that I have made.
Yes, you are correct, if you are running a suid binary and you specify / as a temporary directory instead of the default that looks like /tmp/foo-12345abcd/ in its configuration file, then the script may invalidly perform cleanup by deleting everything on the filesystem.
But this does not suddenly mean that Unix pathnames are Turing-complete or Turing-incomplete or that Turing-completeness somehow applies to strings as data formats.
It's not the path string that does the deletion. It's not the path string that was written in a programming language that performs the unlink() syscall. It's not the data itself that causes people to curse loudly.
Sure, secure your data, validate your inputs, ensure that your code cannot be misused, just don't say that data, even when it is in use, performs some computation on its own.
- samatman 6y agoI'm getting the sense that you're not quite picking up what I'm laying down here. Code also performs no computation on its own. A function with no parameters is just a complex constant. Computation is always the union of code and data. People can and do embed full programs in 'inert' formats like JSON, and write an interpreter for that program. This is a bad idea, and the notion that JSON is "just data" is exactly what fools people into writing such inner languages (implementing, of course, half of Common Lisp). Reducing the motivating examples (JSON, TOML, etc.) to path strings is a weak argument, because path strings are not strong enough to provide for such an inner platform, while the data formats under discussion are, it happens all the time. The very fact that I can point out that a path string is capable of driving less complex calculations than YAML is, points out that there is in fact a continuum from pure code to 'mere data' (a float, let's say), which undermines the argument that there is some strong distinction to be made here.
- phoe-krk 6y agoOK, I understand your point now, and I can agree with it. Thank you for the elaboration.