提交 93ad9c44 编写于 作者: W WangFengTu

do not print key path

Signed-off-by: NWangFengTu <wangfengtu@huawei.com>
上级 c138b0a2
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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.
先完成此消息的编辑!
想要评论请 注册