diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2010-08-26 11:15:23 +0530 |
---|---|---|
committer | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2010-09-08 22:56:42 +0530 |
commit | 9ed3ef26e6503c39ca8b68fb8894c62824e4f3b9 (patch) | |
tree | 0bbe569bfccb3616f59c1bbe7026d3084ee92238 /hw/virtio-9p-local.c | |
parent | 783f04e1d419f730639755e6bd4e7026ad6f2a3f (diff) |
virtio-9p: Add support for removing xattr
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Diffstat (limited to 'hw/virtio-9p-local.c')
-rw-r--r-- | hw/virtio-9p-local.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/hw/virtio-9p-local.c b/hw/virtio-9p-local.c index 132816e607..57f92433d3 100644 --- a/hw/virtio-9p-local.c +++ b/hw/virtio-9p-local.c @@ -581,6 +581,22 @@ static int local_lsetxattr(FsContext *ctx, const char *path, const char *name, return lsetxattr(rpath(ctx, path), name, value, size, flags); } +static int local_lremovexattr(FsContext *ctx, + const char *path, const char *name) +{ + if ((ctx->fs_sm == SM_MAPPED) && + (strncmp(name, "user.virtfs.", 12) == 0)) { + /* + * Don't allow fetch of user.virtfs namesapce + * in case of mapped security + */ + errno = EACCES; + return -1; + } + return lremovexattr(rpath(ctx, path), name); +} + + FileOperations local_ops = { .lstat = local_lstat, .readlink = local_readlink, @@ -612,4 +628,5 @@ FileOperations local_ops = { .lgetxattr = local_lgetxattr, .llistxattr = local_llistxattr, .lsetxattr = local_lsetxattr, + .lremovexattr = local_lremovexattr, }; |