[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.19-501-g678f12d
Colin Guthrie
gitmailer-noreply at 0pointer.de
Sat May 8 06:28:01 PDT 2010
This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.
The master branch has been updated
from abb05d610d981fd8d4f3408a718da79f25a4e87e (commit)
- Log -----------------------------------------------------------------
678f12d rtp: Fix bracketing in pa_rtp_recv.
74591da socket-client: properly handle asyncns failures
dfcaa93 intended-roles: Do not pick monitor sources when doing automatic role-based device selection
f7b2627 alsa: Handle 'Digital Mic' as an 'Input Source'
87fdbb5 core-util: ensure that we chmod only the dir we ourselves created
-----------------------------------------------------------------------
Summary of changes:
configure.ac | 2 +-
.../alsa/mixer/paths/analog-input.conf.common | 4 ++
src/modules/module-intended-roles.c | 13 ++++++-
src/modules/rtp/rtp.c | 4 +-
src/pulsecore/core-util.c | 39 +++++++++++++++++---
src/pulsecore/socket-client.c | 3 +-
6 files changed, 55 insertions(+), 10 deletions(-)
-----------------------------------------------------------------------
commit 87fdbb544b9459c343a5bd3278319d5a0dd60e79
Author: Kees Cook <kees at ubuntu.com>
Date: Tue Mar 2 21:33:34 2010 -0800
core-util: ensure that we chmod only the dir we ourselves created
diff --git a/configure.ac b/configure.ac
index 48ce1c6..abb8dae 100644
--- a/configure.ac
+++ b/configure.ac
@@ -439,7 +439,7 @@ AC_CHECK_FUNCS_ONCE([lrintf strtof])
AC_FUNC_FORK
AC_FUNC_GETGROUPS
AC_FUNC_SELECT_ARGTYPES
-AC_CHECK_FUNCS_ONCE([chmod chown clock_gettime getaddrinfo getgrgid_r getgrnam_r \
+AC_CHECK_FUNCS_ONCE([chmod chown fstat fchown fchmod clock_gettime getaddrinfo getgrgid_r getgrnam_r \
getpwnam_r getpwuid_r gettimeofday getuid inet_ntop inet_pton mlock nanosleep \
pipe posix_fadvise posix_madvise posix_memalign setpgid setsid shm_open \
sigaction sleep sysconf pthread_setaffinity_np])
diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index 323c98d..effc598 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -199,7 +199,7 @@ void pa_make_fd_cloexec(int fd) {
/** Creates a directory securely */
int pa_make_secure_dir(const char* dir, mode_t m, uid_t uid, gid_t gid) {
struct stat st;
- int r, saved_errno;
+ int r, saved_errno, fd;
pa_assert(dir);
@@ -217,16 +217,45 @@ int pa_make_secure_dir(const char* dir, mode_t m, uid_t uid, gid_t gid) {
if (r < 0 && errno != EEXIST)
return -1;
-#ifdef HAVE_CHOWN
+#ifdef HAVE_FSTAT
+ if ((fd = open(dir,
+#ifdef O_CLOEXEC
+ O_CLOEXEC|
+#endif
+#ifdef O_NOCTTY
+ O_NOCTTY|
+#endif
+#ifdef O_NOFOLLOW
+ O_NOFOLLOW|
+#endif
+ O_RDONLY)) < 0)
+ goto fail;
+
+ if (fstat(fd, &st) < 0) {
+ pa_assert_se(pa_close(fd) >= 0);
+ goto fail;
+ }
+
+ if (!S_ISDIR(st.st_mode)) {
+ pa_assert_se(pa_close(fd) >= 0);
+ errno = EEXIST;
+ goto fail;
+ }
+
+#ifdef HAVE_FCHOWN
if (uid == (uid_t)-1)
uid = getuid();
if (gid == (gid_t)-1)
gid = getgid();
- (void) chown(dir, uid, gid);
+ (void) fchown(fd, uid, gid);
+#endif
+
+#ifdef HAVE_FCHMOD
+ (void) fchmod(fd, m);
#endif
-#ifdef HAVE_CHMOD
- chmod(dir, m);
+ pa_assert_se(pa_close(fd) >= 0);
+
#endif
#ifdef HAVE_LSTAT
commit f7b262763a995b802e85c3cf66bb2fb11bea17ff
Author: Daniel T Chen <crimsun at ubuntu.com>
Date: Wed Mar 10 18:14:11 2010 -0500
alsa: Handle 'Digital Mic' as an 'Input Source'
BugLink: https://launchpad.net/bugs/533877
Some laptops have 'Digital Mic' exposed as an 'Input Source', e.g., Dell
XPS 1330, so handle these, too.
diff --git a/src/modules/alsa/mixer/paths/analog-input.conf.common b/src/modules/alsa/mixer/paths/analog-input.conf.common
index 66c3dda..6c5fae9 100644
--- a/src/modules/alsa/mixer/paths/analog-input.conf.common
+++ b/src/modules/alsa/mixer/paths/analog-input.conf.common
@@ -62,6 +62,10 @@ priority = 5
[Element Input Source]
enumeration = select
+[Option Input Source:Digital Mic]
+name = input-microphone
+priority = 20
+
[Option Input Source:Mic]
name = input-microphone
priority = 20
commit dfcaa9325c9f70a17192a8dd212982dee95b3072
Author: Colin Guthrie <cguthrie at mandriva.org>
Date: Wed Mar 17 15:30:32 2010 +0000
intended-roles: Do not pick monitor sources when doing automatic role-based device selection
diff --git a/src/modules/module-intended-roles.c b/src/modules/module-intended-roles.c
index b9924df..78a2c49 100644
--- a/src/modules/module-intended-roles.c
+++ b/src/modules/module-intended-roles.c
@@ -123,6 +123,7 @@ static pa_hook_result_t sink_input_new_hook_callback(pa_core *c, pa_sink_input_n
return PA_HOOK_OK;
}
+ /* @todo: favour the highest priority device, not the first one we find? */
PA_IDXSET_FOREACH(s, c->sinks, idx) {
if (s == def)
continue;
@@ -173,12 +174,16 @@ static pa_hook_result_t source_output_new_hook_callback(pa_core *c, pa_source_ou
}
PA_IDXSET_FOREACH(s, c->sources, idx) {
+ if (s->monitor_of)
+ continue;
+
if (s == def)
continue;
if (!PA_SOURCE_IS_LINKED(pa_source_get_state(s)))
continue;
+ /* @todo: favour the highest priority device, not the first one we find? */
if (role_match(s->proplist, role)) {
new_data->source = s;
new_data->save_source = FALSE;
@@ -242,6 +247,9 @@ static pa_hook_result_t source_put_hook_callback(pa_core *c, pa_source *source,
pa_assert(u);
pa_assert(u->on_hotplug);
+ if (source->monitor_of)
+ return PA_HOOK_OK;
+
PA_IDXSET_FOREACH(so, c->source_outputs, idx) {
const char *role;
@@ -315,6 +323,7 @@ static pa_hook_result_t sink_unlink_hook_callback(pa_core *c, pa_sink *sink, str
continue;
/* Try to find some other fitting sink */
+ /* @todo: favour the highest priority device, not the first one we find? */
PA_IDXSET_FOREACH(d, c->sinks, jdx) {
if (d == def || d == sink)
continue;
@@ -370,6 +379,7 @@ static pa_hook_result_t source_unlink_hook_callback(pa_core *c, pa_source *sourc
}
/* Try to find some other fitting source */
+ /* @todo: favour the highest priority device, not the first one we find? */
PA_IDXSET_FOREACH(d, c->sources, jdx) {
if (d == def || d == source)
continue;
@@ -377,7 +387,8 @@ static pa_hook_result_t source_unlink_hook_callback(pa_core *c, pa_source *sourc
if (!PA_SOURCE_IS_LINKED(pa_source_get_state(d)))
continue;
- if (role_match(d->proplist, role) && !source->monitor_of == !d->monitor_of) {
+ /* If moving from a monitor, move to another monitor */
+ if (!source->monitor_of == !d->monitor_of && role_match(d->proplist, role)) {
pa_source_output_move_to(so, d, FALSE);
break;
}
commit 74591da68be69f4a4853dbc1d12e7ca5fb8af4cf
Author: Jez Austin <jezaustin at gmail.com>
Date: Mon Mar 22 16:09:34 2010 +0100
socket-client: properly handle asyncns failures
We fail to detect when people disable IPv6 in there kernels. This patch
makes sure we don't ignore this error condition.
http://pulseaudio.org/ticket/752
https://bugzilla.mozilla.org/show_bug.cgi?id=533470
http://bugs.freedesktop.org/show_bug.cgi?id=25742
diff --git a/src/pulsecore/socket-client.c b/src/pulsecore/socket-client.c
index ef3c29e..7c449be 100644
--- a/src/pulsecore/socket-client.c
+++ b/src/pulsecore/socket-client.c
@@ -387,7 +387,8 @@ static void asyncns_cb(pa_mainloop_api*m, pa_io_event *e, int fd, pa_io_event_fl
goto fail;
if (res->ai_addr)
- sockaddr_prepare(c, res->ai_addr, res->ai_addrlen);
+ if (sockaddr_prepare(c, res->ai_addr, res->ai_addrlen) < 0)
+ goto fail;
asyncns_freeaddrinfo(res);
commit 678f12d0568a50ce81626ca87998da983491be13
Author: Colin Guthrie <cguthrie at mandriva.org>
Date: Sat May 8 13:47:19 2010 +0100
rtp: Fix bracketing in pa_rtp_recv.
The syntactically correct error meant that the timestamp was always
marked as found and only the first header was checked.
In the case where the timestamp was the first header, things
would have worked as expected.
Thanks to pino for reporting via bug refs #818
diff --git a/src/modules/rtp/rtp.c b/src/modules/rtp/rtp.c
index 6706a10..74f0ac3 100644
--- a/src/modules/rtp/rtp.c
+++ b/src/modules/rtp/rtp.c
@@ -278,8 +278,8 @@ int pa_rtp_recv(pa_rtp_context *c, pa_memchunk *chunk, pa_mempool *pool, struct
pa_memchunk_reset(&c->memchunk);
}
- for (cm = CMSG_FIRSTHDR(&m); cm; cm = CMSG_NXTHDR(&m, cm)) {
- if (cm->cmsg_level == SOL_SOCKET && cm->cmsg_type == SO_TIMESTAMP)
+ for (cm = CMSG_FIRSTHDR(&m); cm; cm = CMSG_NXTHDR(&m, cm))
+ if (cm->cmsg_level == SOL_SOCKET && cm->cmsg_type == SO_TIMESTAMP) {
memcpy(tstamp, CMSG_DATA(cm), sizeof(struct timeval));
found_tstamp = TRUE;
break;
--
hooks/post-receive
PulseAudio Sound Server
More information about the pulseaudio-commits
mailing list