0
Fork 0
mirror of https://codeberg.org/librewolf/source.git synced 2024-12-22 05:33:03 -05:00

patch files fuzzing

This commit is contained in:
Bert van der Weerd 2022-06-01 20:15:40 +02:00
parent 99c6360f8d
commit 85f8c741c2
No known key found for this signature in database
GPG key ID: 73370A0B9E5516B0
6 changed files with 67 additions and 98 deletions

View file

@ -8,6 +8,7 @@ Build:
GIT_SUBMODULE_STRATEGY: recursive GIT_SUBMODULE_STRATEGY: recursive
script: script:
- make all - make all
- make check-patchfail check-fuzz
- echo VERSION=$(cat version) >> variables.env - echo VERSION=$(cat version) >> variables.env
- echo RELEASE=$(cat release) >> variables.env - echo RELEASE=$(cat release) >> variables.env
- echo BUILD_JOB_ID=$CI_JOB_ID >> variables.env - echo BUILD_JOB_ID=$CI_JOB_ID >> variables.env
@ -16,6 +17,8 @@ Build:
- librewolf-*.source.tar.gz - librewolf-*.source.tar.gz
- librewolf-*.source.tar.gz.sha256sum - librewolf-*.source.tar.gz.sha256sum
- librewolf-*.source.tar.gz.sig - librewolf-*.source.tar.gz.sig
- patchfail.out
- patchfail-fuzz.out
reports: reports:
dotenv: variables.env dotenv: variables.env

View file

@ -1,4 +1,4 @@
.PHONY : help check all clean veryclean dir bootstrap fetch build package run update setup-wasi .PHONY : help check all clean veryclean dir bootstrap fetch build package run update setup-wasi check-patchfail check-fuzz fixfuzz
version:=$(shell cat ./version) version:=$(shell cat ./version)
release:=$(shell cat ./release) release:=$(shell cat ./release)
@ -37,7 +37,10 @@ help :
@echo " package - Package LibreWolf (requires build)." @echo " package - Package LibreWolf (requires build)."
@echo " run - Run LibreWolf (requires build)." @echo " run - Run LibreWolf (requires build)."
@echo "" @echo ""
@echo " check-patchfail - check patches for errors."
@echo " check-fuzz - check patches for fuzz."
@echo " fixfuz - fix the fuzz."
@echo ""
check : check :
python3 scripts/update-version.py python3 scripts/update-version.py
@ -52,7 +55,7 @@ all : $(lw_source_tarball)
clean : clean :
rm -rf *~ public_key.asc $(ff_source_dir) $(lw_source_dir) $(lw_source_tarball) $(lw_source_tarball).sha256sum firefox-$(version) rm -rf *~ public_key.asc $(ff_source_dir) $(lw_source_dir) $(lw_source_tarball) $(lw_source_tarball).sha256sum firefox-$(version) patchfail.out patchfail-fuzz.out
veryclean : clean veryclean : clean
rm -f $(ff_source_tarball) $(ff_source_tarball).asc rm -f $(ff_source_tarball) $(ff_source_tarball).asc
@ -114,3 +117,10 @@ package :
run : run :
(cd $(lw_source_dir) && ./mach run) (cd $(lw_source_dir) && ./mach run)
check-patchfail:
sh -c "./scripts/check-patchfail.sh" > patchfail.out
check-fuzz:
-sh -c "./scripts/check-patchfail.sh --fuzz=0" > patchfail-fuzz.out
fixfuzz :
sh -c "./scripts/fuzzfail.sh"

View file

@ -1,74 +0,0 @@
diff --git a/browser/extensions/moz.build b/browser/extensions/moz.build
index 269dcb2..ed7c31d 100644
--- a/browser/extensions/moz.build
+++ b/browser/extensions/moz.build
@@ -5,11 +5,9 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DIRS += [
- "doh-rollout",
"formautofill",
"screenshots",
"webcompat",
- "report-site-issue",
"pictureinpicture",
"proxy-failover",
"search-detection",
diff --git a/browser/locales/Makefile.in b/browser/locales/Makefile.in
index 496379c..dd6f359 100644
--- a/browser/locales/Makefile.in
+++ b/browser/locales/Makefile.in
@@ -61,7 +61,6 @@ l10n-%:
ifneq (,$(wildcard ../extensions/formautofill/locales))
@$(MAKE) -C ../extensions/formautofill/locales AB_CD=$* XPI_NAME=locale-$*
endif
- @$(MAKE) -C ../extensions/report-site-issue/locales AB_CD=$* XPI_NAME=locale-$*
@$(MAKE) -C ../../devtools/client/locales AB_CD=$* XPI_NAME=locale-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
@$(MAKE) -C ../../devtools/startup/locales AB_CD=$* XPI_NAME=locale-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
@$(MAKE) l10n AB_CD=$* XPI_NAME=locale-$* PREF_DIR=$(PREF_DIR)
@@ -82,7 +81,6 @@ endif
@$(MAKE) -C ../../devtools/startup/locales chrome AB_CD=$*
@$(MAKE) chrome AB_CD=$*
@$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales chrome AB_CD=$*
- @$(MAKE) -C ../extensions/report-site-issue/locales chrome AB_CD=$*
package-win32-installer: $(SUBMAKEFILES)
$(MAKE) -C ../installer/windows CONFIG_DIR=l10ngen ZIP_IN='$(ZIP_OUT)' installer
diff --git a/browser/locales/filter.py b/browser/locales/filter.py
index bb2e992..7d7768e 100644
--- a/browser/locales/filter.py
+++ b/browser/locales/filter.py
@@ -19,7 +19,6 @@
"devtools/startup",
"browser",
"browser/extensions/formautofill",
- "browser/extensions/report-site-issue",
"extensions/spellcheck",
"other-licenses/branding/firefox",
"browser/branding/official",
diff --git a/browser/locales/l10n.ini b/browser/locales/l10n.ini
index f4cb7ca..4efac13 100644
--- a/browser/locales/l10n.ini
+++ b/browser/locales/l10n.ini
@@ -13,7 +13,6 @@
devtools/client
devtools/startup
browser/extensions/formautofill
- browser/extensions/report-site-issue
[includes]
# non-central apps might want to use %(topsrcdir)s here, or other vars
diff --git a/browser/locales/l10n.toml b/browser/locales/l10n.toml
index b9b18fe..af7c583 100644
--- a/browser/locales/l10n.toml
+++ b/browser/locales/l10n.toml
@@ -132,10 +132,6 @@
l10n = "{l}browser/extensions/formautofill/**"
[[paths]]
- reference = "browser/extensions/report-site-issue/locales/en-US/**"
- l10n = "{l}browser/extensions/report-site-issue/**"
-
-[[paths]]
reference = "services/sync/locales/en-US/**"
l10n = "{l}services/sync/**"

View file

@ -1,11 +0,0 @@
--- a/browser/components/preferences/preferences.js
+++ b/browser/components/preferences/preferences.js
@@ -161,8 +161,6 @@
this.removeAttribute("keyboard-navigation");
});
- maybeDisplayPoliciesNotice();
-
window.addEventListener("hashchange", onHashChange);
gotoPref().then(() => {

View file

@ -25,27 +25,27 @@ cd firefox-$(cat ../version)
echo "" echo ""
echo "Testing patches..." echo "Testing patches..."
for i in $(cat ../../assets/patches.txt); do for curpatch in $(cat ../../assets/patches.txt); do
echo "" echo ""
echo "==> $i:" echo "==> $curpatch:"
echo "" echo ""
patch $* -p1 -i ../../$i > ../patch.tmp patch $* -p1 -i ../../$curpatch > ../patch.tmp
cat ../patch.tmp cat ../patch.tmp
######################
s="" s=""
for j in $(grep -n rej$ ../patch.tmp | awk '{ print $(NF); }'); do for j in $(grep -n rej$ ../patch.tmp | awk '{ print $(NF); }'); do
s="$s $j" s="$s $j"
echo "---[snip]---------- --> $j:"
cat $j
echo "---[snip]----------"
done done
s=$s s=$s
if [ ! -z "$s" ]; then if [ ! -z "$s" ]; then
s=$(echo $i) failed_patches="$failed_patches [$curpatch]"
failed_patches="$failed_patches [$s]"
echo ""
for k in $s; do
echo "--> $s:"
cat $s
done
fi fi
#######################
rm -f ../patch.tmp rm -f ../patch.tmp
#patch -R -p1 -i ../../$i #patch -R -p1 -i ../../$i

41
scripts/fuzzfail.sh Executable file
View file

@ -0,0 +1,41 @@
tmpdir="tmpdir92"
if [ ! -f version ]; then
echo "error: 'version' does not exist. Are you in the right folder?"
exit 1
fi
firefox=firefox-$(cat version).source.tar.xz
if [ ! -f "$firefox" ]; then
echo "error: '$firefox' does not exist."
exit 1
fi
failed_patches=
rm -rf $tmpdir
mkdir $tmpdir
cd $tmpdir
tar xf ../$firefox
cd firefox-$(cat ../version)
for curpatch in $(cat ../../assets/patches.txt); do
patch --fuzz=0 -p1 -i ../../$curpatch > ../patch.tmp
s=""
for j in $(grep -n rej$ ../patch.tmp | awk '{ print $(NF); }'); do
s="$s $j"
done
s=$s
if [ ! -z "$s" ]; then
echo "$curpatch"
git config --global commit.gpgsign false
(ff=firefox-$(cat ../../version) && cd ../.. && scripts/git-patchtree.sh $curpatch && cd $ff && git diff > ../$curpatch && cd .. && rm -rf $ff)
git config --global commit.gpgsign true
fi
rm -f ../patch.tmp
done
cd ../..
rm -rf $tmpdir