Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
9ed3ef26
Q
qemu
项目概览
openeuler
/
qemu
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9ed3ef26
编写于
8月 26, 2010
作者:
A
Aneesh Kumar K.V
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
virtio-9p: Add support for removing xattr
Signed-off-by:
N
Aneesh Kumar K.V
<
aneesh.kumar@linux.vnet.ibm.com
>
上级
783f04e1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
38 addition
and
5 deletion
+38
-5
hw/file-op-9p.h
hw/file-op-9p.h
+1
-0
hw/virtio-9p-local.c
hw/virtio-9p-local.c
+17
-0
hw/virtio-9p.c
hw/virtio-9p.c
+20
-5
未找到文件。
hw/file-op-9p.h
浏览文件 @
9ed3ef26
...
...
@@ -91,6 +91,7 @@ typedef struct FileOperations
ssize_t
(
*
llistxattr
)(
FsContext
*
,
const
char
*
,
void
*
,
size_t
);
int
(
*
lsetxattr
)(
FsContext
*
,
const
char
*
,
const
char
*
,
void
*
,
size_t
,
int
);
int
(
*
lremovexattr
)(
FsContext
*
,
const
char
*
,
const
char
*
);
void
*
opaque
;
}
FileOperations
;
#endif
hw/virtio-9p-local.c
浏览文件 @
9ed3ef26
...
...
@@ -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
,
};
hw/virtio-9p.c
浏览文件 @
9ed3ef26
...
...
@@ -286,6 +286,14 @@ static int v9fs_do_lsetxattr(V9fsState *s, V9fsString *path,
xattr_name
->
data
,
value
,
size
,
flags
);
}
static
int
v9fs_do_lremovexattr
(
V9fsState
*
s
,
V9fsString
*
path
,
V9fsString
*
xattr_name
)
{
return
s
->
ops
->
lremovexattr
(
&
s
->
ctx
,
path
->
data
,
xattr_name
->
data
);
}
static
void
v9fs_string_init
(
V9fsString
*
str
)
{
str
->
data
=
NULL
;
...
...
@@ -456,10 +464,14 @@ static int v9fs_xattr_fid_clunk(V9fsState *s, V9fsFidState *fidp)
retval
=
-
EINVAL
;
goto
free_out
;
}
retval
=
v9fs_do_lsetxattr
(
s
,
&
fidp
->
path
,
&
fidp
->
fs
.
xattr
.
name
,
fidp
->
fs
.
xattr
.
value
,
fidp
->
fs
.
xattr
.
len
,
fidp
->
fs
.
xattr
.
flags
);
if
(
fidp
->
fs
.
xattr
.
len
)
{
retval
=
v9fs_do_lsetxattr
(
s
,
&
fidp
->
path
,
&
fidp
->
fs
.
xattr
.
name
,
fidp
->
fs
.
xattr
.
value
,
fidp
->
fs
.
xattr
.
len
,
fidp
->
fs
.
xattr
.
flags
);
}
else
{
retval
=
v9fs_do_lremovexattr
(
s
,
&
fidp
->
path
,
&
fidp
->
fs
.
xattr
.
name
);
}
free_out:
v9fs_string_free
(
&
fidp
->
fs
.
xattr
.
name
);
free_value:
...
...
@@ -3392,7 +3404,10 @@ static void v9fs_xattrcreate(V9fsState *s, V9fsPDU *pdu)
vs
->
xattr_fidp
->
fs
.
xattr
.
flags
=
flags
;
v9fs_string_init
(
&
vs
->
xattr_fidp
->
fs
.
xattr
.
name
);
v9fs_string_copy
(
&
vs
->
xattr_fidp
->
fs
.
xattr
.
name
,
&
vs
->
name
);
vs
->
xattr_fidp
->
fs
.
xattr
.
value
=
qemu_malloc
(
vs
->
size
);
if
(
vs
->
size
)
vs
->
xattr_fidp
->
fs
.
xattr
.
value
=
qemu_malloc
(
vs
->
size
);
else
vs
->
xattr_fidp
->
fs
.
xattr
.
value
=
NULL
;
out:
complete_pdu
(
s
,
vs
->
pdu
,
err
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录