Re: [qubes-devel] Why code review is hard

2022-02-13 Thread Holger Levsen
On Sun, Feb 13, 2022 at 11:52:53AM +0100, David Hobach wrote: > I never stated it is. It was just a general comment on code review and > bash in specific - especially since I'm aware that Qubes has a lot of > bash in sometimes security relevant places (qubes-dom0-update, qubes-rpc, > ...). ah,

Re: [qubes-devel] Why code review is hard

2022-02-13 Thread David Hobach
On 2/13/22 10:05, Holger Levsen wrote: On Sat, Feb 12, 2022 at 01:03:35PM +0100, David Hobach wrote: just stumbled across it and was wondering what a reviewer would expect from this code to do: [...] At least on my amchine it executes "badCode" in both domU and dom0. I might miss where you

Re: [qubes-devel] Why code review is hard

2022-02-13 Thread Frédéric Pierret
Hi, Le 2/13/22 à 10:05, Holger Levsen a écrit : On Sat, Feb 12, 2022 at 01:03:35PM +0100, David Hobach wrote: just stumbled across it and was wondering what a reviewer would expect from this code to do: [...] At least on my amchine it executes "badCode" in both domU and dom0. I might miss

Re: [qubes-devel] Why code review is hard

2022-02-13 Thread Holger Levsen
On Sat, Feb 12, 2022 at 01:03:35PM +0100, David Hobach wrote: > just stumbled across it and was wondering what a reviewer would expect from > this code to do: [...] > At least on my amchine it executes "badCode" in both domU and dom0. I might miss where you stumbled upon this, but how is this

Re: [qubes-devel] Why code review is hard

2022-02-12 Thread Demi Marie Obenour
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On Sat, Feb 12, 2022 at 05:31:04PM +0100, HW42 wrote: > Brendan Hoar: > > On Sat, Feb 12, 2022 at 7:03 AM David Hobach wrote: > > > >> Dear all, > >> > >> just stumbled across it and was wondering what a reviewer would > >> expect from this code

Re: [qubes-devel] Why code review is hard

2022-02-12 Thread HW42
David Hobach: [...] > Btw I now believe that the {echo in the original example is considered > a string and the second } closes the function. Yes. > I just don't understand why the case/esac can be used to remove the > syntax error caused by the double } }. But oh well... See my previous mail.

Re: [qubes-devel] Why code review is hard

2022-02-12 Thread David Hobach
On 2/12/22 17:52, Brendan Hoar wrote: On Sat, Feb 12, 2022 at 11:31 AM HW42 wrote: So this is probably not even a bug. Thanks for the nice example David (apropos shell: set -e semantics are also "fun"). Simon I’m going to guess (again, away from Linux terminal right now) that the

Re: [qubes-devel] Why code review is hard

2022-02-12 Thread Brendan Hoar
On Sat, Feb 12, 2022 at 11:31 AM HW42 wrote: > So this is probably not even a bug. Thanks for the nice example David > (apropos shell: set -e semantics are also "fun"). > > Simon I’m going to guess (again, away from Linux terminal right now) that the shellcheck command would probably flag

Re: [qubes-devel] Why code review is hard

2022-02-12 Thread HW42
Brendan Hoar: > On Sat, Feb 12, 2022 at 7:03 AM David Hobach wrote: > >> Dear all, >> >> just stumbled across it and was wondering what a reviewer would >> expect from this code to do: >> >> ``` >> #!/bin/bash >> >> function badCode { >> echo "bad code executed" >> } >> >> function testCode { >>

Re: [qubes-devel] Why code review is hard

2022-02-12 Thread Brendan Hoar
On Sat, Feb 12, 2022 at 7:03 AM David Hobach wrote: > Dear all, > > just stumbled across it and was wondering what a reviewer would expect > from this code to do: > > ``` > #!/bin/bash > > function badCode { > echo "bad code executed" > } > > function testCode { > #pick some existing file,

[qubes-devel] Why code review is hard

2022-02-12 Thread David Hobach
Dear all, just stumbled across it and was wondering what a reviewer would expect from this code to do: ``` #!/bin/bash function badCode { echo "bad code executed" } function testCode { #pick some existing file, nonexisting works too though echo "/etc/passwd" } function tfunc { local foo=