summaryrefslogtreecommitdiff
path: root/src/oui.c
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2010-09-06 15:43:48 +0100
committerJohan Hedberg <johan.hedberg@nokia.com>2010-09-06 19:05:14 +0300
commit3a9811d70863b4922f26f70d8aa1a8eb77e41998 (patch)
tree639e782cd7bdd8067873b7276177be48b3376f6b /src/oui.c
parentd23defc9445647a62e8893aaec631131f963a167 (diff)
downloadbluez-3a9811d70863b4922f26f70d8aa1a8eb77e41998.tar.gz
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.
Diffstat (limited to 'src/oui.c')
-rw-r--r--src/oui.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/oui.c b/src/oui.c
index 1096d20c7..80bb3d32d 100644
--- a/src/oui.c
+++ b/src/oui.c
@@ -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);