From dd0fb7654f1a664a40735fcb198c71317a8ec26f Mon Sep 17 00:00:00 2001 From: Igor Raits Date: Sat, 15 Feb 2020 10:34:01 +0100 Subject: [PATCH] Backport few fixes and add gpg verification Signed-off-by: Igor Raits --- .gitignore | 1 + ...iothread-Add-missing-cstdint-include.patch | 28 --------- ...top-crashing-when-cwd-isn-t-readable.patch | 56 ++++++++++++++++++ 0002-iothread-Include-cstdint.patch | 31 ++++++++++ 0003-iothread-include-cstdint-correctly.patch | 44 ++++++++++++++ 0004-Fix-build-on-32-bit-systems.patch | 35 +++++++++++ fish.spec | 10 +++- ...3837986104878835FA516D7A67D962D88A709A.gpg | Bin 0 -> 4438 bytes sources | 1 + 9 files changed, 177 insertions(+), 29 deletions(-) delete mode 100644 0001-iothread-Add-missing-cstdint-include.patch create mode 100644 0001-parser-Stop-crashing-when-cwd-isn-t-readable.patch create mode 100644 0002-iothread-Include-cstdint.patch create mode 100644 0003-iothread-include-cstdint-correctly.patch create mode 100644 0004-Fix-build-on-32-bit-systems.patch create mode 100644 gpgkey-003837986104878835FA516D7A67D962D88A709A.gpg diff --git a/.gitignore b/.gitignore index fdc63ad..d7df4ec 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ /fish-3.0.0.tar.gz /fish-3.0.2.tar.gz /fish-3.1.0.tar.gz +/fish-3.1.0.tar.gz.asc diff --git a/0001-iothread-Add-missing-cstdint-include.patch b/0001-iothread-Add-missing-cstdint-include.patch deleted file mode 100644 index a6988d3..0000000 --- a/0001-iothread-Add-missing-cstdint-include.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 24e6cfa8097b8946db51f4076b59496a658fcbf5 Mon Sep 17 00:00:00 2001 -From: Igor Raits -Date: Fri, 14 Feb 2020 20:45:19 +0100 -Subject: [PATCH] iothread: Add missing cstdint include - -This will fix build with GCC 10+. - -Fixes: https://github.com/fish-shell/fish-shell/issues/6604 -Signed-off-by: Igor Raits ---- - src/iothread.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/iothread.h b/src/iothread.h -index 5d91b2b34..64f783e87 100644 ---- a/src/iothread.h -+++ b/src/iothread.h -@@ -4,6 +4,7 @@ - - #include - -+#include - #include - #include - --- -2.25.0 - diff --git a/0001-parser-Stop-crashing-when-cwd-isn-t-readable.patch b/0001-parser-Stop-crashing-when-cwd-isn-t-readable.patch new file mode 100644 index 0000000..11aeb5d --- /dev/null +++ b/0001-parser-Stop-crashing-when-cwd-isn-t-readable.patch @@ -0,0 +1,56 @@ +From b54f5ba56e6315028186af5d9e3b914dfae5a74f Mon Sep 17 00:00:00 2001 +From: Fabian Homborg +Date: Fri, 14 Feb 2020 17:18:27 +0100 +Subject: [PATCH 1/4] parser: Stop crashing when cwd isn't readable + +Everything seems to be working, so instead of crashing just print an +error and return. + +Fixes #6597 + +(cherry picked from commit ceba851d44dea68b9e1b2b551e37fd6834767357) +--- + src/parser.cpp | 2 +- + tests/checks/init-unreadable-cwd.fish | 17 +++++++++++++++++ + 2 files changed, 18 insertions(+), 1 deletion(-) + create mode 100644 tests/checks/init-unreadable-cwd.fish + +diff --git a/src/parser.cpp b/src/parser.cpp +index 381b8ac06..1eae37392 100644 +--- a/src/parser.cpp ++++ b/src/parser.cpp +@@ -85,7 +85,7 @@ parser_t::parser_t(std::shared_ptr vars) : variables(std::move(vars + int cwd = open_cloexec(".", O_RDONLY); + if (cwd < 0) { + perror("Unable to open the current working directory"); +- abort(); ++ return; + } + libdata().cwd_fd = std::make_shared(cwd); + } +diff --git a/tests/checks/init-unreadable-cwd.fish b/tests/checks/init-unreadable-cwd.fish +new file mode 100644 +index 000000000..fee220847 +--- /dev/null ++++ b/tests/checks/init-unreadable-cwd.fish +@@ -0,0 +1,17 @@ ++#RUN: %fish -C 'set -g fish %fish' %s ++# Test that fish doesn't crash if cwd is unreadable at the start (#6597) ++ ++set -l oldpwd $PWD ++set -l tmpdir (mktemp -d) ++ ++# $fish might be a relative path (e.g. "../test/root/bin/fish") ++set -l fish (builtin realpath $fish) ++cd $tmpdir ++chmod 000 . ++$fish -c 'echo Look Ma! No crashing!' ++#CHECK: Look Ma! No crashing! ++#CHECKERR: Unable to open the current working directory: Permission denied ++ ++# Careful here, Solaris' rm tests if the directory is in $PWD, so we need to cd back ++cd $oldpwd ++rmdir $tmpdir +-- +2.25.0 + diff --git a/0002-iothread-Include-cstdint.patch b/0002-iothread-Include-cstdint.patch new file mode 100644 index 0000000..f20d22b --- /dev/null +++ b/0002-iothread-Include-cstdint.patch @@ -0,0 +1,31 @@ +From ca740a87d86009badba0b4e767836eaee449e0a4 Mon Sep 17 00:00:00 2001 +From: Fabian Homborg +Date: Fri, 14 Feb 2020 20:41:17 +0100 +Subject: [PATCH 2/4] iothread: Include cstdint + +For uint64_t. + +Needed for some configurations with glibc. + +Fixes #6604. + +(cherry picked from commit d80d39dd6a0576e5923184815832b0938356530c) +--- + src/iothread.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/iothread.cpp b/src/iothread.cpp +index 21017fbe7..9e252260b 100644 +--- a/src/iothread.cpp ++++ b/src/iothread.cpp +@@ -14,6 +14,7 @@ + + #include + #include ++#include // for uint64_t + #include + #include + +-- +2.25.0 + diff --git a/0003-iothread-include-cstdint-correctly.patch b/0003-iothread-include-cstdint-correctly.patch new file mode 100644 index 0000000..0ad805a --- /dev/null +++ b/0003-iothread-include-cstdint-correctly.patch @@ -0,0 +1,44 @@ +From ebf8bc0db4a089c575e9208c07fd8ae8c869c7da Mon Sep 17 00:00:00 2001 +From: Fabian Homborg +Date: Fri, 14 Feb 2020 20:51:54 +0100 +Subject: [PATCH 3/4] iothread: include cstdint, correctly + +Yeah, this was needed in the *header*. + +God I hate headers. + +Fixes #6604, for real this time + +(cherry picked from commit f79ff7209627cc12e55cadf8b275a00ed4a378e7) +--- + src/iothread.cpp | 1 - + src/iothread.h | 1 + + 2 files changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/iothread.cpp b/src/iothread.cpp +index 9e252260b..21017fbe7 100644 +--- a/src/iothread.cpp ++++ b/src/iothread.cpp +@@ -14,7 +14,6 @@ + + #include + #include +-#include // for uint64_t + #include + #include + +diff --git a/src/iothread.h b/src/iothread.h +index 5d91b2b34..bdb045dfc 100644 +--- a/src/iothread.h ++++ b/src/iothread.h +@@ -4,6 +4,7 @@ + + #include + ++#include // for uint64_t + #include + #include + +-- +2.25.0 + diff --git a/0004-Fix-build-on-32-bit-systems.patch b/0004-Fix-build-on-32-bit-systems.patch new file mode 100644 index 0000000..354dfb9 --- /dev/null +++ b/0004-Fix-build-on-32-bit-systems.patch @@ -0,0 +1,35 @@ +From 4d2bb0681fab9ffa019483974a8bca8551ec5d7f Mon Sep 17 00:00:00 2001 +From: Fabian Homborg +Date: Sat, 15 Feb 2020 10:10:59 +0100 +Subject: [PATCH 4/4] Fix build on 32-bit systems + +This was a weird case of the integer converseys. + +Fixes #6609. + +(cherry picked from commit 399a71645e76ec103c32dae4caa0778b4bf57eaa) +--- + src/wutil.cpp | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/wutil.cpp b/src/wutil.cpp +index ea7bdf694..1d1f0764a 100644 +--- a/src/wutil.cpp ++++ b/src/wutil.cpp +@@ -305,10 +305,11 @@ int fd_check_is_remote(int fd) { + } + // Linux has constants for these like NFS_SUPER_MAGIC, SMB_SUPER_MAGIC, CIFS_MAGIC_NUMBER but + // these are in varying headers. Simply hard code them. +- switch (buf.f_type) { ++ // NOTE: The cast is necessary for 32-bit systems because of the 4-byte CIFS_MAGIC_NUMBER ++ switch ((unsigned int)buf.f_type) { + case 0x6969: // NFS_SUPER_MAGIC + case 0x517B: // SMB_SUPER_MAGIC +- case 0xFF534D42: // CIFS_MAGIC_NUMBER ++ case 0xFF534D42u: // CIFS_MAGIC_NUMBER + return 1; + default: + // Other FSes are assumed local. +-- +2.25.0 + diff --git a/fish.spec b/fish.spec index a2056b0..94f2c4a 100644 --- a/fish.spec +++ b/fish.spec @@ -27,7 +27,13 @@ Summary: Friendly interactive shell License: GPLv2 and BSD and ISC and LGPLv2+ and MIT URL: https://fishshell.com Source0: https://github.com/fish-shell/fish-shell/releases/download/%{version}/%{name}-%{version}.tar.gz -Patch0001: 0001-iothread-Add-missing-cstdint-include.patch +Source1: https://github.com/fish-shell/fish-shell/releases/download/%{version}/%{name}-%{version}.tar.gz.asc +Source2: gpgkey-003837986104878835FA516D7A67D962D88A709A.gpg +# Backported from upstream +Patch0001: 0001-parser-Stop-crashing-when-cwd-isn-t-readable.patch +Patch0002: 0002-iothread-Include-cstdint.patch +Patch0003: 0003-iothread-include-cstdint-correctly.patch +Patch0004: 0004-Fix-build-on-32-bit-systems.patch BuildRequires: cmake >= 3.2 BuildRequires: ninja-build @@ -37,6 +43,7 @@ BuildRequires: gettext BuildRequires: doxygen BuildRequires: ncurses-devel BuildRequires: pcre2-devel +BuildRequires: gnupg2 BuildRequires: python3-devel %global __python %{__python3} @@ -55,6 +62,7 @@ nothing to learn or configure. %prep %autosetup -p1 +%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}' rm -vrf pcre2-* # Change the bundled scripts to invoke the python binary directly. diff --git a/gpgkey-003837986104878835FA516D7A67D962D88A709A.gpg b/gpgkey-003837986104878835FA516D7A67D962D88A709A.gpg new file mode 100644 index 0000000000000000000000000000000000000000..79c7b479475a8e412ba6a17dd3c5561e67fc386e GIT binary patch literal 4438 zcmbW3XFL^t-^b4|j=dfG9D5%#n}h7o$vlM2jBFu$gphqCd;YCZheP&0*(qBj87U(n zl6}|zy6@}XgZshtx*q?YyS;>UU6OkVQ;XpY-{OyZS-B}Y@I8Q$3;k!7L@O~ARb(xNO0RDdMj3~8D`U5K^Xjr> z8*2}HXh;1dkD7(}j7Dm7&aZf2iXBQTv=4ea9qjx!JuO_YAr}hbg(_C|^k=dd#@=^^ z-$&RF>aC0SOZe1DTy&}Xvw#5JrHs>3dp-v_y8)B*18@;iPFh^Gre}@QKIGQ1{7yM@ zAnr?QkqHq#DoF>x?^L1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``m{28XKqu6#E?q~X zM*jj!pJxu%CoUPErnIfKM{5ebk@zIi1Khx04OzXCZOdDkakx7o*Xr92&3y6P$cCZa zA;H=hksB<=5s@2_vE;V2FO)W*H~!+o0Yeo*FPJNnY`BVd&~Azg8H{1`YjWPh61 zA-T$HInJeD(U_#-Br=xE*K~~FeC4&7DJk|)k6u|@((2GHp%zI=^2!o&z>M!0q@G^r z3cMbP^sSOf>5tVzdI>YfnteIm=@Ta>N^Vb4dHH5pX)F}h_gx8ZZX=mOR%iXfRM1K1 zYP9~6(=TC#SKWqVImpNP+M|;mxmR~*zB>&+C&T7 zQTvNMb98P3zZFs3?b=eug)TIX>Q`96^pCEHqjEf=(cMyzK=qu~w1)9;BaT?Dno&5C zVz@`@%fZJHz#WklG4b}O`s!D1MHBBsoX@}OJEzUPix1wcNpB4mqet2NTZOv~S^R~%GNM1{3yXf<+ zVYO0aUBI)3Ew{TPQDTzZ+Y}Qnq^o0VKLS}W*+#|VU5X4NNpYa4Y)+0bFQ~lC$-JvB<^HlqCV&QFkNtG@dWB3wh*&Mst-~Rw^ C`}J}F literal 0 HcmV?d00001 diff --git a/sources b/sources index 4092e8b..4a1d631 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ SHA512 (fish-3.1.0.tar.gz) = 143e462b5329790fa9834e135109e1397c3525756a0209d0ec68a53f7d2a1f581cd45fbbdcde6a5b53dff447da18ed6a62277993d851e7b18ef7f1a6b6d49cff +SHA512 (fish-3.1.0.tar.gz.asc) = 7d99a513653298ea1866445bb9a29f5c6844f49ab6354993eee4416d427061926b351ecf511ac53692feafa73878a473a80c8122d3d9f240789797e0708807f4