[CRIU] [PATCH 3/4] pipes: Set fowners for both pipe ends

Cyrill Gorcunov gorcunov at openvz.org
Thu Apr 12 05:45:07 EDT 2012


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

diff --git a/pipes.c b/pipes.c
index 3ebad92..99672d1 100644
--- a/pipes.c
+++ b/pipes.c
@@ -261,6 +261,10 @@ static int open_pipe(struct file_desc *d)
 		return -1;
 	}
 
+	if (restore_fown(pfd[0], &pi->pe.fown) ||
+	    restore_fown(pfd[1], &pi->pe.fown))
+		return -1;
+
 	ret = restore_pipe_data(pfd[1], pi);
 
 	sock = socket(PF_UNIX, SOCK_DGRAM, 0);
@@ -291,8 +295,5 @@ out:
 	if (ret < 0)
 		return -1;
 
-	if (restore_fown(tmp, &pi->pe.fown))
-		return -1;
-
 	return tmp;
 }
-- 
1.7.7.6



More information about the CRIU mailing list