summaryrefslogtreecommitdiffstats
path: root/src/pulse/client-conf.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2006-07-19 17:44:19 +0000
committerLennart Poettering <lennart@poettering.net>2006-07-19 17:44:19 +0000
commit9c87a65ce91c38b60c19ae108a51a2e8ce46a85c (patch)
tree36cca05b57ef1148ea16889ccdfef4536b300cb9 /src/pulse/client-conf.c
parent9db70682d68cc4fef9314677b6427582e5d5c8f2 (diff)
* add new --system command line parameter to the daemon for running PulseAudio as system-wide instance
* add PA_ prefixes to all global #defines * modify auth-by-creds: define a new group "pulse-access" which is used for authentication * add proper privilige dropping when running in --system mode * create runtime directory once on startup and not by each module seperately git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1105 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/pulse/client-conf.c')
-rw-r--r--src/pulse/client-conf.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/pulse/client-conf.c b/src/pulse/client-conf.c
index 5cebcf46..28b4f2d1 100644
--- a/src/pulse/client-conf.c
+++ b/src/pulse/client-conf.c
@@ -39,21 +39,13 @@
#include "client-conf.h"
-#ifndef DEFAULT_CONFIG_DIR
-# ifndef OS_IS_WIN32
-# define DEFAULT_CONFIG_DIR "/etc/pulse"
-# else
-# define DEFAULT_CONFIG_DIR "%PULSE_ROOT%"
-# endif
-#endif
-
#ifndef OS_IS_WIN32
# define PATH_SEP "/"
#else
# define PATH_SEP "\\"
#endif
-#define DEFAULT_CLIENT_CONFIG_FILE DEFAULT_CONFIG_DIR PATH_SEP "client.conf"
+#define DEFAULT_CLIENT_CONFIG_FILE PA_DEFAULT_CONFIG_DIR PATH_SEP "client.conf"
#define DEFAULT_CLIENT_CONFIG_FILE_USER ".pulse" PATH_SEP "client.conf"
#define ENV_CLIENT_CONFIG_FILE "PULSE_CLIENTCONFIG"
@@ -71,15 +63,17 @@ static const pa_client_conf default_conf = {
.default_server = NULL,
.autospawn = 0,
.cookie_file = NULL,
- .cookie_valid = 0
+ .cookie_valid = 0,
+ .access_group = NULL
};
pa_client_conf *pa_client_conf_new(void) {
pa_client_conf *c = pa_xmemdup(&default_conf, sizeof(default_conf));
- c->daemon_binary = pa_xstrdup(PULSEAUDIO_BINARY);
+ c->daemon_binary = pa_xstrdup(PA_BINARY);
c->extra_arguments = pa_xstrdup("--log-target=syslog --exit-idle-time=5");
c->cookie_file = pa_xstrdup(PA_NATIVE_COOKIE_FILE);
+ c->access_group = pa_xstrdup(PA_ACCESS_GROUP);
return c;
}
@@ -92,6 +86,7 @@ void pa_client_conf_free(pa_client_conf *c) {
pa_xfree(c->default_source);
pa_xfree(c->default_server);
pa_xfree(c->cookie_file);
+ pa_xfree(c->access_group);
pa_xfree(c);
}
int pa_client_conf_load(pa_client_conf *c, const char *filename) {
@@ -108,6 +103,7 @@ int pa_client_conf_load(pa_client_conf *c, const char *filename) {
{ "default-server", pa_config_parse_string, NULL },
{ "autospawn", pa_config_parse_bool, NULL },
{ "cookie-file", pa_config_parse_string, NULL },
+ { "access-group", pa_config_parse_string, NULL },
{ NULL, NULL, NULL },
};
@@ -118,6 +114,7 @@ int pa_client_conf_load(pa_client_conf *c, const char *filename) {
table[4].data = &c->default_server;
table[5].data = &c->autospawn;
table[6].data = &c->cookie_file;
+ table[7].data = &c->access_group;
f = filename ?
fopen((fn = pa_xstrdup(filename)), "r") :