From 019c7fba754f74909bdb8bbbbbbe529082928a95 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 9 Apr 2015 18:32:21 +0200 Subject: util: add shell_maybe_quote() call for preparing a string for shell cmdline inclusion If necessary the passed string is enclosed in "", and all special characters escapes. This also ports over usage in bus-util.c and job.c to use this, instead of a incorrect local implementation that forgets to properly escape. --- src/shared/util.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/shared/util.h') diff --git a/src/shared/util.h b/src/shared/util.h index b41090bf70..737a3f3280 100644 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -1090,3 +1090,5 @@ int syslog_parse_priority(const char **p, int *priority, bool with_facility); void cmsg_close_all(struct msghdr *mh); int rename_noreplace(int olddirfd, const char *oldpath, int newdirfd, const char *newpath); + +char *shell_maybe_quote(const char *s); -- cgit v1.2.3-54-g00ecf