Open tsipinakis opened 7 years ago
Turns out we have three ways to run an external executable: utils::run_interactively
, utils::run_program
and utils::run_command
. notify-program
is interpreted by the last one, and it indeed doesn't split the command into arguments—it just calls execlp
. This is inconsistent with two other functions, which pass their arguments to /bin/sh
.
We can't simply do the same in run_command
because we have to be sure that the argument we're passing to notify-program
isn't mangled by the shell.
TODO:
run_interactively
and run_program
need to take the same care of their arguments;run_command
so that it doesn't duplicate shell's functionality (path lookup, tilde expansion, environment variable expansion, maybe some other stuff I'm forgetting).Setting this aside for now.
Newsbeuter version (copy from
newsbeuter -v
): 2.10-3df01notify-program
doesn't properly handle command line arguments.With
notify-program notify --arg
in the config,notify
is called without any arguments:With
notify-program "notify --arg"
in the config, the entire string is attempted to be executed as an executable: