virtio-9p: Use layered xattr approach

We would need this to make sure we handle the mapped
security model correctly for different xattr names.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
This commit is contained in:
Aneesh Kumar K.V 2010-10-18 15:28:16 +05:30 committed by Anthony Liguori
parent 0f8151cb75
commit fc22118d9b
7 changed files with 345 additions and 92 deletions

View file

@ -47,11 +47,14 @@ typedef struct FsCred
dev_t fc_rdev;
} FsCred;
struct xattr_operations;
typedef struct FsContext
{
char *fs_root;
SecModel fs_sm;
uid_t uid;
struct xattr_operations **xops;
} FsContext;
extern void cred_init(FsCred *);
@ -94,4 +97,12 @@ typedef struct FileOperations
int (*lremovexattr)(FsContext *, const char *, const char *);
void *opaque;
} FileOperations;
static inline const char *rpath(FsContext *ctx, const char *path)
{
/* FIXME: so wrong... */
static char buffer[4096];
snprintf(buffer, sizeof(buffer), "%s/%s", ctx->fs_root, path);
return buffer;
}
#endif