mapper: check "r" permission on music directory
Yet another common support case.
This commit is contained in:
		
							
								
								
									
										2
									
								
								NEWS
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								NEWS
									
									
									
									
									
								
							| @@ -5,7 +5,7 @@ ver 0.16.6 (2010/??/??) | |||||||
|   - flac, null, wave: fix buffer corruption bug |   - flac, null, wave: fix buffer corruption bug | ||||||
|   - wave: support packed 24 bit samples |   - wave: support packed 24 bit samples | ||||||
| * mapper: fix the bogus "not a directory" error message | * mapper: fix the bogus "not a directory" error message | ||||||
| * mapper: check "x" permission on music directory | * mapper: check "x" and "r" permissions on music directory | ||||||
| * log: print reason for failure | * log: print reason for failure | ||||||
| * event_pipe: fix WIN32 regression | * event_pipe: fix WIN32 regression | ||||||
| * define WINVER in ./configure | * define WINVER in ./configure | ||||||
|   | |||||||
| @@ -34,6 +34,7 @@ | |||||||
| #include <sys/stat.h> | #include <sys/stat.h> | ||||||
| #include <unistd.h> | #include <unistd.h> | ||||||
| #include <errno.h> | #include <errno.h> | ||||||
|  | #include <dirent.h> | ||||||
|  |  | ||||||
| static char *music_dir; | static char *music_dir; | ||||||
| static size_t music_dir_length; | static size_t music_dir_length; | ||||||
| @@ -76,6 +77,12 @@ check_directory(const char *path) | |||||||
| 			  path); | 			  path); | ||||||
| 	g_free(x); | 	g_free(x); | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
|  | 	DIR *dir = opendir(path); | ||||||
|  | 	if (dir == NULL && errno == EACCES) | ||||||
|  | 		g_warning("No permission to read directory: %s", path); | ||||||
|  | 	else | ||||||
|  | 		closedir(dir); | ||||||
| } | } | ||||||
|  |  | ||||||
| static void | static void | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Max Kellermann
					Max Kellermann