summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2009-03-12 10:31:54 -0400
committerColin Walters <walters@verbum.org>2009-05-06 12:51:17 -0400
commita709566edd8358ba431b7427a1530a7db0d1832d (patch)
tree05a5432222f64981237b618ecef0fbd1b32a141a
parentb5a1f3c54a48ea3079622b0ec3023c79b95ed135 (diff)
Always append closing quote in log command
Patch suggested by Tomas Hoger <thoger@redhat.com>
-rw-r--r--bus/connection.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/bus/connection.c b/bus/connection.c
index ab99fa5f..9159c898 100644
--- a/bus/connection.c
+++ b/bus/connection.c
@@ -575,12 +575,11 @@ cache_peer_loginfo_string (BusConnectionData *d,
}
if (!_dbus_string_append_printf (&loginfo_buf, "pid=%ld comm=\"", pid))
goto oom;
- /* Ignore errors here */
- if (_dbus_command_for_pid (pid, &loginfo_buf, MAX_LOG_COMMAND_LEN, NULL))
- {
- if (!_dbus_string_append_byte (&loginfo_buf, '"'))
- goto oom;
- }
+ /* Ignore errors here; we may not have permissions to read the
+ * proc file. */
+ _dbus_command_for_pid (pid, &loginfo_buf, MAX_LOG_COMMAND_LEN, NULL);
+ if (!_dbus_string_append_byte (&loginfo_buf, '"'))
+ goto oom;
}
if (dbus_connection_get_windows_user (connection, &windows_sid))