diff options
author | Max Kellermann <max@duempel.org> | 2011-11-28 09:56:03 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2011-11-28 09:57:21 +0100 |
commit | 6f365c30eb33c40193defb827b03a8fd293bfc23 (patch) | |
tree | 0f4850e9ab18004b07224d106b9b148439a6f218 /src/mapper.c | |
parent | 718e180423aeb84fc513858415a201905630580c (diff) | |
download | mpd-6f365c30eb33c40193defb827b03a8fd293bfc23.tar.gz mpd-6f365c30eb33c40193defb827b03a8fd293bfc23.tar.xz mpd-6f365c30eb33c40193defb827b03a8fd293bfc23.zip |
mapper: check "r" permission on music directory
Yet another common support case.
Diffstat (limited to 'src/mapper.c')
-rw-r--r-- | src/mapper.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mapper.c b/src/mapper.c index 41ed6550b..3cee41eb3 100644 --- a/src/mapper.c +++ b/src/mapper.c @@ -34,6 +34,7 @@ #include <sys/stat.h> #include <unistd.h> #include <errno.h> +#include <dirent.h> static char *music_dir; static size_t music_dir_length; @@ -76,6 +77,12 @@ check_directory(const char *path) path); g_free(x); #endif + + DIR *dir = opendir(path); + if (dir == NULL && errno == EACCES) + g_warning("No permission to read directory: %s", path); + else + closedir(dir); } static void |