From 88b2ee285446d86dd3623fc910d0d7456ae3c4bb Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Wed, 27 Jun 2018 10:20:46 +0200 Subject: [PATCH] containerfs: raise error if upperdir is not specified Signed-off-by: Giuseppe Scrivano --- main.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/main.c b/main.c index a74e5a2..1804a87 100644 --- a/main.c +++ b/main.c @@ -2774,7 +2774,9 @@ main (int argc, char *argv[]) lo.debug = opts.debug; - if (lo.upperdir != NULL) + if (lo.upperdir == NULL) + error (EXIT_FAILURE, 0, "upperdir not specified"); + else { char full_path[PATH_MAX + 1]; @@ -2785,16 +2787,6 @@ main (int argc, char *argv[]) if (lo.upperdir == NULL) goto err_out1; } - else - { - char *up = strdup ("/tmp/containerfs.XXXXXX"); - int ret = mkstemp (up); - if (ret < 0) - goto err_out1; - - close (ret); - lo.upperdir = up; - } printf ("UID=%i\n", lo.uid); printf ("GID=%i\n", lo.gid);