aports/community/bluez-alsa/basename.patch
Sören Tempel a168f7ea90 community/bluez-alsa: fix implicit basename declaration
This fixes a segfault in bluealsa.

See #16106
2024-06-19 13:08:49 +00:00

87 lines
3.2 KiB
Diff

See https://gitlab.alpinelinux.org/alpine/aports/-/issues/16106
diff -upr bluez-alsa-4.2.0.orig/src/main.c bluez-alsa-4.2.0/src/main.c
--- bluez-alsa-4.2.0.orig/src/main.c 2024-06-18 22:50:31.575782443 +0200
+++ bluez-alsa-4.2.0/src/main.c 2024-06-18 22:52:48.980410097 +0200
@@ -53,6 +53,10 @@
#include "shared/log.h"
#include "shared/nv.h"
+/* GNU basename version */
+#define basename(path) \
+ (strrchr((path),'/') ? strrchr((path),'/')+1 : (path))
+
/* If glib does not support immediate return in case of bus
* name being owned by some other connection (glib < 2.54),
* fall back to a default behavior - enter waiting queue. */
diff -upr bluez-alsa-4.2.0.orig/src/shared/log.c bluez-alsa-4.2.0/src/shared/log.c
--- bluez-alsa-4.2.0.orig/src/shared/log.c 2024-06-18 22:50:31.585782498 +0200
+++ bluez-alsa-4.2.0/src/shared/log.c 2024-06-18 22:53:02.423765453 +0200
@@ -35,6 +35,10 @@
#include "shared/defs.h"
#include "shared/rt.h"
+/* GNU basename version */
+#define basename(path) \
+ (strrchr((path),'/') ? strrchr((path),'/')+1 : (path))
+
/* internal logging identifier */
static char *_ident = NULL;
/* if true, system logging is enabled */
diff -upr bluez-alsa-4.2.0.orig/test/mock/mock.c bluez-alsa-4.2.0/test/mock/mock.c
--- bluez-alsa-4.2.0.orig/test/mock/mock.c 2024-06-18 22:50:31.599115904 +0200
+++ bluez-alsa-4.2.0/test/mock/mock.c 2024-06-18 22:53:48.920586887 +0200
@@ -42,6 +42,10 @@
#include "shared/defs.h"
#include "shared/log.h"
+/* GNU basename version */
+#define basename(path) \
+ (strrchr((path),'/') ? strrchr((path),'/')+1 : (path))
+
#define TEST_BLUEALSA_STORAGE_DIR "/tmp/bluealsa-mock-storage"
GAsyncQueue *mock_sem_ready = NULL;
diff -upr bluez-alsa-4.2.0.orig/utils/aplay/aplay.c bluez-alsa-4.2.0/utils/aplay/aplay.c
--- bluez-alsa-4.2.0.orig/utils/aplay/aplay.c 2024-06-18 22:50:31.612449308 +0200
+++ bluez-alsa-4.2.0/utils/aplay/aplay.c 2024-06-18 22:53:42.257228447 +0200
@@ -43,6 +43,10 @@
#include "alsa-pcm.h"
#include "dbus.h"
+/* GNU basename version */
+#define basename(path) \
+ (strrchr((path),'/') ? strrchr((path),'/')+1 : (path))
+
enum volume_type {
VOL_TYPE_AUTO,
VOL_TYPE_MIXER,
diff -upr bluez-alsa-4.2.0.orig/utils/cli/cli.c bluez-alsa-4.2.0/utils/cli/cli.c
--- bluez-alsa-4.2.0.orig/utils/cli/cli.c 2024-06-18 22:50:31.612449308 +0200
+++ bluez-alsa-4.2.0/utils/cli/cli.c 2024-06-18 22:53:30.230516464 +0200
@@ -29,6 +29,10 @@
#include "shared/defs.h"
#include "shared/log.h"
+/* GNU basename version */
+#define basename(path) \
+ (strrchr((path),'/') ? strrchr((path),'/')+1 : (path))
+
/* Initialize global configuration variable. */
struct cli_config config = {
.quiet = false,
diff -upr bluez-alsa-4.2.0.orig/utils/rfcomm/rfcomm.c bluez-alsa-4.2.0/utils/rfcomm/rfcomm.c
--- bluez-alsa-4.2.0.orig/utils/rfcomm/rfcomm.c 2024-06-18 22:50:31.619116011 +0200
+++ bluez-alsa-4.2.0/utils/rfcomm/rfcomm.c 2024-06-18 22:52:43.843735013 +0200
@@ -32,6 +32,10 @@
#include "shared/dbus-client-rfcomm.h"
#include "shared/log.h"
+/* GNU basename version */
+#define basename(path) \
+ (strrchr((path),'/') ? strrchr((path),'/')+1 : (path))
+
static int rfcomm_fd = -1;
static bool main_loop_on = true;
static bool input_is_tty = true;