1#!/bin/bash -eu 2# Copyright 2020 Google Inc. 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15# 16################################################################################ 17cp -r $SRC/fuzzer src/backend/ 18git apply ../add_fuzzers.diff 19 20useradd fuzzuser 21chown -R fuzzuser . 22cd bld 23 24CC="" CXX="" CFLAGS="" CXXFLAGS="" su fuzzuser -c ../configure 25cd src/backend/fuzzer 26su fuzzuser -c "make createdb" 27chown -R root . 28mv temp/data . 29cp -r data $OUT/ 30cd ../../.. 31cp -r tmp_install $OUT/ 32make clean 33 34../configure 35make 36cd src/backend/fuzzer 37make fuzzer 38cp *_fuzzer $OUT/ 39cp $SRC/postgresql_fuzzer_seed_corpus.zip $OUT/ 40