[CRIU] Re: [PATCH 0/4] A few more check functions added

Cyrill Gorcunov gorcunov at openvz.org
Thu Apr 5 08:55:00 EDT 2012


On Thu, Apr 05, 2012 at 04:41:32PM +0400, Pavel Emelyanov wrote:
> 
> Applied, but a fix is required
> 
> $ ./crtools check
> prctl: PR_SET_MM is not supported
> 
> This happens on a box which has it and it fails due to me being not root.
> 

Something like below?

	Cyrill
---
From: Cyrill Gorcunov <gorcunov at openvz.org>
Date: Thu, 5 Apr 2012 16:53:53 +0400
Subject: [PATCH] check: We need CAP_SYS_RESOURCE granted to perform testing

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 cr-check.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/cr-check.c b/cr-check.c
index 800306b..82032a5 100644
--- a/cr-check.c
+++ b/cr-check.c
@@ -92,7 +92,10 @@ static int check_prctl(void)
 
 	ret = sys_prctl(PR_SET_MM, PR_SET_MM_BRK, sys_brk(0), 0, 0);
 	if (ret) {
-		pr_msg("prctl: PR_SET_MM is not supported\n");
+		if (ret == -EPERM)
+			pr_msg("prctl: One needs CAP_SYS_RESOURCE capability to perform testing\n");
+		else
+			pr_msg("prctl: PR_SET_MM is not supported\n");
 		return -1;
 	}
 
-- 
1.7.7.6



More information about the CRIU mailing list