From: Reuben Thomas Date: Thu, 30 Oct 2008 10:54:06 +0000 (+0000) Subject: Add a FIXME for magic file order reading. X-Git-Tag: FILE5_05~296 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=227d74aca317a983663d26faa0227807ce5d55f9;p=file Add a FIXME for magic file order reading. --- diff --git a/ChangeLog b/ChangeLog index 310bad56..20ce0f2c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -2008-10-18 11:00 Reuben Thomas +2008-10-30 11:00 Reuben Thomas * Correct words counts in comments of struct magic. @@ -12,6 +12,9 @@ * Fix potential attacks via conversion specifications in magic strings. + * Add a FIXME for Debian bug #488562 (magic files should be + read in a defined order, by sorting the names). + 2008-10-18 16:45 Christos Zoulas * Added APPLE file creator/type diff --git a/src/apprentice.c b/src/apprentice.c index 7ecfd8bd..5dc3e697 100644 --- a/src/apprentice.c +++ b/src/apprentice.c @@ -49,7 +49,7 @@ #include #ifndef lint -FILE_RCSID("@(#)$File: apprentice.c,v 1.142 2008/10/18 20:47:48 christos Exp $") +FILE_RCSID("@(#)$File: apprentice.c,v 1.143 2008/10/30 10:54:07 rrt Exp $") #endif /* lint */ #define EATAB {while (isascii((unsigned char) *l) && \ @@ -706,6 +706,8 @@ apprentice_load(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp, (void)fprintf(stderr, "%s\n", usg_hdr); /* load directory or file */ + /* FIXME: Read file names and sort them to prevent + non-determinism. See Debian bug #488562. */ if (stat(fn, &st) == 0 && S_ISDIR(st.st_mode)) { dir = opendir(fn); if (dir) {