From ecd57e0a3ca03ea9ea22ca9c9ebcbb4f731b88e9 Mon Sep 17 00:00:00 2001 From: Kirill Tkhai Date: Wed, 7 Jun 2017 14:28:04 +0300 Subject: [PATCH] files: Add file_desc_ops::get_user_ns 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 Signed-off-by: Andrei Vagin --- criu/include/files.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/criu/include/files.h b/criu/include/files.h index a75445cf2..588b30518 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 { @@ -107,6 +108,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); };