aboutsummaryrefslogtreecommitdiff
path: root/projects/libyal
diff options
context:
space:
mode:
authorJoachim Metz <joachim.metz@gmail.com>2020-07-20 17:50:17 +0200
committerGitHub <noreply@github.com>2020-07-20 08:50:17 -0700
commit6beceb3030494375bdd3621c732c30fce3f3aba8 (patch)
tree80bbeca1bf94e8c95b9b0c2b2313cfdeac53a676 /projects/libyal
parent518eec903e8f0fb74a17b8bf18b85a26adb1ad5d (diff)
downloadoss-fuzz-6beceb3030494375bdd3621c732c30fce3f3aba8.tar.gz
Merged libesedb, libevt, libevtx, libexe, liblnk, libmsiecf and libregf into single project (#4166)
* Merged libesedb, libevt, libevtx, libexe, liblnk, libmsiecf and libregf into single libyal project * Changes after review
Diffstat (limited to 'projects/libyal')
-rw-r--r--projects/libyal/Dockerfile30
-rwxr-xr-xprojects/libyal/build.sh59
-rw-r--r--projects/libyal/project.yaml10
3 files changed, 99 insertions, 0 deletions
diff --git a/projects/libyal/Dockerfile b/projects/libyal/Dockerfile
new file mode 100644
index 000000000..8420550c5
--- /dev/null
+++ b/projects/libyal/Dockerfile
@@ -0,0 +1,30 @@
+# Copyright 2020 Google Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+################################################################################
+
+FROM gcr.io/oss-fuzz-base/base-builder
+
+RUN apt-get update && apt-get install -y make autoconf automake autopoint libtool pkg-config
+
+RUN git clone --depth 1 https://github.com/libyal/libesedb.git libesedb
+RUN git clone --depth 1 https://github.com/libyal/libevt.git libevt
+RUN git clone --depth 1 https://github.com/libyal/libevtx.git libevtx
+RUN git clone --depth 1 https://github.com/libyal/libexe.git libexe
+RUN git clone --depth 1 https://github.com/libyal/liblnk.git liblnk
+RUN git clone --depth 1 https://github.com/libyal/libmsiecf.git libmsiecf
+RUN git clone --depth 1 https://github.com/libyal/libregf.git libregf
+
+WORKDIR libyal
+COPY build.sh $SRC/
diff --git a/projects/libyal/build.sh b/projects/libyal/build.sh
new file mode 100755
index 000000000..0e288d469
--- /dev/null
+++ b/projects/libyal/build.sh
@@ -0,0 +1,59 @@
+#!/bin/bash -eu
+# Copyright 2020 Google Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+################################################################################
+
+for PROJECT in ${SRC}/*;
+do
+ PROJECT=$(basename ${PROJECT})
+
+ # A libyal project should have an ossfuzz directory and a synclibs.sh script.
+ if ! test -d ${SRC}/${PROJECT}/ossfuzz || ! test -x ${SRC}/${PROJECT}/synclibs.sh;
+ then
+ continue
+ fi
+ cd ${SRC}/${PROJECT}
+
+ # Prepare the project source for build.
+ ./synclibs.sh
+ ./autogen.sh
+ ./configure --enable-shared=no
+
+ # Build the project and fuzzer binaries.
+ make -j$(nproc) LIB_FUZZING_ENGINE=${LIB_FUZZING_ENGINE}
+
+ # Download the test data if supported.
+ if test -x ./synctestdata.sh;
+ then
+ ./synctestdata.sh
+ fi
+
+ # Copy the fuzzer binaries and test data to the output directory.
+ for FUZZ_TARGET in $(cd ossfuzz && find . -executable -type f);
+ do
+ FUZZ_TARGET=$(basename ${FUZZ_TARGET})
+
+ # Prefix the fuzzer binaries with the project name.
+ cp ossfuzz/${FUZZ_TARGET} ${OUT}/${PROJECT}_${FUZZ_TARGET}
+
+ # Download the test data if supported.
+ if test -d tests/input/public;
+ then
+ (cd tests/input/public && zip ${OUT}/${PROJECT}_${FUZZ_TARGET}_seed_corpus.zip *)
+ else
+ (cd tests/data && zip ${OUT}/${PROJECT}_${FUZZ_TARGET}_seed_corpus.zip ${FUZZ_TARGET/_fuzzer/}.*)
+ fi
+ done
+done
diff --git a/projects/libyal/project.yaml b/projects/libyal/project.yaml
new file mode 100644
index 000000000..b1a31026f
--- /dev/null
+++ b/projects/libyal/project.yaml
@@ -0,0 +1,10 @@
+homepage: "https://github.com/libyal"
+language: c
+primary_contact: "joachim.metz@gmail.com"
+sanitizers:
+- address
+- memory
+- undefined
+architectures:
+- x86_64
+- i386