From 758e8e38eb582e3dc87fd55a1d234c25108a7b7f Mon Sep 17 00:00:00 2001 From: "Venkateswararao Jujjuri (JV)" Date: Mon, 14 Jun 2010 13:34:41 -0700 Subject: virtio-9p: Make infrastructure for the new security model. This patch adds required infrastructure for the new security model. - A new configure option for attr/xattr. - if CONFIG_VIRTFS will be defined if both CONFIG_LINUX and CONFIG_ATTR defined. - Defines routines related to both security models. Signed-off-by: Venkateswararao Jujjuri Signed-off-by: Anthony Liguori --- hw/file-op-9p.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'hw/file-op-9p.h') diff --git a/hw/file-op-9p.h b/hw/file-op-9p.h index f84767f..307bd1e 100644 --- a/hw/file-op-9p.h +++ b/hw/file-op-9p.h @@ -18,13 +18,33 @@ #include #include #include +#include +#define SM_LOCAL_MODE_BITS 0600 +#define SM_LOCAL_DIR_MODE_BITS 0700 + +typedef enum +{ + SM_PASSTHROUGH = 1, /* uid/gid set on fileserver files */ + SM_MAPPED, /* uid/gid part of xattr */ +} SecModel; + +typedef struct FsCred +{ + uid_t fc_uid; + gid_t fc_gid; + mode_t fc_mode; + dev_t fc_rdev; +} FsCred; typedef struct FsContext { char *fs_root; + SecModel fs_sm; uid_t uid; } FsContext; +extern void cred_init(FsCred *); + typedef struct FileOperations { int (*lstat)(FsContext *, const char *, struct stat *); -- cgit v1.1