aboutsummaryrefslogtreecommitdiff
path: root/hw/file-op-9p.h
diff options
context:
space:
mode:
authorVenkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>2010-06-14 13:34:41 -0700
committerAnthony Liguori <aliguori@us.ibm.com>2010-06-22 15:15:50 -0500
commit758e8e38eb582e3dc87fd55a1d234c25108a7b7f (patch)
treea8925a3d8c7741347c30e16ecd93da8b64ba8be4 /hw/file-op-9p.h
parent9ce56db6f0de81fd81972029073ff8008830bc02 (diff)
downloadqemu-758e8e38eb582e3dc87fd55a1d234c25108a7b7f.zip
qemu-758e8e38eb582e3dc87fd55a1d234c25108a7b7f.tar.gz
qemu-758e8e38eb582e3dc87fd55a1d234c25108a7b7f.tar.bz2
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 <jvrao@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/file-op-9p.h')
-rw-r--r--hw/file-op-9p.h20
1 files changed, 20 insertions, 0 deletions
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 <utime.h>
#include <sys/stat.h>
#include <sys/uio.h>
+#include <sys/vfs.h>
+#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 *);