Redirect standard descriptors for hook/notify commands

Disconnect stdin, stdout and stderr when running an external hook or
notification command. The previous solution of appending "<&- >&- 2>&-"
to the shell command line does not work if the command includes pipes.

Use shell_exec() in notify_launch_cmd() instead of a custom (and
incomplete) reimplementation of that command.

Partially addresses GitHub issue #326.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
Lukas Fleischer
2021-04-04 11:26:46 -04:00
parent 5710a8bd7f
commit 193ad3415a
3 changed files with 11 additions and 26 deletions

View File

@@ -671,7 +671,6 @@ struct nbar {
char datefmt[BUFSIZ]; /* format for displaying date */
char timefmt[BUFSIZ]; /* format for displaying time */
char cmd[BUFSIZ]; /* notification command */
const char *shell; /* user shell to launch notif. cmd */
unsigned notify_all; /* notify all appointments */
pthread_mutex_t mutex;
};