Make the path to oui.txt a compile-time option
PATCH 1/1 Make the path to oui.txt a compile-time option
Heya,
We've been carrying a similar (but hard-coded) patch in Fedora for a long while, and it would be nice if we could do this properly upstream instead.
Patch attached with explanations.
Cheers
Quoted 1 line
From
b96d9394aa850be86ca368aeaeec3bc24c00bce1Mon Sep 17 00:00:00 2001
From: Bastien Nocera <[email protected]>
Date: Mon, 6 Sep 2010 15:43:48 +0100
Subject: [PATCH] Make the path to oui.txt a compile-time option
This avoids bluetoothd trying to load oui.txt from multiple locations and cause SELinux AVC denials by accessing files it's not supposed to touch.
--- acinclude.m4 | 8 ++++++++ configure.ac | 1 + src/oui.c | 14 +++----------- 3 files changed, 12 insertions(+), 11 deletions(-)
acinclude.m4 +8 -0
@@ -152,6 +152,14 @@ AC_DEFUN([AC_PATH_SNDFILE], [ AC_SUBST(SNDFILE_LIBS) ]) +AC_DEFUN([AC_PATH_OUI], [ + AC_ARG_WITH(ouifile, + AS_HELP_STRING([--with-ouifile=PATH],[Path to the oui.txt file @<:@auto@:>@]), + [ac_with_ouifile=$withval], + [ac_with_ouifile="/var/lib/misc/oui.txt"]) + AC_DEFINE_UNQUOTED(OUIFILE, ["$ac_with_ouifile"], [Define the OUI file path]) +]) + AC_DEFUN([AC_ARG_BLUEZ], [ debug_enable=no optimization_enable=yes
configure.ac +1 -0
@@ -41,6 +41,7 @@ AC_PATH_ALSA AC_PATH_GSTREAMER AC_PATH_USB AC_PATH_SNDFILE +AC_PATH_OUI AC_ARG_BLUEZ
src/oui.c +3 -11
@@ -38,23 +38,15 @@/* http://standards.ieee.org/regauth/oui/oui.txt */ -#define OUIFILE "/var/lib/misc/oui.txt" -char *ouitocomp (const char *oui) {struct stat st;char *str, *map, *off, *end;int fd; - fd =open ("oui.txt" ,O_RDONLY ); -if (fd <0 ) { - fd =open (OUIFILE ,O_RDONLY ); -if (fd <0 ) { - fd =open ("/usr/share/misc/oui.txt" ,O_RDONLY ); -if (fd <0 ) -return NULL ; - } - } + fd =open (OUIFILE ,O_RDONLY ); +if (fd <0 ) +return NULL ;if (fstat (fd, &st) <0 ) {close (fd);
Signature · 1 line
1.7.0.1
Quoted 9 lines · Bastien Nocera
Heya,
We've been carrying a similar (but hard-coded) patch in Fedora for a long while, and it would be nice if we could do this properly upstream instead.
Patch attached with explanations.
Cheers
What is the proper package to ship oui.txt file? Thanks a lot for the information :-)
Quoted 7 lines · Pacho Ramos
Quoted 6 lines · Bastien Nocera
Heya,
We've been carrying a similar (but hard-coded) patch in Fedora for a long while, and it would be nice if we could do this properly upstream instead.
Quoted 6 lines
Quoted 3 lines
Patch attached with explanations.
Cheers
What is the proper package to ship oui.txt file? Thanks a lot for the information :-)
No idea. In Fedora we ship it in hwdata. No idea where it lives for Debian-based distributions, or others.
Quoted 10 lines · Bastien Nocera
Quoted 9 lines · Pacho Ramos
Quoted 8 lines · Bastien Nocera
Heya,
We've been carrying a similar (but hard-coded) patch in Fedora for a long while, and it would be nice if we could do this properly upstream instead.
Patch attached with explanations.
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Cheers
What is the proper package to ship oui.txt file? Thanks a lot for the information :-)
No idea. In Fedora we ship it in hwdata. No idea where it lives for Debian-based distributions, or others.
OK, thanks, I asked it because under Gentoo no package is currently providing it and a user suggested to supply it with bluez... but I haven't made any decision about this yet
Quoted 16 lines · Pacho Ramos
Quoted 15 lines · Bastien Nocera
Quoted 13 lines · Pacho Ramos
Quoted 9 lines · Bastien Nocera
Heya,
We've been carrying a similar (but hard-coded) patch in Fedora for a long while, and it would be nice if we could do this properly upstream instead.
Patch attached with explanations.
Cheers
What is the proper package to ship oui.txt file? Thanks a lot for the information :-)
Quoted 7 lines
Quoted 3 lines
No idea. In Fedora we ship it in hwdata. No idea where it lives for Debian-based distributions, or others.
OK, thanks, I asked it because under Gentoo no package is currently providing it and a user suggested to supply it with bluez... but I haven't made any decision about this yet
That's probably a good enough way to ship it. Various distributions seem to have a different idea on where it should be.
Quoted 7 lines · Bastien Nocera
Quoted 3 lines
OK, thanks, I asked it because under Gentoo no package is currently providing it and a user suggested to supply it with bluez... but I haven't made any decision about this yet
That's probably a good enough way to ship it. Various distributions seem to have a different idea on where it should be.
Great, I will probably follow your recommendation, thanks a lot :-)
Hi Bastien,
Quoted 5 lines · Bastien Nocera
From
b96d9394aa850be86ca368aeaeec3bc24c00bce1Mon Sep 17 00:00:00 2001
From: Bastien Nocera <[email protected]>
Date: Mon, 6 Sep 2010 15:43:48 +0100
Subject: [PATCH] Make the path to oui.txt a compile-time option
Quoted 8 lines
This avoids bluetoothd trying to load oui.txt from multiple locations and cause SELinux AVC denials by accessing files it's not supposed to touch.
--- acinclude.m4 | 8 ++++++++ configure.ac | 1 + src/oui.c | 14 +++----------- 3 files changed, 12 insertions(+), 11 deletions(-)
Seems like a good idea. The patch is now upstream.
Johan