2
0
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:
Steve Beattie
2006-11-20 05:20:16 +00:00
parent ce0b104088
commit 6271e1a510
2 changed files with 9 additions and 1 deletions

View File

@@ -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;