diff options
author | Xin LI <delphij@FreeBSD.org> | 2009-05-18 22:34:33 +0000 |
---|---|---|
committer | Xin LI <delphij@FreeBSD.org> | 2009-05-18 22:34:33 +0000 |
commit | 70b95ceeab5bd5d57083730a2e42e540584aa7ce (patch) | |
tree | 337723a5b888e6f022d551b74c01b12f3a528fce /contrib/file/magic.c | |
parent | dfc77ef51f83bd9e6a0ad57582686aa03adf2a98 (diff) | |
parent | b873e82fedb8026ff397a976c38d4182a21da706 (diff) | |
download | src-70b95ceeab5bd5d57083730a2e42e540584aa7ce.tar.gz src-70b95ceeab5bd5d57083730a2e42e540584aa7ce.zip |
Merge vendor/file/dist@192348, bringing FILE 5.03 to 8-CURRENT.
Security: CVE-2009-1515
Notes
Notes:
svn path=/head/; revision=192350
Diffstat (limited to 'contrib/file/magic.c')
-rw-r--r-- | contrib/file/magic.c | 34 |
1 files changed, 4 insertions, 30 deletions
diff --git a/contrib/file/magic.c b/contrib/file/magic.c index 26b7b864d832..b89989b33879 100644 --- a/contrib/file/magic.c +++ b/contrib/file/magic.c @@ -28,7 +28,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: magic.c,v 1.59 2009/02/03 20:27:51 christos Exp $") +FILE_RCSID("@(#)$File: magic.c,v 1.62 2009/03/20 21:25:41 christos Exp $") #endif /* lint */ #include "magic.h" @@ -57,10 +57,6 @@ FILE_RCSID("@(#)$File: magic.c,v 1.59 2009/02/03 20:27:51 christos Exp $") #include <unistd.h> /* for read() */ #endif -#ifdef HAVE_LOCALE_H -#include <locale.h> -#endif - #include <netinet/in.h> /* for byte swapping */ #include "patchlevel.h" @@ -74,12 +70,6 @@ FILE_RCSID("@(#)$File: magic.c,v 1.59 2009/02/03 20:27:51 christos Exp $") #endif #endif -#ifdef __EMX__ -private char *apptypeName = NULL; -protected int file_os2_apptype(struct magic_set *ms, const char *fn, - const void *buf, size_t nb); -#endif /* __EMX__ */ - private void free_mlist(struct mlist *); private void close_and_restore(const struct magic_set *, const char *, int, const struct stat *); @@ -297,26 +287,10 @@ file_or_fd(struct magic_set *ms, const char *inname, int fd) errno = 0; if ((fd = open(inname, flags)) < 0) { -#ifdef __CYGWIN__ - /* FIXME: Do this with EXEEXT from autotools */ - size_t len = strlen(inname) + 5; - char *tmp = alloca(len); - (void)strlcat(strlcpy(tmp, inname, len), ".exe", len); - if ((fd = open(tmp, flags)) < 0) { -#endif - if (unreadable_info(ms, sb.st_mode, -#ifdef __CYGWIN - tmp -#else - inname -#endif - ) == -1) - goto done; - rv = 0; + if (unreadable_info(ms, sb.st_mode, inname) == -1) goto done; -#ifdef __CYGWIN__ - } -#endif + rv = 0; + goto done; } #ifdef O_NONBLOCK if ((flags = fcntl(fd, F_GETFL)) != -1) { |