Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
iSulad
提交
5524a018
I
iSulad
项目概览
openeuler
/
iSulad
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
iSulad
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5524a018
编写于
1月 02, 2020
作者:
O
openeuler-ci-bot
提交者:
Gitee
1月 02, 2020
浏览文件
操作
浏览文件
下载
差异文件
!1 iSulad: internal change in read user file
Merge pull request !1 from lifeng_isula/master
上级
93586e04
9da9d817
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
15 addition
and
14 deletion
+15
-14
src/services/execution/spec/specs_extend.c
src/services/execution/spec/specs_extend.c
+15
-14
未找到文件。
src/services/execution/spec/specs_extend.c
浏览文件 @
5524a018
...
...
@@ -468,34 +468,35 @@ out:
static
int
read_user_file
(
const
char
*
basefs
,
const
char
*
user_path
,
FILE
**
stream
)
{
int
nret
;
int
ret
=
0
;
int64_t
filesize
=
0
;
char
path
[
PATH_MAX
]
=
{
0
};
char
real_path
[
PATH_MAX
]
=
{
0
};
char
*
real_path
=
NULL
;
nret
=
snprintf
(
path
,
sizeof
(
path
),
"%s/%s"
,
basefs
,
user_path
);
if
(
nret
<
0
||
(
size_t
)
nret
>=
sizeof
(
path
))
{
ERROR
(
"Path is too long"
);
return
-
1
;
}
if
(
cleanpath
(
path
,
real_path
,
sizeof
(
real_path
))
==
NULL
)
{
ERROR
(
"Failed to clean path"
);
return
-
1
;
if
(
realpath_in_scope
(
basefs
,
user_path
,
&
real_path
)
<
0
)
{
ERROR
(
"user target file '%s' real path must be under '%s'"
,
user_path
,
basefs
);
lcrd_set_error_message
(
"user target file '%s' real path must be under '%s'"
,
user_path
,
basefs
);
ret
=
-
1
;
goto
out
;
}
filesize
=
util_file_size
(
real_path
);
if
(
filesize
>
REGULAR_FILE_SIZE
)
{
ERROR
(
"File %s is more than %lld"
,
real_path
,
(
long
long
)
REGULAR_FILE_SIZE
);
lcrd_set_error_message
(
"File %s is more than %lld"
,
real_path
,
(
long
long
)
REGULAR_FILE_SIZE
);
return
-
1
;
ret
=
-
1
;
goto
out
;
}
*
stream
=
util_fopen
(
real_path
,
"r"
);
if
(
*
stream
==
NULL
)
{
ERROR
(
"Failed to open %s: %s"
,
real_path
,
strerror
(
errno
));
return
0
;
ret
=
0
;
goto
out
;
}
return
0
;
out:
free
(
real_path
);
return
ret
;
}
static
void
parse_user_group
(
const
char
*
username
,
char
**
user
,
char
**
group
,
char
**
tmp_dup
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录