Univention Bugzilla – Bug 40386
ucslint: check quoting of unwanted glob patterns
Last modified: 2016-02-24 13:07:46 CET
ucslint should check for unquoted glob characters in arguments. e.g. tr [:upper:] [:lower:] It's most often not wanted to use glob patterns (See Bug #40031).
ucslint.yaml: r66629 | Bug #40386: updated yaml r66628 | Bug #40386: added check for unwanted shell glob patterns ucslint (5.0.2-1): r66628 | Bug #40386: added check for unwanted shell glob patterns
In general this looks very good. But: Is it okay to flag the occurrence as "error"? Because we currently have some packages in UCS 4.0-x which would fail to build with the new version. I don't know which ucslint version is used by our buildsystem, probably the one from the release. So it would okay as every package in UCS 4.1 and UCS@school 4.1 is "now" okay. It did not detect: echo Aa | tr -d [:lower:] base/univention-lib/shell/base.sh: ucr_varname="$(echo "$name" | tr [A-Z] [a-z] | sed 's| ||g')" base/univention-system-setup/usr/lib/univention-system-setup/scripts/10_basis/10hostname: 289 » kadmin -l ext "ldap/$new_hostname.$domainname@`echo $kerberos_realm | tr [[:lower:]] [[:upper:]]`" The following files are not detected as shell scripts: management/univention-directory-manager-modules/test/univention-admin-test ucs-test/tests/59_udm/udm.sh ucs-test/tests/10_ldap/42replication_uppercase I leave it up to you which ones you want to fix. I think [[:upper:]] should also be detected, the other ones aren't that important.
(In reply to Florian Best from comment #2) > In general this looks very good. But: Is it okay to flag the occurrence as > "error"? Because we currently have some packages in UCS 4.0-x which would > fail to build with the new version. I don't know which ucslint version is > used by our buildsystem, probably the one from the release. So it would okay > as every package in UCS 4.1 and UCS@school 4.1 is "now" okay. The package build for UCS 4.0 uses the ucslint from UCS 4.0. > It did not detect: > echo Aa | tr -d [:lower:] > > base/univention-lib/shell/base.sh: > ucr_varname="$(echo "$name" | tr [A-Z] [a-z] | sed 's| ||g')" > > base/univention-system-setup/usr/lib/univention-system-setup/scripts/ > 10_basis/10hostname: > 289 » kadmin -l ext "ldap/$new_hostname.$domainname@`echo $kerberos_realm > | tr [[:lower:]] [[:upper:]]`" Fixed. > The following files are not detected as shell scripts: > management/univention-directory-manager-modules/test/univention-admin-test > ucs-test/tests/59_udm/udm.sh > ucs-test/tests/10_ldap/42replication_uppercase I will skip these for now. ucslint.yaml: r67372 | Bug #40386, #40639: updated yaml r66629 | Bug #40386: updated yaml r66628 | Bug #40386: added check for unwanted shell glob patterns ucslint (5.0.3-1): r67371 | Bug #40386: improved check for unwanted shell glob patterns r67366 | Bug #40386: improved check for unwanted shell glob patterns r66628 | Bug #40386: added check for unwanted shell glob patterns
OK: fix OK: YAML
<http://errata.software-univention.de/ucs/4.1/117.html>