aboutsummaryrefslogtreecommitdiff
path: root/hw/file-op-9p.h
diff options
context:
space:
mode:
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 f84767f989..307bd1eeef 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 *);