[CRIU] [PATCH v2 13/30] files: Add file_desc_ops::get_user_ns

Kirill Tkhai ktkhai at virtuozzo.com
Wed Jun 7 14:28:04 MSK 2017


Returns user_ns of file (currently it's not exported to userspace)
and minimal user_ns need for restore file (for example, socket
net_ns->user_ns, regulating setns() permittions).

This will be need to choose correct process as owner of file master.

Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 criu/include/files.h |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/criu/include/files.h b/criu/include/files.h
index 3fe3149f2..2351e41c6 100644
--- a/criu/include/files.h
+++ b/criu/include/files.h
@@ -20,6 +20,7 @@ struct file_desc;
 struct cr_imgset;
 struct rst_info;
 struct parasite_ctl;
+struct ns_id;
 
 struct fd_link {
 	union {
@@ -97,6 +98,12 @@ struct file_desc_ops {
 	 * so it shouldn't be saved for any post-actions.
 	 */
 	int			(*open)(struct file_desc *d, int *new_fd);
+	/*
+	 * Returns user_ns of file (currently it's not exported to userspace)
+	 * and minimal user_ns need for restore file (for example, socket
+	 * net_ns->user_ns, regulating setns() permittions).
+	 */
+	void			(*get_user_ns)(struct file_desc *, uint32_t *, struct ns_id **);
 	char *			(*name)(struct file_desc *, char *b, size_t s);
 };
 



More information about the CRIU mailing list