Details
-
Bug
-
Resolution: Fixed
-
Minor
-
Upstream
-
3
-
9223372036854775807
Description
When using 'lfs fid2path' to find all hardlinks of a FID, the links are printed out with newline characters separating them. This is unsafe, since file paths are allowed to contain newline characters as well, which makes fid2path unreliable for non-interactive use (i.e. as part of other tools, without human supervision).
This issue is present in the master branch, so I assume it might affect all current versions.
To mitigate this problem and not break backwards compatibility, perhaps one could add a new command line argument that changes the path separator from '\n' to '\0'? Similar to "find . -print0", for example.
# Suggested usage:
lfs fid2path -0 <FID>