[CRIU] [PATCH] crtools: allow only absolute logfile and pidfile paths with -d option

Ruslan Kuprieiev kupruser at gmail.com
Sun Nov 10 18:41:02 PST 2013


-d is to be used primarily by some start up scripts, so lets allow only absolute path for confidence.

Signed-off-by: Ruslan Kuprieiev <kupruser at gmail.com>
---
 crtools.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/crtools.c b/crtools.c
index 9f0b6e4..20cedbc 100644
--- a/crtools.c
+++ b/crtools.c
@@ -277,6 +277,12 @@ int main(int argc, char *argv[])
 		}
 	}
 
+	if (opts.restore_detach)
+		if (opts.output[0] != '/' || opts.pidfile[0] != '/') {
+			pr_err("-d requires absolute paths for both logfile and pidfile\n");
+			return -1;
+		}
+
 	log_set_loglevel(log_level);
 
 	if (log_init(opts.output))
-- 
1.8.1.2



More information about the CRIU mailing list