aboutsummaryrefslogtreecommitdiff
path: root/contrib/file/src/readcdf.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/file/src/readcdf.c')
-rw-r--r--contrib/file/src/readcdf.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/contrib/file/src/readcdf.c b/contrib/file/src/readcdf.c
index 7622c7b08aaa..30c3d24667cd 100644
--- a/contrib/file/src/readcdf.c
+++ b/contrib/file/src/readcdf.c
@@ -26,7 +26,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: readcdf.c,v 1.74 2019/09/11 15:46:30 christos Exp $")
+FILE_RCSID("@(#)$File: readcdf.c,v 1.80 2023/01/24 20:13:40 christos Exp $")
#endif
#include <assert.h>
@@ -92,7 +92,7 @@ static const struct cv {
},
};
-private const char *
+file_private const char *
cdf_clsid_to_mime(const uint64_t clsid[2], const struct cv *cv)
{
size_t i;
@@ -107,7 +107,7 @@ cdf_clsid_to_mime(const uint64_t clsid[2], const struct cv *cv)
return NULL;
}
-private const char *
+file_private const char *
cdf_app_to_mime(const char *vbuf, const struct nv *nv)
{
size_t i;
@@ -144,7 +144,7 @@ cdf_app_to_mime(const char *vbuf, const struct nv *nv)
return rv;
}
-private int
+file_private int
cdf_file_property_info(struct magic_set *ms, const cdf_property_info_t *info,
size_t count, const cdf_directory_t *root_storage)
{
@@ -262,7 +262,7 @@ cdf_file_property_info(struct magic_set *ms, const cdf_property_info_t *info,
return 1;
}
-private int
+file_private int
cdf_file_catalog(struct magic_set *ms, const cdf_header_t *h,
const cdf_stream_t *sst)
{
@@ -293,7 +293,7 @@ cdf_file_catalog(struct magic_set *ms, const cdf_header_t *h,
return 1;
}
-private int
+file_private int
cdf_file_summary_info(struct magic_set *ms, const cdf_header_t *h,
const cdf_stream_t *sst, const cdf_directory_t *root_storage)
{
@@ -352,7 +352,7 @@ cdf_file_summary_info(struct magic_set *ms, const cdf_header_t *h,
}
#ifdef notdef
-private char *
+file_private char *
format_clsid(char *buf, size_t len, const uint64_t uuid[2]) {
snprintf(buf, len, "%.8" PRIx64 "-%.4" PRIx64 "-%.4" PRIx64 "-%.4"
PRIx64 "-%.12" PRIx64,
@@ -365,7 +365,7 @@ format_clsid(char *buf, size_t len, const uint64_t uuid[2]) {
}
#endif
-private int
+file_private int
cdf_file_catalog_info(struct magic_set *ms, const cdf_info_t *info,
const cdf_header_t *h, const cdf_sat_t *sat, const cdf_sat_t *ssat,
const cdf_stream_t *sst, const cdf_dir_t *dir, cdf_stream_t *scn)
@@ -383,7 +383,7 @@ cdf_file_catalog_info(struct magic_set *ms, const cdf_info_t *info,
return i;
}
-private int
+file_private int
cdf_check_summary_info(struct magic_set *ms, const cdf_info_t *info,
const cdf_header_t *h, const cdf_sat_t *sat, const cdf_sat_t *ssat,
const cdf_stream_t *sst, const cdf_dir_t *dir, cdf_stream_t *scn,
@@ -431,7 +431,7 @@ cdf_check_summary_info(struct magic_set *ms, const cdf_info_t *info,
return i;
}
-private struct sinfo {
+file_private struct sinfo {
const char *name;
const char *mime;
const char *sections[5];
@@ -508,7 +508,7 @@ private struct sinfo {
},
};
-private int
+file_private int
cdf_file_dir_info(struct magic_set *ms, const cdf_dir_t *dir)
{
size_t sd, j;
@@ -537,7 +537,7 @@ cdf_file_dir_info(struct magic_set *ms, const cdf_dir_t *dir)
return -1;
}
-protected int
+file_protected int
file_trycdf(struct magic_set *ms, const struct buffer *b)
{
int fd = b->fd;
@@ -605,15 +605,15 @@ file_trycdf(struct magic_set *ms, const struct buffer *b)
}
#endif
- if ((i = cdf_read_user_stream(&info, &h, &sat, &ssat, &sst, &dir,
- "FileHeader", &scn)) != -1) {
+ if (cdf_read_user_stream(&info, &h, &sat, &ssat, &sst, &dir,
+ "FileHeader", &scn) != -1) {
#define HWP5_SIGNATURE "HWP Document File"
if (scn.sst_len * scn.sst_ss >= sizeof(HWP5_SIGNATURE) - 1
&& memcmp(scn.sst_tab, HWP5_SIGNATURE,
sizeof(HWP5_SIGNATURE) - 1) == 0) {
if (NOTMIME(ms)) {
if (file_printf(ms,
- "Hangul (Korean) Word Processor File 5.x") == -1)
+ "Hancom HWP (Hangul Word Processor) file, version 5.0") == -1)
return -1;
} else if (ms->flags & MAGIC_MIME_TYPE) {
if (file_printf(ms, "application/x-hwp") == -1)
@@ -674,7 +674,8 @@ out0:
if (file_printf(ms, ", %s", expn) == -1)
return -1;
} else if (ms->flags & MAGIC_MIME_TYPE) {
- if (file_printf(ms, "application/CDFV2") == -1)
+ /* https://reposcope.com/mimetype/application/x-ole-storage */
+ if (file_printf(ms, "application/x-ole-storage") == -1)
return -1;
}
return 1;