gnubee-tools icon indicating copy to clipboard operation
gnubee-tools copied to clipboard

Fixes and improvements

Open jjakob opened this issue 3 years ago • 2 comments

This fixes some bugs I ran into and adds some new features. See the commits for more information.

jjakob avatar Feb 17 '21 20:02 jjakob

Thanks for the patches.... However I really don't like the excessive quotes. This is C. Quotes don't say "this is a string" - because everything is. Quotes say "this needs to be protected. So quoting a constant string with no spaces or special characters like

echo "UNKNOWN"

is pointless.

Also with variable assignment there is no wildcard or IFS interpretation so

proc=readlink $prog

does not need extra quotes ... except maybe around the "$prog".

It is always appropriate to quote a variable when it appears in command like arguments (unless you want spaces to be processed), but most other places where you have added quotes, I'd really rather not have them.

Also, you have added E: W: I: in front of lots of messages, without any explanation in the commit message. I'm not completely against these annotations, though I really prefer to see "ERROR" when there is an error, and "WARNING" when there is a warning.

Your other changes that change the behaviour, like the dropbear changes and the debian mirror configuration do look useful. If you could provide a pull request that just, I would appreciate it. And if you really want to include lots of quotes in the code you submit, then I won't object. I just don't think there is any value in adding lots of quotes to code that isn't wrong.

Thanks.

neilbrown avatar Feb 20 '21 06:02 neilbrown

I add quotes around everything, even if not technically needed, out of habit. I agree quotes around constant strings are pointless. Others I add due to security, to prevent possibly malicious code getting executed (ACE). Since using a remote gnubee system as the source of many variables this is also possible if the system ssh connects to a different host or that host is compromised. I know, it's very unlikely in this case as the environments are controlled, but more quoting in the right places doesn't do any harm.

I'll go through it and see what I can do.

jjakob avatar Feb 20 '21 11:02 jjakob