mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-05 13:29:57 -05:00
* add new function pa_check_in_group()
* abstract credential APis a little bit by introducing HAVE_CREDS and a structure pa_creds * rework credential authentication * fix module-volume-restore and friends for usage in system-wide instance * remove loopback= argument from moulde-*-protocol-tcp since it is a superset of listen= and usually a bad idea anyway since the user shouldn't load the TCP module at all if he doesn't want remote access * rename a few variables in the jack modules to make sure they don't conflict with symbols defined in the system headers * add server address for system-wide daemons to the default server list for the the client libs * update todo git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1109 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
340803b30c
commit
a382492204
24 changed files with 222 additions and 134 deletions
|
|
@ -242,7 +242,7 @@ int pa__init(pa_core *c, pa_module*m) {
|
|||
jack_status_t status;
|
||||
const char *server_name, *client_name;
|
||||
uint32_t channels = 0;
|
||||
int connect = 1;
|
||||
int do_connect = 1;
|
||||
unsigned i;
|
||||
const char **ports = NULL, **p;
|
||||
|
||||
|
|
@ -256,7 +256,7 @@ int pa__init(pa_core *c, pa_module*m) {
|
|||
goto fail;
|
||||
}
|
||||
|
||||
if (pa_modargs_get_value_boolean(ma, "connect", &connect) < 0) {
|
||||
if (pa_modargs_get_value_boolean(ma, "connect", &do_connect) < 0) {
|
||||
pa_log(__FILE__": failed to parse connect= argument.");
|
||||
goto fail;
|
||||
}
|
||||
|
|
@ -339,7 +339,7 @@ int pa__init(pa_core *c, pa_module*m) {
|
|||
goto fail;
|
||||
}
|
||||
|
||||
if (connect) {
|
||||
if (do_connect) {
|
||||
for (i = 0, p = ports; i < ss.channels; i++, p++) {
|
||||
|
||||
if (!*p) {
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ int pa__init(pa_core *c, pa_module*m) {
|
|||
jack_status_t status;
|
||||
const char *server_name, *client_name;
|
||||
uint32_t channels = 0;
|
||||
int connect = 1;
|
||||
int do_connect = 1;
|
||||
unsigned i;
|
||||
const char **ports = NULL, **p;
|
||||
|
||||
|
|
@ -254,7 +254,7 @@ int pa__init(pa_core *c, pa_module*m) {
|
|||
goto fail;
|
||||
}
|
||||
|
||||
if (pa_modargs_get_value_boolean(ma, "connect", &connect) < 0) {
|
||||
if (pa_modargs_get_value_boolean(ma, "connect", &do_connect) < 0) {
|
||||
pa_log(__FILE__": failed to parse connect= argument.");
|
||||
goto fail;
|
||||
}
|
||||
|
|
@ -337,7 +337,7 @@ int pa__init(pa_core *c, pa_module*m) {
|
|||
goto fail;
|
||||
}
|
||||
|
||||
if (connect) {
|
||||
if (do_connect) {
|
||||
for (i = 0, p = ports; i < ss.channels; i++, p++) {
|
||||
|
||||
if (!*p) {
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ PA_MODULE_VERSION(PACKAGE_VERSION)
|
|||
#define WHITESPACE "\n\r \t"
|
||||
|
||||
#define DEFAULT_MATCH_TABLE_FILE PA_DEFAULT_CONFIG_DIR"/match.table"
|
||||
#define DEFAULT_MATCH_TABLE_FILE_USER ".pulse/match.table"
|
||||
#define DEFAULT_MATCH_TABLE_FILE_USER "match.table"
|
||||
|
||||
static const char* const valid_modargs[] = {
|
||||
"table",
|
||||
|
|
|
|||
|
|
@ -52,10 +52,11 @@
|
|||
#include <pulsecore/modargs.h>
|
||||
#include <pulsecore/log.h>
|
||||
#include <pulsecore/native-common.h>
|
||||
#include <pulsecore/creds.h>
|
||||
|
||||
#ifdef USE_TCP_SOCKETS
|
||||
#define SOCKET_DESCRIPTION "(TCP sockets)"
|
||||
#define SOCKET_USAGE "port=<TCP port number> loopback=<listen on loopback device only?> listen=<address to listen on>"
|
||||
#define SOCKET_USAGE "port=<TCP port number> listen=<address to listen on>"
|
||||
#else
|
||||
#define SOCKET_DESCRIPTION "(UNIX sockets)"
|
||||
#define SOCKET_USAGE "socket=<path to UNIX socket>"
|
||||
|
|
@ -127,9 +128,9 @@
|
|||
#include "module-native-protocol-unix-symdef.h"
|
||||
#endif
|
||||
|
||||
#if defined(SCM_CREDENTIALS) && !defined(USE_TCP_SOCKETS)
|
||||
#define MODULE_ARGUMENTS MODULE_ARGUMENTS_COMMON "auth-group",
|
||||
#define AUTH_USAGE "auth-group=<local group to allow access>"
|
||||
#if defined(HAVE_CREDS) && !defined(USE_TCP_SOCKETS)
|
||||
#define MODULE_ARGUMENTS MODULE_ARGUMENTS_COMMON "auth-group", "auth-group-enable="
|
||||
#define AUTH_USAGE "auth-group=<system group to allow access> auth-group-enable=<enable auth by UNIX group?> "
|
||||
#else
|
||||
#define MODULE_ARGUMENTS MODULE_ARGUMENTS_COMMON
|
||||
#define AUTH_USAGE
|
||||
|
|
@ -171,7 +172,6 @@ static const char* const valid_modargs[] = {
|
|||
MODULE_ARGUMENTS
|
||||
#if defined(USE_TCP_SOCKETS)
|
||||
"port",
|
||||
"loopback",
|
||||
"listen",
|
||||
#else
|
||||
"socket",
|
||||
|
|
@ -197,7 +197,6 @@ int pa__init(pa_core *c, pa_module*m) {
|
|||
|
||||
#if defined(USE_TCP_SOCKETS)
|
||||
pa_socket_server *s_ipv4 = NULL, *s_ipv6 = NULL;
|
||||
int loopback = 1;
|
||||
uint32_t port = IPV4_PORT;
|
||||
const char *listen_on;
|
||||
#else
|
||||
|
|
@ -216,11 +215,6 @@ int pa__init(pa_core *c, pa_module*m) {
|
|||
u = pa_xnew0(struct userdata, 1);
|
||||
|
||||
#if defined(USE_TCP_SOCKETS)
|
||||
if (pa_modargs_get_value_boolean(ma, "loopback", &loopback) < 0) {
|
||||
pa_log(__FILE__": loopback= expects a boolean argument.");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (pa_modargs_get_value_u32(ma, "port", &port) < 0 || port < 1 || port > 0xFFFF) {
|
||||
pa_log(__FILE__": port= expects a numerical argument between 1 and 65535.");
|
||||
goto fail;
|
||||
|
|
@ -231,9 +225,6 @@ int pa__init(pa_core *c, pa_module*m) {
|
|||
if (listen_on) {
|
||||
s_ipv6 = pa_socket_server_new_ipv6_string(c->mainloop, listen_on, port, TCPWRAP_SERVICE);
|
||||
s_ipv4 = pa_socket_server_new_ipv4_string(c->mainloop, listen_on, port, TCPWRAP_SERVICE);
|
||||
} else if (loopback) {
|
||||
s_ipv6 = pa_socket_server_new_ipv6_loopback(c->mainloop, port, TCPWRAP_SERVICE);
|
||||
s_ipv4 = pa_socket_server_new_ipv4_loopback(c->mainloop, port, TCPWRAP_SERVICE);
|
||||
} else {
|
||||
s_ipv6 = pa_socket_server_new_ipv6_any(c->mainloop, port, TCPWRAP_SERVICE);
|
||||
s_ipv4 = pa_socket_server_new_ipv4_any(c->mainloop, port, TCPWRAP_SERVICE);
|
||||
|
|
|
|||
|
|
@ -611,7 +611,7 @@ static void pstream_die_callback(pa_pstream *p, void *userdata) {
|
|||
}
|
||||
|
||||
|
||||
static void pstream_packet_callback(pa_pstream *p, pa_packet *packet, const struct ucred *creds, void *userdata) {
|
||||
static void pstream_packet_callback(pa_pstream *p, pa_packet *packet, const pa_creds *creds, void *userdata) {
|
||||
struct userdata *u = userdata;
|
||||
assert(p && packet && u);
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ PA_MODULE_VERSION(PACKAGE_VERSION)
|
|||
|
||||
#define WHITESPACE "\n\r \t"
|
||||
|
||||
#define DEFAULT_VOLUME_TABLE_FILE ".pulse/volume.table"
|
||||
#define DEFAULT_VOLUME_TABLE_FILE "volume.table"
|
||||
|
||||
static const char* const valid_modargs[] = {
|
||||
"table",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue