[CRIU] [PATCH 6/6] intify: Add support of file owners

Cyrill Gorcunov gorcunov at openvz.org
Tue Apr 17 09:22:31 EDT 2012


Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 cr-show.c       |    2 ++
 include/image.h |    1 +
 inotify.c       |    4 ++++
 3 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/cr-show.c b/cr-show.c
index ea92cb6..d612523 100644
--- a/cr-show.c
+++ b/cr-show.c
@@ -208,6 +208,8 @@ void show_inotify(int fd_inotify, struct cr_options *o)
 			goto out;
 
 		pr_msg("inotify: id 0x%08x flags 0x%08x\n", e.id, e.flags);
+		show_fown_cont(&e.fown);
+		pr_msg("\n");
 	}
 out:
 	pr_img_tail(CR_FD_INOTIFY);
diff --git a/include/image.h b/include/image.h
index 9c90358..64b17ee 100644
--- a/include/image.h
+++ b/include/image.h
@@ -98,6 +98,7 @@ struct inotify_wd_entry {
 struct inotify_file_entry {
 	u32	id;
 	u16	flags;
+	fown_t	fown;
 } __packed;
 
 struct fdinfo_entry {
diff --git a/inotify.c b/inotify.c
index 1b0d100..4092449 100644
--- a/inotify.c
+++ b/inotify.c
@@ -96,6 +96,7 @@ int dump_one_inotify(int lfd, u32 id, const struct fd_parms *p)
 
 	ie.id	= id;
 	ie.flags= p->flags;
+	ie.fown	= p->fown;
 
 	if (write_img(image_fd, &ie))
 		goto err;
@@ -217,6 +218,9 @@ static int open_inotify_fd(struct file_desc *d)
 		}
 	}
 
+	if (restore_fown(tmp, &info->ife.fown))
+		close_safe(&tmp);
+
 	return tmp;
 }
 
-- 
1.7.7.6



More information about the CRIU mailing list