mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-31 06:16:03 +00:00
This patch converts the call to fdopendir() to fclose(), opendir(), as
the former isn't supported on glibc before glibc 2.4 (SL10.0 and prior, Annvix, etc.). I dislike the change because fdopendir() does exactly what I want, and converting to straight opendir() introduces a small race window, though paths in question should be under administrator control anyway.
This commit is contained in:
@@ -393,8 +393,13 @@ static int process_include(char *inc, char *name, int line, FILE *out, int nest)
|
||||
}
|
||||
|
||||
if (S_ISDIR(my_stat.st_mode)) {
|
||||
DIR *dir = fdopendir(fileno(newf));
|
||||
DIR *dir = NULL;
|
||||
struct dirent *dirent;
|
||||
|
||||
/* XXX - fdopendir not available in glibc < 2.4 */
|
||||
/* dir = fdopendir(fileno(newf)); */
|
||||
fclose(newf);
|
||||
dir = opendir(buf);
|
||||
if (!dir) {
|
||||
retval = 1;
|
||||
goto out;
|
||||
|
Reference in New Issue
Block a user