stevejenkins / unifi-linux-utils

Helpful Linux / Unix scripts for admins of Ubiquiti (UBNT) UniFi wireless products
https://www.stevejenkins.com/blog/tag/unifi/
MIT License
695 stars 127 forks source link

Improved bash tests and quoting #39

Closed kolbe closed 4 years ago

kolbe commented 5 years ago

Many variable expansions were not properly quoted, which could cause variables with unexpected characters (spaces, wildcards, etc.) to cause unexpected results and very dangerous side-effects.

This patch quotes all variable expansions, except in double-bracket tests (where expansions do not need to be quoted on the left-hand side of operators), and makes all tests double-bracket tests.