mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
fix public= on native and esound protocol
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@195 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
b681622b17
commit
b1ab6869fb
3 changed files with 19 additions and 9 deletions
1
doc/todo
1
doc/todo
|
|
@ -21,6 +21,7 @@
|
|||
- fix public=
|
||||
- fix POLYP_SERVER=foo:4711
|
||||
- fix tcp/native
|
||||
- suid
|
||||
|
||||
** later ***
|
||||
- xmlrpc/http
|
||||
|
|
|
|||
|
|
@ -995,17 +995,23 @@ static void on_connection(struct pa_socket_server*s, struct pa_iochannel *io, vo
|
|||
|
||||
struct pa_protocol_esound* pa_protocol_esound_new(struct pa_core*core, struct pa_socket_server *server, struct pa_module *m, struct pa_modargs *ma) {
|
||||
struct pa_protocol_esound *p;
|
||||
int public;
|
||||
assert(core && server && ma);
|
||||
|
||||
p = pa_xmalloc(sizeof(struct pa_protocol_esound));
|
||||
|
||||
if (pa_modargs_get_value_boolean(ma, "public", &public) < 0) {
|
||||
pa_log(__FILE__": public= expects a boolean argument.\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (pa_authkey_load_auto(pa_modargs_get_value(ma, "cookie", DEFAULT_COOKIE_FILE), p->esd_key, sizeof(p->esd_key)) < 0) {
|
||||
pa_xfree(p);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
p->module = m;
|
||||
p->public = 0;
|
||||
p->public = public;
|
||||
p->server = server;
|
||||
pa_socket_server_set_callback(p->server, on_connection, p);
|
||||
p->core = core;
|
||||
|
|
|
|||
|
|
@ -675,13 +675,16 @@ static void command_auth(struct pa_pdispatch *pd, uint32_t command, uint32_t tag
|
|||
return;
|
||||
}
|
||||
|
||||
if (memcmp(c->protocol->auth_cookie, cookie, PA_NATIVE_COOKIE_LENGTH) != 0) {
|
||||
pa_log(__FILE__": Denied access to client with invalid authorization key.\n");
|
||||
pa_pstream_send_error(c->pstream, tag, PA_ERROR_ACCESS);
|
||||
return;
|
||||
if (!c->authorized) {
|
||||
if (memcmp(c->protocol->auth_cookie, cookie, PA_NATIVE_COOKIE_LENGTH) != 0) {
|
||||
pa_log(__FILE__": Denied access to client with invalid authorization key.\n");
|
||||
pa_pstream_send_error(c->pstream, tag, PA_ERROR_ACCESS);
|
||||
return;
|
||||
}
|
||||
|
||||
c->authorized = 1;
|
||||
}
|
||||
|
||||
c->authorized = 1;
|
||||
pa_pstream_send_simple_ack(c->pstream, tag);
|
||||
return;
|
||||
}
|
||||
|
|
@ -1547,7 +1550,7 @@ static struct pa_protocol_native* protocol_new_internal(struct pa_core *c, struc
|
|||
assert(c && ma);
|
||||
|
||||
if (pa_modargs_get_value_boolean(ma, "public", &public) < 0) {
|
||||
pa_log(__FILE__": public= expects numeric argument.\n");
|
||||
pa_log(__FILE__": public= expects a boolean argument.\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue