mirror of
https://github.com/troglobit/finit.git
synced 2026-11-16 19:20:26 +00:00
conf: escape runtime strings in generated .conf files
The runparts directory and the dbus pidfile and daemon paths are embedded in double-quoted values of the generated block files. A literal quote in either ends the value early and libconfuse rejects the whole file, and a backslash is read as an escape sequence, silently mangling the path. The legacy one-liners had no quoting, so neither failure existed before the block conversion. conf_escape() doubles backslashes and escapes quotes; verified by round-tripping hostile paths through cfg_parse_buf(). Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
3 files changed
+29
-3
No files matched your search
@@ -71,6 +71,7 @@ int conf_monitor (void);
|
||||
|
||||
void conf_saverc (void);
|
||||
void conf_save_exec_order (svc_t *svc, char *cmdline, int result);
|
||||
char *conf_escape (const char *str, char *buf, size_t len);
|
||||
void conf_save_service (int type, const char *name, char *file, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 4, 5)));
|
||||
void conf_parse_cmdline (int argc, char *argv[]);
|
||||
|
||||
Reference in new issue
Block a user