Skip to content

Commit 9c4b8f6

Browse files
committed
Merge remote-tracking branch 'origin/pr/175'
* origin/pr/175: daemon: log a bit more info on errors
2 parents 692209c + 5acc518 commit 9c4b8f6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

daemon/qrexec-daemon-common.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ int connect_unix_socket(const char *domname)
211211
struct sockaddr_un remote;
212212

213213
if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
214-
LOG(ERROR, "socket() failed: %m");
214+
LOGE(ERROR, "socket() failed: %m");
215215
return -1;
216216
}
217217

@@ -229,7 +229,7 @@ int connect_unix_socket(const char *domname)
229229
len = (size_t)res + 1 + offsetof(struct sockaddr_un, sun_path);
230230
if (connect(s, (struct sockaddr *) &remote, len) == -1) {
231231
int saved_errno = errno;
232-
LOG(ERROR, "connect %s", remote.sun_path);
232+
LOGE(ERROR, "connect %s", remote.sun_path);
233233
close(s);
234234
return (saved_errno == ENOENT || saved_errno == ECONNREFUSED) ? -2 : -1;
235235
}

daemon/qrexec-daemon.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,7 @@ static enum policy_response connect_daemon_socket(
10521052
pid = fork();
10531053
switch (pid) {
10541054
case -1:
1055-
LOG(ERROR, "Could not fork!");
1055+
LOGE(ERROR, "Could not fork!");
10561056
daemon__exit(QREXEC_EXIT_PROBLEM);
10571057
case 0:
10581058
if (close(fds[0]))
@@ -1093,7 +1093,7 @@ static enum policy_response connect_daemon_socket(
10931093
}
10941094
} while (!WIFEXITED(status));
10951095
if (WEXITSTATUS(status) != 0) {
1096-
LOG(ERROR, "qrexec-policy-exec failed");
1096+
LOG(ERROR, "qrexec-policy-exec failed: %d", WEXITSTATUS(status));
10971097
daemon__exit(QREXEC_EXIT_PROBLEM);
10981098
}
10991099
// This leaks 'result', but as the code execs later anyway this isn't a problem.

0 commit comments

Comments
 (0)