You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.
Description: Suppose your current directory contains a file with newline, such as $'hello\nworld.jpg'. A command such as find . -name "*.jpg" | sxiv -i will then fail, as sxiv interprets the above file as two separate inputs.
In the same manner, sxiv -o returns a newline-terminated list of files, which will cause problems for further processing in the above scenario. This is a very common trap with unix filenames, and can lead to serious security issues.
Suggestion: Tools like find and xargs include a -0 and -print0 option to return path lists as null terminated strings. My suggestion is to add a -0 option in sxiv with -i in order to accept a list of null-terminated pathnames, rather than newline-terminated. Similarly, add a -print0 option to return null-terminated output.
This will prevent breakage due to unusual filenames and make sxiv compatible with find, xargs etc.
The text was updated successfully, but these errors were encountered:
We've implemented -0 for outputting NULL separated list on nsxiv. However option for NULL seperated input can be done easily via xargs -0 so that will not be added.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Affected system: any linux system
Description: Suppose your current directory contains a file with newline, such as
$'hello\nworld.jpg'
. A command such asfind . -name "*.jpg" | sxiv -i
will then fail, as sxiv interprets the above file as two separate inputs.In the same manner,
sxiv -o
returns a newline-terminated list of files, which will cause problems for further processing in the above scenario. This is a very common trap with unix filenames, and can lead to serious security issues.Suggestion: Tools like
find
andxargs
include a-0
and-print0
option to return path lists as null terminated strings. My suggestion is to add a-0
option in sxiv with-i
in order to accept a list of null-terminated pathnames, rather than newline-terminated. Similarly, add a-print0
option to return null-terminated output.This will prevent breakage due to unusual filenames and make sxiv compatible with find, xargs etc.
The text was updated successfully, but these errors were encountered: