bus-proxy: it's OK if getpeercred doesn't work

We should use the data if we can (if stdin/stdout is an AF_UNIX socket),
but still work if we can't (if stdin/stdout are pipes, like in the SSH
case).

This effectively reverts 55534fb5e4
This commit is contained in:
Lennart Poettering
2014-10-24 19:29:59 +02:00
parent 455cd8b137
commit 96343c3039
+1 -6
View File
@@ -1166,12 +1166,7 @@ int main(int argc, char *argv[]) {
sd_is_socket(out_fd, AF_UNIX, 0, 0) > 0;
if (is_unix) {
r = getpeercred(in_fd, &ucred);
if (r < 0) {
log_error("Failed to get peer creds: %s", strerror(-r));
goto finish;
}
(void) getpeercred(in_fd, &ucred);
(void) getpeersec(in_fd, &peersec);
}