Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
iSulad
提交
9a51609a
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,发现更多精彩内容 >>
提交
9a51609a
编写于
8月 22, 2020
作者:
O
openeuler-ci-bot
提交者:
Gitee
8月 22, 2020
浏览文件
操作
浏览文件
下载
差异文件
!663 do not print key path
Merge pull request !663 from wangfengtu/key_dir
上级
ed7060ea
93ad9c44
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
17 addition
and
20 deletion
+17
-20
src/daemon/modules/image/oci/registry/aes.c
src/daemon/modules/image/oci/registry/aes.c
+1
-1
src/daemon/modules/image/oci/registry/auths.c
src/daemon/modules/image/oci/registry/auths.c
+10
-10
src/daemon/modules/image/oci/registry/certs.c
src/daemon/modules/image/oci/registry/certs.c
+6
-9
未找到文件。
src/daemon/modules/image/oci/registry/aes.c
浏览文件 @
9a51609a
...
...
@@ -35,7 +35,7 @@ void aes_set_key_dir(char *key_dir)
sret
=
snprintf
(
path
,
sizeof
(
path
),
"%s/%s"
,
key_dir
,
AUTH_AESKEY_NAME
);
if
(
sret
<
0
||
(
size_t
)
sret
>=
sizeof
(
path
))
{
ERROR
(
"Failed to sprintf auths
%s/%s"
,
key_dir
,
AUTH_AESKEY_NAME
);
ERROR
(
"Failed to sprintf auths
"
);
return
;
}
...
...
src/daemon/modules/image/oci/registry/auths.c
浏览文件 @
9a51609a
...
...
@@ -48,7 +48,7 @@ void auths_set_dir(char *auth_dir)
sret
=
snprintf
(
path
,
sizeof
(
path
),
"%s/%s"
,
auth_dir
,
AUTH_FILE_NAME
);
if
(
sret
<
0
||
(
size_t
)
sret
>=
sizeof
(
path
))
{
ERROR
(
"Failed to sprintf auths file
, auth dir: %s"
,
auth_dir
);
ERROR
(
"Failed to sprintf auths file
"
);
return
;
}
...
...
@@ -314,22 +314,22 @@ static int write_auth_file(char *content)
auths_dir
=
util_path_dir
(
g_auth_path
);
if
(
auths_dir
==
NULL
)
{
ERROR
(
"get dir
of %s for auths failed"
,
g_auth_path
);
ERROR
(
"get dir
for auths failed"
);
ret
=
-
1
;
goto
out
;
}
ret
=
util_mkdir_p
(
auths_dir
,
0700
);
if
(
ret
!=
0
)
{
ERROR
(
"mkdir
of %s for aeskey failed"
,
auths_dir
);
isulad_try_set_error_message
(
"create direcotry
%s failed"
,
auths_dir
);
ERROR
(
"mkdir
for aeskey failed"
);
isulad_try_set_error_message
(
"create direcotry
for auths failed"
);
goto
out
;
}
ret
=
util_atomic_write_file
(
g_auth_path
,
content
,
strlen
(
content
),
AUTH_FILE_MODE
);
if
(
ret
!=
0
)
{
ERROR
(
"failed to write auths json to file
%s"
,
g_auth_path
);
isulad_try_set_error_message
(
"failed to write auths json to file
%s"
,
g_auth_path
);
ERROR
(
"failed to write auths json to file
"
);
isulad_try_set_error_message
(
"failed to write auths json to file
"
);
goto
out
;
}
...
...
@@ -478,8 +478,8 @@ int auths_delete(char *host)
auths
=
registry_auths_parse_file
(
g_auth_path
,
NULL
,
&
err
);
if
(
auths
==
NULL
)
{
ERROR
(
"failed to parse file
%s"
,
g_auth_path
);
isulad_try_set_error_message
(
"failed to parse file
%s"
,
g_auth_path
);
ERROR
(
"failed to parse file
"
);
isulad_try_set_error_message
(
"failed to parse file
"
);
ret
=
-
1
;
goto
out
;
}
...
...
@@ -498,8 +498,8 @@ int auths_delete(char *host)
ret
=
util_atomic_write_file
(
g_auth_path
,
json
,
strlen
(
json
),
AUTH_FILE_MODE
);
if
(
ret
!=
0
)
{
ERROR
(
"failed to write auths json to file
%s"
,
g_auth_path
);
isulad_try_set_error_message
(
"failed to write auths json to file
%s"
,
g_auth_path
);
ERROR
(
"failed to write auths json to file
"
);
isulad_try_set_error_message
(
"failed to write auths json to file
"
);
goto
out
;
}
...
...
src/daemon/modules/image/oci/registry/certs.c
浏览文件 @
9a51609a
...
...
@@ -83,15 +83,14 @@ static int load_certs(const char *path, const char *name, bool use_decrypted_key
*
ca_file
=
util_path_join
(
path
,
name
);
if
(
*
ca_file
==
NULL
)
{
ret
=
-
1
;
ERROR
(
"error join
%s and %s"
,
path
,
name
);
ERROR
(
"error join
ca suffix"
);
goto
out
;
}
DEBUG
(
"ca file: %s"
,
*
ca_file
);
goto
out
;
}
else
if
(
cert_file
!=
NULL
&&
*
cert_file
==
NULL
&&
util_has_suffix
(
name
,
CLIENT_CERT_SUFFIX
))
{
key_name
=
corresponding_key_name
(
name
);
if
(
key_name
==
NULL
)
{
ERROR
(
"find corresponding key name for
%s failed"
,
name
);
ERROR
(
"find corresponding key name for
cert failed"
);
ret
=
-
1
;
goto
out
;
}
...
...
@@ -99,11 +98,9 @@ static int load_certs(const char *path, const char *name, bool use_decrypted_key
*
cert_file
=
util_path_join
(
path
,
name
);
if
(
*
cert_file
==
NULL
||
*
key_file
==
NULL
)
{
ret
=
-
1
;
ERROR
(
"error join
%s and %s, or error join %s and %s"
,
path
,
name
,
path
,
key_name
);
ERROR
(
"error join
key name"
);
goto
out
;
}
DEBUG
(
"client cert file: %s"
,
*
cert_file
);
DEBUG
(
"client key file: %s"
,
*
key_file
);
goto
out
;
}
else
{
goto
out
;
...
...
@@ -139,7 +136,7 @@ int certs_load(char *host, bool use_decrypted_key, char **ca_file, char **cert_f
path
=
util_path_join
(
g_certs_dir
,
host
);
if
(
path
==
NULL
)
{
ERROR
(
"failed to join
path %s and %s when loading certs"
,
g_certs_dir
,
host
);
ERROR
(
"failed to join
certs dir when loading certs"
);
return
-
1
;
}
...
...
@@ -151,7 +148,7 @@ int certs_load(char *host, bool use_decrypted_key, char **ca_file, char **cert_f
dir
=
opendir
(
path
);
if
(
dir
==
NULL
)
{
ERROR
(
"error open
%s for reading certs for %s: %s"
,
path
,
host
,
strerror
(
errno
)
);
ERROR
(
"error open
file for reading certs"
);
ret
=
-
1
;
goto
out
;
}
...
...
@@ -174,7 +171,7 @@ int certs_load(char *host, bool use_decrypted_key, char **ca_file, char **cert_f
}
if
(
*
ca_file
==
NULL
||
*
cert_file
==
NULL
||
*
key_file
==
NULL
)
{
WARN
(
"Loaded only part of certs, continue to try"
);
ERROR
(
"Loaded only part of certs, continue to try"
);
}
out:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录