mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
Compare commits
2 commits
d09c6a3a41
...
63362a6889
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63362a6889 | ||
|
|
e729628f3a |
3 changed files with 13 additions and 0 deletions
|
|
@ -683,7 +683,11 @@ int main(int argc, char *argv[]) {
|
|||
pa_assert_not_reached();
|
||||
}
|
||||
|
||||
#ifdef HAVE_GETUID
|
||||
start_server = conf->local_server_type == PA_SERVER_TYPE_USER || (getuid() == 0 && conf->local_server_type == PA_SERVER_TYPE_SYSTEM);
|
||||
#else
|
||||
start_server = conf->local_server_type == PA_SERVER_TYPE_USER || conf->local_server_type == PA_SERVER_TYPE_SYSTEM;
|
||||
#endif
|
||||
|
||||
if (!start_server && conf->local_server_type == PA_SERVER_TYPE_SYSTEM) {
|
||||
pa_log_notice(_("System mode refused for non-root user. Only starting the D-Bus server lookup service."));
|
||||
|
|
|
|||
|
|
@ -93,9 +93,11 @@ static void add_session(struct userdata *u, const char *id) {
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_GETUID
|
||||
/* We only care about our own sessions */
|
||||
if ((uid_t) uid != getuid())
|
||||
goto fail;
|
||||
#endif
|
||||
|
||||
session = pa_xnew(struct session, 1);
|
||||
session->id = pa_xstrdup(id);
|
||||
|
|
@ -221,11 +223,13 @@ static int get_session_list(struct userdata *u) {
|
|||
goto fail;
|
||||
}
|
||||
|
||||
#ifdef HAVE_GETUID
|
||||
uid = (uint32_t) getuid();
|
||||
if (!(dbus_message_append_args(m, DBUS_TYPE_UINT32, &uid, DBUS_TYPE_INVALID))) {
|
||||
pa_log("Failed to append arguments to GetSessionsForUnixUser() method call.");
|
||||
goto fail;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!(reply = dbus_connection_send_with_reply_and_block(pa_dbus_connection_get(u->connection), m, -1, &error))) {
|
||||
pa_log("GetSessionsForUnixUser() call failed: %s: %s", error.name, error.message);
|
||||
|
|
|
|||
|
|
@ -21,6 +21,11 @@
|
|||
#include <config.h>
|
||||
#endif
|
||||
|
||||
/* To define _WIN32_WINT */
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_ARPA_INET_H) && defined(OS_IS_WIN32) && (_WIN32_WINNT < 0x0600)
|
||||
|
||||
#include <errno.h>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue