X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Futil.h;h=b3187a9ea1d708e789b22862d8544c381526bb22;hb=eda8090ba9abc7d00f30e2b4cb34273cde799704;hp=7c9842b3e6c2dcf2f96eb84d6d1add6c39a2372a;hpb=418b9be50018303cde79b423d4701b7fd86ddbdc;p=elogind.git diff --git a/src/shared/util.h b/src/shared/util.h index 7c9842b3e..b3187a9ea 100644 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -93,6 +93,12 @@ #define COMMENTS "#;" #define GLOB_CHARS "*?[" +/* What characters are special in the shell? */ +/* must be escaped outside and inside double-quotes */ +#define SHELL_NEED_ESCAPE "\"\\`$" +/* can be escaped or double-quoted */ +#define SHELL_NEED_QUOTES SHELL_NEED_ESCAPE GLOB_CHARS "'()<>|&;" + #define FORMAT_BYTES_MAX 8 #define ANSI_HIGHLIGHT_ON "\x1B[1;39m" @@ -505,7 +511,7 @@ bool tty_is_console(const char *tty) _pure_; int vtnr_from_tty(const char *tty); const char *default_term_for_tty(const char *tty); -void execute_directory(const char *directory, DIR *_d, usec_t timeout, char *argv[], char *env[]); +void execute_directory(const char *directory, DIR *_d, usec_t timeout, char *argv[]); int kill_and_sigcont(pid_t pid, int sig); @@ -964,3 +970,5 @@ char *tempfn_xxxxxx(const char *p); char *tempfn_random(const char *p); bool is_localhost(const char *hostname); + +int take_password_lock(const char *root);