Hello community,

here is the log from the commit of package alsa-utils for openSUSE:Factory 
checked in at 2015-04-30 11:49:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/alsa-utils (Old)
 and      /work/SRC/openSUSE:Factory/.alsa-utils.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "alsa-utils"

Changes:
--------
--- /work/SRC/openSUSE:Factory/alsa-utils/alsa-utils.changes    2015-03-05 
18:15:42.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.alsa-utils.new/alsa-utils.changes       
2015-04-30 11:49:40.000000000 +0200
@@ -1,0 +2,9 @@
+Mon Apr 27 21:41:13 CEST 2015 - ti...@suse.de
+
+- Backport upstream fixes, including the fix for alsa-info
+  (boo#928394):
+  0001-amixer-Don-t-set-only-the-first-item-in-sset_enum.patch
+  0002-amixer-expand-local-storage-for-item-name-according-.patch
+  0003-alsa-info-Don-t-try-update-when-wget-isn-t-available.patch
+
+-------------------------------------------------------------------

New:
----
  0001-amixer-Don-t-set-only-the-first-item-in-sset_enum.patch
  0002-amixer-expand-local-storage-for-item-name-according-.patch
  0003-alsa-info-Don-t-try-update-when-wget-isn-t-available.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ alsa-utils.spec ++++++
--- /var/tmp/diff_new_pack.fb79iX/_old  2015-04-30 11:49:41.000000000 +0200
+++ /var/tmp/diff_new_pack.fb79iX/_new  2015-04-30 11:49:41.000000000 +0200
@@ -45,6 +45,9 @@
 Source1:        01beep.conf
 # Patch:          alsa-utils-git-fixes.diff
 # upstream fix patches
+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
 #
 Patch99:        alsa-utils-gettext-version-removal.diff
 BuildRequires:  alsa-devel
@@ -72,6 +75,9 @@
 sed -i -e's/EXTRA_DIST= config.rpath /EXTRA_DIST=/' Makefile.am
 # rm -f po/Makefile* po/*.gmo po/*.pot po/*.header po/stamp-*
 # patch -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
 #
 %if 0%{?suse_version} < 1020
 %patch99 -p1

++++++ 0001-amixer-Don-t-set-only-the-first-item-in-sset_enum.patch ++++++
>From 1a19ec15385033b59ebfffec954034680575a003 Mon Sep 17 00:00:00 2001
From: Peter Meerwald <p.meerw...@bct-electronic.com>
Date: Tue, 3 Mar 2015 18:39:52 +0100
Subject: [PATCH 1/3] amixer: Don't set only the first item in sset_enum()

Signed-off-by: Peter Meerwald <pme...@pmeerw.net>
Signed-off-by: Takashi Iwai <ti...@suse.de>
---
 amixer/amixer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/amixer/amixer.c b/amixer/amixer.c
index ed60e7c3a960..36c92eb99bc9 100644
--- a/amixer/amixer.c
+++ b/amixer/amixer.c
@@ -1278,7 +1278,7 @@ static int get_enum_item_index(snd_mixer_elem_t *elem, 
char **ptrp)
 
 static int sset_enum(snd_mixer_elem_t *elem, unsigned int argc, char **argv)
 {
-       unsigned int idx, chn = 0;
+       unsigned int idx, item = 0;
        int check_flag = ignore_error ? 0 : -1;
 
        for (idx = 1; idx < argc; idx++) {
@@ -1287,7 +1287,7 @@ static int sset_enum(snd_mixer_elem_t *elem, unsigned int 
argc, char **argv)
                        int ival = get_enum_item_index(elem, &ptr);
                        if (ival < 0)
                                return check_flag;
-                       if (snd_mixer_selem_set_enum_item(elem, chn, ival) >= 0)
+                       if (snd_mixer_selem_set_enum_item(elem, item++, ival) 
>= 0)
                                check_flag = 1;
                        /* skip separators */
                        while (*ptr == ',' || isspace(*ptr))
-- 
2.3.5

++++++ 0002-amixer-expand-local-storage-for-item-name-according-.patch ++++++
>From f3abdeea00ef7cc07cb44aa43701a278b9c4692f Mon Sep 17 00:00:00 2001
From: Takashi Sakamoto <o-taka...@sakamocchi.jp>
Date: Thu, 9 Apr 2015 01:30:56 +0900
Subject: [PATCH 2/3] amixer: expand local storage for item name according to
 kernel code

According to kernel code (snd_ctl_elem_init_enum_names() in
sound/core/control.c), the maximum length of item name is 63 characters
(+ 1 terminator = 64 bytes). But current amixer implementation
uses 40 bytes. This causes name truncation and fail to operation.

This commit fixes this bug by expanding the length of local variables.

Signed-off-by: Takashi Sakamoto <o-taka...@sakamocchi.jp>
Signed-off-by: Takashi Iwai <ti...@suse.de>
---
 amixer/amixer.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/amixer/amixer.c b/amixer/amixer.c
index 36c92eb99bc9..db1849333da3 100644
--- a/amixer/amixer.c
+++ b/amixer/amixer.c
@@ -812,7 +812,11 @@ static int show_selem(snd_mixer_t *handle, 
snd_mixer_selem_id_t *id, const char
                if (snd_mixer_selem_is_enumerated(elem)) {
                        int i, items;
                        unsigned int idx;
-                       char itemname[40];
+                       /*
+                        * See snd_ctl_elem_init_enum_names() in
+                        * sound/core/control.c.
+                        */
+                       char itemname[64];
                        items = snd_mixer_selem_get_enum_items(elem);
                        printf("  Items:");
                        for (i = 0; i < items; i++) {
@@ -1255,7 +1259,9 @@ static int get_enum_item_index(snd_mixer_elem_t *elem, 
char **ptrp)
 {
        char *ptr = *ptrp;
        int items, i, len;
-       char name[40];
+
+       /* See snd_ctl_elem_init_enum_names() in sound/core/control.c. */
+       char name[64];
        
        items = snd_mixer_selem_get_enum_items(elem);
        if (items <= 0)
@@ -1264,6 +1270,7 @@ static int get_enum_item_index(snd_mixer_elem_t *elem, 
char **ptrp)
        for (i = 0; i < items; i++) {
                if (snd_mixer_selem_get_enum_item_name(elem, i, sizeof(name)-1, 
name) < 0)
                        continue;
+
                len = strlen(name);
                if (! strncmp(name, ptr, len)) {
                        if (! ptr[len] || ptr[len] == ',' || ptr[len] == '\n') {
-- 
2.3.5

++++++ 0003-alsa-info-Don-t-try-update-when-wget-isn-t-available.patch ++++++
>From 8188c2466a7d2179aba4e243ff2b85363961f9f1 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <ti...@suse.de>
Date: Mon, 27 Apr 2015 21:27:05 +0200
Subject: [PATCH 3/3] alsa-info: Don't try update when wget isn't available

... otherwise it overwrites a zero size file.  Also add a check of
zero size file in the update procedure, too.

Signed-off-by: Takashi Iwai <ti...@suse.de>
---
 alsa-info/alsa-info.sh | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/alsa-info/alsa-info.sh b/alsa-info/alsa-info.sh
index acd849588141..0bc4cd0612fb 100755
--- a/alsa-info/alsa-info.sh
+++ b/alsa-info/alsa-info.sh
@@ -35,6 +35,8 @@ BGTITLE="ALSA-Info v $SCRIPT_VERSION"
 PASTEBINKEY="C9cRIO8m/9y8Cs0nVs0FraRx7U0pHsuc"
 #Define some simple functions
 
+WGET=$(which wget 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null)
+
 pbcheck(){
        [[ $UPLOAD = "no" ]] && return
 
@@ -46,10 +48,12 @@ pbcheck(){
 }
 
 update() {
+       test -z "$WGET" -o ! -x "$WGET" && return
+
        SHFILE=`mktemp -t alsa-info.XXXXXXXXXX` || exit 1
        wget -O $SHFILE "http://www.alsa-project.org/alsa-info.sh"; >/dev/null 
2>&1
        REMOTE_VERSION=`grep SCRIPT_VERSION $SHFILE |head -n1 |sed 's/.*=//'`
-       if [ "$REMOTE_VERSION" != "$SCRIPT_VERSION" ]; then
+       if [ -s "$SHFILE" -a "$REMOTE_VERSION" != "$SCRIPT_VERSION" ]; then
                if [[ -n $DIALOG ]]
                then
                        OVERWRITE=
@@ -831,8 +835,7 @@ if [ "$UPLOAD" = "no" ]; then
 fi # UPLOAD
 
 #Test that wget is installed, and supports --post-file. Upload $FILE if it 
does, and prompt user to upload file if it doesnt. 
-if
-WGET=$(which wget 2>/dev/null| sed 's|^[^/]*||' 2>/dev/null); [[ -n "${WGET}" 
]] && [[ -x "${WGET}" ]] && [[ `wget --help |grep post-file` ]]
+if [[ -n "${WGET}" ]] && [[ -x "${WGET}" ]] && [[ `wget --help |grep 
post-file` ]]
 then
 
 if [[ -n $DIALOG ]]
-- 
2.3.5


Reply via email to