Unix/Linux/POSIX typically allow almost any byte in a filename, but this flexibility is the source of many problems and vulnerabilities.
This problem is described in "Fixing Unix/Linux/POSIX Filenames: Control Characters (such as Newline), Leading Dashes, and Other Problems" (http://www.dwheeler.com/essays/fixing-unix-linux-filenames.html). Ways of writing shell programs to work around this are discussed in "Filenames and Pathnames in Shell: How to do it correctly" (http://www.dwheeler.com/essays/filenames-in-shell.html). One approach, which does not have some of the problems of other approaches, is to use encodef... which is this package.
License
MIT LicenseFollow encodef
Other Useful Business Software
Auth0 for AI Agents now in GA
Connect your AI agents to apps and data more securely, give users control over the actions AI agents can perform and the data they can access, and enable human confirmation for critical agent actions.
Rate This Project
Login To Rate This Project
User Reviews
-
dwheeler has a well reasoned, competently engineered, and thoroughly tested approach to proofing shell scripts against the vulnerabilities and unfortunate side effects that fundamentally flawed (but evolving) inbuilt methods of handling globing and pathnames enable. His brief essays on this subject are worth careful study and frequent review.