Accepting request 316474 from multimedia:libs

1

OBS-URL: https://build.opensuse.org/request/show/316474
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/alsa-utils?expand=0&rev=99
This commit is contained in:
Stephan Kulow 2015-07-16 15:16:52 +00:00 committed by Git OBS Bridge
commit 747e66a539
5 changed files with 114 additions and 0 deletions

View File

@ -0,0 +1,29 @@
From 9aa5c271f4eb2e3481b4a5076eb025242215ad7f Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Wed, 29 Apr 2015 18:01:07 +0200
Subject: [PATCH] aplay: Fix type for signal flag
A flag used in signal handlers has to be a special atomic type,
volatile sig_atomic_t.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
aplay/aplay.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/aplay/aplay.c b/aplay/aplay.c
index e58e1bcbdd7e..dfa1a0a95867 100644
--- a/aplay/aplay.c
+++ b/aplay/aplay.c
@@ -107,7 +107,7 @@ static snd_pcm_stream_t stream = SND_PCM_STREAM_PLAYBACK;
static int mmap_flag = 0;
static int interleaved = 1;
static int nonblock = 0;
-static int in_aborting = 0;
+static volatile sig_atomic_t in_aborting = 0;
static u_char *audiobuf = NULL;
static snd_pcm_uframes_t chunk_size = 0;
static unsigned period_time = 0;
--
2.4.5

View File

@ -0,0 +1,35 @@
From 46b60827568ca4aad15eeacbc9dcf8597986ca8e Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Wed, 29 Apr 2015 18:01:58 +0200
Subject: [PATCH] aplay: Fix uninterruptible aplay
When aplay is invoked to play from stdin, it can't be terminated by
normal signals like SIGTERM or SIGINT. It's because our signal
handler tries to trap as much as possible while the stalling point is
not in the PCM loop but rather the file I/O.
For fixing this, leave our signal handler once when a signal is
received and snd_pcm_abort() is called. At the next hit, it shall be
handled normally.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
aplay/aplay.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/aplay/aplay.c b/aplay/aplay.c
index dfa1a0a95867..459f7dd6f667 100644
--- a/aplay/aplay.c
+++ b/aplay/aplay.c
@@ -399,7 +399,7 @@ static void signal_handler(int sig)
handle = NULL;
prg_exit(EXIT_FAILURE);
}
- signal(sig, signal_handler);
+ signal(sig, SIG_DFL);
}
/* call on SIGUSR1 signal. */
--
2.4.5

View File

@ -0,0 +1,35 @@
From 13c826941445a66ece203a09e6739c979ac5900c Mon Sep 17 00:00:00 2001
From: Tobias Stoeckmann <tobias@stoeckmann.org>
Date: Sat, 11 Jul 2015 13:23:57 +0200
Subject: [PATCH] alsactl: terminate readlink result string
readlink does not guarantee that its result string is nul-terminated.
Instead, increase the buffer by one byte to make sure that we can
add '\0' at the end.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
alsactl/init_sysfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/alsactl/init_sysfs.c b/alsactl/init_sysfs.c
index 0cbada2e169b..5c789b61b0e5 100644
--- a/alsactl/init_sysfs.c
+++ b/alsactl/init_sysfs.c
@@ -108,11 +108,11 @@ static char *sysfs_attr_get_value(const char *devpath, const char *attr_name)
if (S_ISLNK(statbuf.st_mode)) {
/* links return the last element of the target path */
- char link_target[PATH_SIZE];
+ char link_target[PATH_SIZE + 1];
int len;
const char *pos;
- len = readlink(path_full, link_target, sizeof(link_target));
+ len = readlink(path_full, link_target, sizeof(link_target) - 1);
if (len > 0) {
link_target[len] = '\0';
pos = strrchr(link_target, '/');
--
2.4.5

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Mon Jul 13 16:41:51 CEST 2015 - tiwai@suse.de
- Backport upstream fixes for aplay signal handling and alsactl
possible buffer overflow of readlink():
0004-aplay-Fix-type-for-signal-flag.patch
0005-aplay-Fix-uninterruptible-aplay.patch
0006-alsactl-terminate-readlink-result-string.patch
-------------------------------------------------------------------
Mon Apr 27 21:41:13 CEST 2015 - tiwai@suse.de

View File

@ -48,6 +48,9 @@ Source1: 01beep.conf
Patch1: 0001-amixer-Don-t-set-only-the-first-item-in-sset_enum.patch
Patch2: 0002-amixer-expand-local-storage-for-item-name-according-.patch
Patch3: 0003-alsa-info-Don-t-try-update-when-wget-isn-t-available.patch
Patch4: 0004-aplay-Fix-type-for-signal-flag.patch
Patch5: 0005-aplay-Fix-uninterruptible-aplay.patch
Patch6: 0006-alsactl-terminate-readlink-result-string.patch
#
Patch99: alsa-utils-gettext-version-removal.diff
BuildRequires: alsa-devel
@ -78,6 +81,9 @@ sed -i -e's/EXTRA_DIST= config.rpath /EXTRA_DIST=/' Makefile.am
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
#
%if 0%{?suse_version} < 1020
%patch99 -p1