Skip to content

Commit e82ad88

Browse files
committed
logs: Use correct path and more appropriate macros in cookie-related code
filepath_tmp -> filepath in last message. More material changes to nearby code in next commit.
1 parent 6e28c76 commit e82ad88

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/httprpc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ static bool InitRPCAuthentication()
301301
if (cookie_perms_arg) {
302302
auto perm_opt = InterpretPermString(*cookie_perms_arg);
303303
if (!perm_opt) {
304-
LogInfo("Invalid -rpccookieperms=%s; must be one of 'owner', 'group', or 'all'.\n", *cookie_perms_arg);
304+
LogError("Invalid -rpccookieperms=%s; must be one of 'owner', 'group', or 'all'.", *cookie_perms_arg);
305305
return false;
306306
}
307307
cookie_perms = *perm_opt;

src/rpc/request.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,22 +108,22 @@ bool GenerateAuthCookie(std::string* cookie_out, std::optional<fs::perms> cookie
108108
fs::path filepath_tmp = GetAuthCookieFile(true);
109109
file.open(filepath_tmp);
110110
if (!file.is_open()) {
111-
LogInfo("Unable to open cookie authentication file %s for writing\n", fs::PathToString(filepath_tmp));
111+
LogWarning("Unable to open cookie authentication file %s for writing", fs::PathToString(filepath_tmp));
112112
return false;
113113
}
114114
file << cookie;
115115
file.close();
116116

117117
fs::path filepath = GetAuthCookieFile(false);
118118
if (!RenameOver(filepath_tmp, filepath)) {
119-
LogInfo("Unable to rename cookie authentication file %s to %s\n", fs::PathToString(filepath_tmp), fs::PathToString(filepath));
119+
LogWarning("Unable to rename cookie authentication file %s to %s", fs::PathToString(filepath_tmp), fs::PathToString(filepath));
120120
return false;
121121
}
122122
if (cookie_perms) {
123123
std::error_code code;
124124
fs::permissions(filepath, cookie_perms.value(), fs::perm_options::replace, code);
125125
if (code) {
126-
LogInfo("Unable to set permissions on cookie authentication file %s\n", fs::PathToString(filepath_tmp));
126+
LogWarning("Unable to set permissions on cookie authentication file %s", fs::PathToString(filepath));
127127
return false;
128128
}
129129
}

0 commit comments

Comments
 (0)