[CRIU] [PATCH] caps: Print error message on size mismatch

Cyrill Gorcunov gorcunov at openvz.org
Wed Mar 27 07:54:46 EDT 2013


So when we fail print error thus a user would know
where exactly it failed.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
CC: Andrey Vagin <avagin at openvz.org>
---
 cr-restore.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/cr-restore.c b/cr-restore.c
index 835cce1..9779031 100644
--- a/cr-restore.c
+++ b/cr-restore.c
@@ -1473,8 +1473,12 @@ static int prepare_creds(int pid, struct task_restore_core_args *args)
 
 	if (ret < 0)
 		return ret;
-	if (!verify_cap_size(ce))
+	if (!verify_cap_size(ce)) {
+		pr_err("Caps size mismatch %d %d %d %d\n",
+		       (int)ce->n_cap_inh, (int)ce->n_cap_eff,
+		       (int)ce->n_cap_prm, (int)ce->n_cap_bnd);
 		return -1;
+	}
 
 	args->creds = *ce;
 	args->creds.cap_inh = args->cap_inh;
-- 
1.8.1.4



More information about the CRIU mailing list