Skip to content

Commit

Permalink
Merge branch 'master' into adding_magic_compile
Browse files Browse the repository at this point in the history
  • Loading branch information
Kasher committed Mar 5, 2018
2 parents 506d225 + abd78ec commit 3a42d08
Show file tree
Hide file tree
Showing 100 changed files with 12,900 additions and 70,995 deletions.
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ addons:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
- g++-6
notifications:
email: false
env:
matrix:
- TRAVIS_NODE_VERSION="0.10"
- TRAVIS_NODE_VERSION="0.12"
- TRAVIS_NODE_VERSION="4"
- TRAVIS_NODE_VERSION="5"
- TRAVIS_NODE_VERSION="6"
- TRAVIS_NODE_VERSION="8"
- TRAVIS_NODE_VERSION="9"
install:
- "rm -rf ~/.nvm && mkdir -p ~/.nvm && curl -sL `curl -sI https://github.com/creationix/nvm/releases/latest|sed -En 's/^Location: (.+)\\/releases\\/tag\\/(.+)/\\1\\/tarball\\/\\2/p'|tr -d '\r\n'`|tar zx --strip=1 -C ~/.nvm && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION"
- node --version
- npm --version
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then export CXX=g++-4.8; export CC=gcc-4.8; fi
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then export CXX=g++-6; export CC=gcc-6; fi
- $CXX --version
- npm install
script: npm test
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ An async libmagic binding for [node.js](http://nodejs.org/) for detecting conten
Requirements
============

* [node.js](http://nodejs.org/) -- v0.10.0 or newer
* [node.js](http://nodejs.org/) -- v4.0.0 or newer


Install
Expand Down
19 changes: 15 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
# http://www.appveyor.com/docs/appveyor-yml

# This image contains both 2013 and 2015
os: Visual Studio 2015

# Test against these versions of Node.js.
environment:
matrix:
- nodejs_version: "0.10"
- nodejs_version: "0.12"
- nodejs_version: "4"
GYP_MSVS_VERSION: "2013"
- nodejs_version: "4"
GYP_MSVS_VERSION: "2015"
- nodejs_version: "6"
GYP_MSVS_VERSION: "2013"
- nodejs_version: "6"
GYP_MSVS_VERSION: "2015"
- nodejs_version: "8"
GYP_MSVS_VERSION: "2013"
- nodejs_version: "8"
GYP_MSVS_VERSION: "2015"
- nodejs_version: "9"
GYP_MSVS_VERSION: "2015"

# Install scripts. (runs after repo cloning)
install:
# Get the latest stable version of Node
- ps: Install-Product node $env:nodejs_version
# Typical npm stuff.
- IF %nodejs_version% LSS 1 npm -g install npm
- IF %nodejs_version% LSS 1 set PATH=%APPDATA%\npm;%PATH%
- set CL=-DDELAYIMP_INSECURE_WRITABLE_HOOKS
- npm install

Expand Down
85 changes: 84 additions & 1 deletion deps/libmagic/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,86 @@
2017-09-02 11:53 Christos Zoulas <[email protected]>

* release 5.32

2017-08-28 16:37 Christos Zoulas <[email protected]>

* Always reset state in {file,buffer}_apprentice (Krzysztof Wilczynski)

2017-08-27 03:55 Christos Zoulas <[email protected]>

* Fix always true condition (Thomas Jarosch)

2017-05-24 17:30 Christos Zoulas <[email protected]>

* pickier parsing of numeric values in magic files.

2017-05-23 17:55 Christos Zoulas <[email protected]>

* PR/615 add magic_getflags()

2017-05-23 13:55 Christos Zoulas <[email protected]>

* release 5.31

2017-03-17 20:32 Christos Zoulas <[email protected]>

* remove trailing spaces from magic files
* refactor is_tar
* better bounds checks for cdf

2017-02-10 12:24 Christos Zoulas <[email protected]>

* release 5.30

2017-02-07 23:27 Christos Zoulas <[email protected]>

* If we exceeded the offset in a search return no match
(Christoph Biedl)
* Be more lenient on corrupt CDF files (Christoph Biedl)

2017-02-04 16:46 Christos Zoulas <[email protected]>

* pacify ubsan sign extension (oss-fuzz/524)

2017-02-01 12:42 Christos Zoulas <[email protected]>

* off by one in cdf parsing (PR/593)
* report debugging sections in elf (PR/591)

2016-11-06 10:52 Christos Zoulas <[email protected]>

* Allow @@@ in extensions
* Add missing overflow check in der magic (Jonas Wagner)

2016-10-25 10:40 Christos Zoulas <[email protected]>

* release 5.29

2016-10-24 11:20 Christos Zoulas <[email protected]>

* der getlength overflow (Jonas Wagner)
* multiple magic file load failure (Christoph Biedl)

2016-10-17 11:26 Christos Zoulas <[email protected]>

* CDF parsing improvements (Guy Helmer)

2016-07-20 7:26 Christos Zoulas <[email protected]>

* Add support for signed indirect offsets

2016-07-18 7:41 Christos Zoulas <[email protected]>

* cat /dev/null | file - should print empty (Christoph Biedl)

2016-07-05 15:20 Christos Zoulas <[email protected]>

* Bump string size from 64 to 96.

2016-06-13 20:20 Christos Zoulas <[email protected]>

* PR/556: Fix separators on annotations.

2016-06-13 19:40 Christos Zoulas <[email protected]>

* release 5.28
Expand Down Expand Up @@ -358,7 +441,7 @@
`
2013-11-06 14:40 Christos Zoulas <[email protected]>

* fix erroneous non-zero exit code from non-existant file and message
* fix erroneous non-zero exit code from non-existent file and message

2013-10-29 14:25 Christos Zoulas <[email protected]>

Expand Down
20 changes: 17 additions & 3 deletions deps/libmagic/TODO
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ file, not here. More speculative material can live here.
listed in the BUGS section of the man page had been fixed!)

---

It would be nice to simplify file considerably. For example,
reimplement the apprentice and non-pattern magic methods in Python,
and compile the magic patterns to a giant regex (or something similar;
Expand All @@ -15,8 +14,23 @@ small amount of C is needed (because fast execution is typically only
required for soft magic, not the more detailed information given by
hard-wired routines). In this regard, note that hplip, which is
BSD-licensed, has a magic reimplementation in Python.

---
Read the kerberos magic entry for more ideas.

---
Write a string merger to make magic entry sizes dynamic.
Strings will be converted to offsets from the string table.
---
Programming language support, we can introduce the concept of a group
of rules where n rules need to match before the rule is positive. This
could require structural changes to the matching code :-(

0 group 2 # require 2 matches
# rule 1
>0 ....
...
# rule 2
>0 ....
...

christos

11 changes: 5 additions & 6 deletions deps/libmagic/libmagic.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
{
'target_name': 'libmagic',
'type': 'static_library',
'include_dirs': [ '.', 'src', 'pcre' ],
'dependencies': [
'pcre/pcre.gyp:libpcre',
],
'defines': [ 'HAVE_CONFIG_H', 'VERSION="5.28"' ],
'include_dirs': [ '.', 'src' ],
'defines': [ 'HAVE_CONFIG_H', 'VERSION="5.32"' ],
'conditions': [
[ 'OS!="freebsd" and OS!="mac"', {
'sources': [ 'src/fmtcheck.c' ],
Expand All @@ -27,8 +24,10 @@
'src/strlcat.c',
'src/strlcpy.c',
'src/vasprintf.c',
# POSIX regex implementation
'msvc/libgnurx-2.5/regex.c',
],
'include_dirs': [ 'msvc', 'config/win' ],
'include_dirs': [ 'config/win', 'msvc', 'msvc/libgnurx-2.5' ],
'link_settings': {
'libraries': [
'-lshlwapi.lib',
Expand Down
Loading

0 comments on commit 3a42d08

Please sign in to comment.