Univention Bugzilla – Attachment 9924 Details for
Bug 48992
shellcheck: quoting bugs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
SC2046_and_SC2086_quoting_issues.patch
SC2046_and_SC2086_quoting_issues.patch (text/plain), 18.29 KB, created by
Arvid Requate
on 2019-03-14 13:09 CET
(
hide
)
Description:
SC2046_and_SC2086_quoting_issues.patch
Filename:
MIME Type:
Creator:
Arvid Requate
Created:
2019-03-14 13:09 CET
Size:
18.29 KB
patch
obsolete
>diff --git a/base/univention-licence/internal-tools/make_license.sh b/base/univention-licence/internal-tools/make_license.sh >index 901f011481..8739f40203 100644 >--- a/base/univention-licence/internal-tools/make_license.sh >+++ b/base/univention-licence/internal-tools/make_license.sh >@@ -283,7 +283,7 @@ if [ -n "$LDAPSERVER" ]; then > fi > > # sign the license >-LICENSEKEY=`univentionLicenseCreateSignature -d cn="$CUSTOMER","$LDAPTMP" -k key.privat -p $( cat passwort.txt ) 2>/dev/null | grep ^univentionLicenseSignatur;` >+LICENSEKEY=`univentionLicenseCreateSignature -d cn="$CUSTOMER","$LDAPTMP" -k key.privat -p "$( cat passwort.txt )" 2>/dev/null | grep ^univentionLicenseSignatur;` > > # add the key > ( >@@ -331,13 +331,13 @@ LICENSEKEY=$( > > if [ "$INTERNAL" == 1 ]; then > mkdir -p "$INTERNALKEYS"; >- echo "$LICENSEKEY" > "$INTERNALKEYS"/"$CUSTOMER"-$( date +%y%m%d-%H%M%S ).ldif >+ echo "$LICENSEKEY" > "$INTERNALKEYS"/"$CUSTOMER"-"$( date +%y%m%d-%H%M%S )".ldif > elif [ "$EVALKEY" == 1 ]; then > mkdir -p "$EVALUATIONKEYS"/"$CUSTOMER"; >- echo "$LICENSEKEY" > "$EVALUATIONKEYS"/"$CUSTOMER"/"$CUSTOMER"-$( date +%y%m%d-%H%M%S ).ldif >+ echo "$LICENSEKEY" > "$EVALUATIONKEYS"/"$CUSTOMER"/"$CUSTOMER"-"$( date +%y%m%d-%H%M%S )".ldif > else > mkdir -p "$CUSTOMERKEYS"/"$CUSTOMER"; >- echo "$LICENSEKEY" > "$CUSTOMERKEYS"/"$CUSTOMER"/"$CUSTOMER"-$( date +%y%m%d-%H%M%S ).ldif >+ echo "$LICENSEKEY" > "$CUSTOMERKEYS"/"$CUSTOMER"/"$CUSTOMER"-"$( date +%y%m%d-%H%M%S )".ldif > fi; > > # store it to the chosen file; >diff --git a/base/univention-licence/internal-tools/make_license_v2.sh b/base/univention-licence/internal-tools/make_license_v2.sh >index 63754f24bf..5793618c4a 100644 >--- a/base/univention-licence/internal-tools/make_license_v2.sh >+++ b/base/univention-licence/internal-tools/make_license_v2.sh >@@ -336,7 +336,7 @@ if [ -n "$LDAPSERVER" ]; then > fi > > # sign the license >-LICENSEKEY=`univentionLicenseCreateSignature -d cn="$CUSTOMER","$LDAPTMP" -k key.privat -p $( cat passwort.txt ) 2>/dev/null | grep ^univentionLicenseSignatur;` >+LICENSEKEY=`univentionLicenseCreateSignature -d cn="$CUSTOMER","$LDAPTMP" -k key.privat -p "$( cat passwort.txt )" 2>/dev/null | grep ^univentionLicenseSignatur;` > > # add the key > ( >@@ -390,13 +390,13 @@ LICENSEKEY=$( > > if [ "$INTERNAL" == 1 ]; then > mkdir -p "$INTERNALKEYS"; >- echo "$LICENSEKEY" > "$INTERNALKEYS"/"$CUSTOMER"-$( date +%y%m%d-%H%M%S ).ldif >+ echo "$LICENSEKEY" > "$INTERNALKEYS"/"$CUSTOMER"-"$( date +%y%m%d-%H%M%S )".ldif > elif [ "$EVALKEY" == 1 ]; then > mkdir -p "$EVALUATIONKEYS"/"$CUSTOMER"; >- echo "$LICENSEKEY" > "$EVALUATIONKEYS"/"$CUSTOMER"/"$CUSTOMER"-$( date +%y%m%d-%H%M%S ).ldif >+ echo "$LICENSEKEY" > "$EVALUATIONKEYS"/"$CUSTOMER"/"$CUSTOMER"-"$( date +%y%m%d-%H%M%S )".ldif > else > mkdir -p "$CUSTOMERKEYS"/"$CUSTOMER"; >- echo "$LICENSEKEY" > "$CUSTOMERKEYS"/"$CUSTOMER"/"$CUSTOMER"-$( date +%y%m%d-%H%M%S ).ldif >+ echo "$LICENSEKEY" > "$CUSTOMERKEYS"/"$CUSTOMER"/"$CUSTOMER"-"$( date +%y%m%d-%H%M%S )".ldif > fi; > > # store it to the chosen file; >diff --git a/base/univention-quota/debian/univention-quota.postinst b/base/univention-quota/debian/univention-quota.postinst >index 4be16c7291..bcf75c4442 100644 >--- a/base/univention-quota/debian/univention-quota.postinst >+++ b/base/univention-quota/debian/univention-quota.postinst >@@ -38,7 +38,7 @@ eval "$(univention-config-registry shell)" > > univention-config-registry set samba/quota/command?'/usr/sbin/univention-setquota' > >-if [ ! `echo $kernel_modules | grep quota_v2` ]; then >+if [ ! "$(echo "$kernel_modules" | grep quota_v2)" ]; then > univention-config-registry set kernel/modules="$kernel_modules;quota_v2" > fi > >diff --git a/management/univention-appcenter/scripts/joinscripthelper.sh b/management/univention-appcenter/scripts/joinscripthelper.sh >index d7889eeaaa..6599122d23 100644 >--- a/management/univention-appcenter/scripts/joinscripthelper.sh >+++ b/management/univention-appcenter/scripts/joinscripthelper.sh >@@ -33,8 +33,8 @@ > JS_SCRIPT_FULLNAME="$(readlink -f "$JS_RUNNING_FILENAME")" > APP="$(echo "$JS_SCRIPT_FULLNAME" | sed 's/.*\/[0-9]\+\(\(.*\)-uninstall\.uinst\|\(.*\)\.u\?inst\)/\2\3/')" > SERVICE="$(univention-app get "$APP" Application:Name --values-only)" >-ucr_container_key="$(univention-app get $APP ucr_container_key --values-only)" >-APP_VERSION="$(univention-app get $APP version --values-only)" >+ucr_container_key="$(univention-app get "$APP" ucr_container_key --values-only)" >+APP_VERSION="$(univention-app get "$APP" version --values-only)" > CONTAINER=$(ucr get "$ucr_container_key") > > joinscript_add_simple_app_system_user () { >@@ -45,7 +45,7 @@ joinscript_add_simple_app_system_user () { > pwdfile="/etc/$APP.secret" > joinscript_run_in_container touch "$pwdfile" > joinscript_run_in_container chmod 600 "$pwdfile" >- echo "$password" > $(joinscript_container_file "$pwdfile") >+ echo "$password" > "$(joinscript_container_file "$pwdfile")" > > eval "$(ucr shell ldap/base)" > >@@ -75,15 +75,15 @@ joinscript_run_in_container () { > > joinscript_container_file_touch () { > local filename >- filename="$(joinscript_container_file $1)" >- mkdir -p "$(dirname $filename)" >+ filename="$(joinscript_container_file "$1")" >+ mkdir -p "$(dirname "$filename")" > touch "$filename" > echo "$filename" > } > > joinscript_container_file () { > joinscript_container_is_running 1>/dev/null || die >- docker_dir="$(docker inspect --format={{.GraphDriver.Data.MergedDir}} $CONTAINER)" >+ docker_dir="$(docker inspect --format='{{.GraphDriver.Data.MergedDir}}' "$CONTAINER")" > echo "${docker_dir}/${1}" > } > >diff --git a/management/univention-join/check_join_status.sh b/management/univention-join/check_join_status.sh >index c087007352..2e6d834d4d 100755 >--- a/management/univention-join/check_join_status.sh >+++ b/management/univention-join/check_join_status.sh >@@ -33,15 +33,15 @@ > LOG_FILE=/var/log/univention/check_join_status.log > > log_error () { # Log error message and exit >- local message="Error: $@" >- echo $message >- echo $message >>"$LOG_FILE" >+ local message="Error: $*" >+ echo "$message" >+ echo "$message" >>"$LOG_FILE" > exit 1 > } > log_warn () { # Log warning message >- local message="Warning: $@" >- echo $message >- echo $message >>"$LOG_FILE" >+ local message="Warning: $*" >+ echo "$message" >+ echo "$message" >>"$LOG_FILE" > } > > echo "Start $0 at $(date)" >>"$LOG_FILE" >diff --git a/management/univention-portal/33univention-portal.inst b/management/univention-portal/33univention-portal.inst >index 65778e5263..56789c9de3 100644 >--- a/management/univention-portal/33univention-portal.inst >+++ b/management/univention-portal/33univention-portal.inst >@@ -179,7 +179,7 @@ fi > if [ $JS_LAST_EXECUTED_VERSION = 0 ]; then > ucr search --brief "ucs/web/overview/entries/(admin|service)/.*/link" | awk '{print $1}' | while read k; do > key="${k%:}" >- value="$(ucr get $key)" >+ value="$(ucr get "$key")" > if [ -n "$value" ]; then > ucr set "$key"="$value" > fi >diff --git a/services/univention-printquota/debian/univention-printquotadb.postinst b/services/univention-printquota/debian/univention-printquotadb.postinst >index 44d84b39d1..7fce48b13e 100644 >--- a/services/univention-printquota/debian/univention-printquotadb.postinst >+++ b/services/univention-printquota/debian/univention-printquotadb.postinst >@@ -65,7 +65,7 @@ if [ ! "$pykotadb" ] ;then > su - postgres -c "PGOPTIONS='-c client_min_messages=ERROR ' psql -d template1 -f /usr/share/univention-printquotadb/pykota-postgresql.sql" > /dev/null > fi > >-secret=`cat $cups_quota_secret` >+secret=`cat "$cups_quota_secret"` > su - postgres -c "echo \"ALTER USER pykotaadmin PASSWORD '$secret';\" |psql -d pykota" > #su - postgres -c "echo \"ALTER USER pykotaadmin PASSWORD '';\" |psql -d pykota" > >diff --git a/services/univention-s4-connector/debian/univention-s4-connector.postinst b/services/univention-s4-connector/debian/univention-s4-connector.postinst >index 8467ed0429..be902f704e 100644 >--- a/services/univention-s4-connector/debian/univention-s4-connector.postinst >+++ b/services/univention-s4-connector/debian/univention-s4-connector.postinst >@@ -154,7 +154,7 @@ if [ -x /etc/init.d/univention-s4-connector ] && [ -f /usr/share/univention-join > # Bug 43397 > if [ "$1" = "configure" -a -n "$2" ] && dpkg --compare-versions "$2" lt 11.0.6-4 ; then > # cleanup wrong formatted `connector/s4/mapping/dns/ignorelist` >- ucr set connector/s4/mapping/dns/ignorelist=$(echo "$connector_s4_mapping_dns_ignorelist" | sed -e 's/^DC=//i' -e 's/,DC=/,/gi') >+ ucr set connector/s4/mapping/dns/ignorelist="$(echo "$connector_s4_mapping_dns_ignorelist" | sed -e 's/^DC=//i' -e 's/,DC=/,/gi')" > fi > > # Bug 44333 >diff --git a/services/univention-samba/26univention-samba.inst b/services/univention-samba/26univention-samba.inst >index 1abe544ceb..dddc8c1a88 100755 >--- a/services/univention-samba/26univention-samba.inst >+++ b/services/univention-samba/26univention-samba.inst >@@ -155,7 +155,7 @@ extract_bind_credentials "$@" > > if [ -n "$dcaccount" -a -n "$bindpwdfile" ]; then > samba_account="$dcaccount" >- samba_pwd="$(< $bindpwdfile)" >+ samba_pwd="$(< "$bindpwdfile")" > else > if is_ucr_true ad/member; then > echo "INFO: Cannot run joinscript in memberserver mode without join credentials. Please run:" >@@ -174,16 +174,16 @@ configure_samba_role > # configure profile/home settings > if [ "$samba_role" = "domaincontroller" ]; then > if [ -n "$samba_netbios_name" ]; then >- tmphostname=$samba_netbios_name >+ tmphostname="$samba_netbios_name" > elif [ -n "$samba_ha_master" ]; then > tmphostname="$samba_ha_master" > else > tmphostname="$hostname" > fi > univention-config-registry set \ >- samba/profileserver?$tmphostname \ >+ samba/profileserver?"$tmphostname" \ > samba/profilepath?'%U\windows-profiles\%a' \ >- samba/homedirserver?$tmphostname \ >+ samba/homedirserver?"$tmphostname" \ > samba/homedirpath?%U \ > samba/homedirletter?I > fi >diff --git a/services/univention-samba4/96univention-samba4.inst b/services/univention-samba4/96univention-samba4.inst >index 7d43757833..a6ae715b9b 100755 >--- a/services/univention-samba4/96univention-samba4.inst >+++ b/services/univention-samba4/96univention-samba4.inst >@@ -500,7 +500,7 @@ remove_dc_ntds_guid_records_from_dns() { > > univention-directory-manager dns/alias list "$@" \ > --superordinate "$zoneDN" \ >- --filter "(&(cname="$hostname.$domainname.")(name=*._msdcs))" \ >+ --filter "(&(cname=$hostname.$domainname.)(name=*._msdcs))" \ > | sed -n 's/^DN: //p' | while read recordDN; do > > univention-directory-manager dns/alias delete "$@" \ >diff --git a/services/univention-samba4/98univention-samba4-saml-kerberos.inst b/services/univention-samba4/98univention-samba4-saml-kerberos.inst >index 0c660da65c..46befcd36c 100755 >--- a/services/univention-samba4/98univention-samba4-saml-kerberos.inst >+++ b/services/univention-samba4/98univention-samba4-saml-kerberos.inst >@@ -72,7 +72,7 @@ if [ "$server_role" == "domaincontroller_master" ]; then > done > > if [ -n "$spn_account_dn" ] && [ -n "$previous_spn_secrets_password" ]; then >- test_output=$(ldbsearch -k no -H ldap://$(hostname -f) -U"$spn_account_name" \ >+ test_output=$(ldbsearch -k no -H ldap://"$(hostname -f)" -U"$spn_account_name" \ > --password="$previous_spn_secrets_password" -b "$spn_account_dn" -s base dn 2>/dev/null \ > | sed -n 's/^dn: //p') > if [ -n "$test_output" ]; then >diff --git a/services/univention-samba4/debian/univention-samba4.postinst b/services/univention-samba4/debian/univention-samba4.postinst >index 3aeb5168dc..8e1c65a31b 100644 >--- a/services/univention-samba4/debian/univention-samba4.postinst >+++ b/services/univention-samba4/debian/univention-samba4.postinst >@@ -312,7 +312,7 @@ if [ "$1" = "configure" ]; then > ## https://forge.univention.org/bugzilla/show_bug.cgi?id=26641 > > # get the secret from ldb >- secret="$(ldbsearch -H /var/lib/samba/private/secrets.ldb flatname=$windows_domain secret | sed -ne 's|secret: ||p')" >+ secret="$(ldbsearch -H /var/lib/samba/private/secrets.ldb flatname="$windows_domain" secret | sed -ne 's|secret: ||p')" > # get the host dn > dn="$(ldbsearch -H /var/lib/samba/private/sam.ldb "(&(cn=$hostname)(objectClass=computer))" dn | ldapsearch-wrapper | sed -ne 's|^dn: ||p')" > if [ -n "$dn" -a -n "$secret" ]; then >diff --git a/services/univention-samba4/sysvol-sync-scripts/sysvol-sync.sh b/services/univention-samba4/sysvol-sync-scripts/sysvol-sync.sh >index f38994be16..79287e900e 100644 >--- a/services/univention-samba4/sysvol-sync-scripts/sysvol-sync.sh >+++ b/services/univention-samba4/sysvol-sync-scripts/sysvol-sync.sh >@@ -34,7 +34,7 @@ > > log() { > local msg="${2//$'\r'/}" >- builtin echo $(date +"%F %T") "$1" "${msg//$'\n'/}" 1>&2 >+ builtin echo "$(date +"%F %T")" "$1" "${msg//$'\n'/}" 1>&2 > } > > stderr_log_error() { >@@ -282,8 +282,8 @@ fix_gpt_ini () { > # multiple gpt.ini's found, delete first element of list (newest gpt.ini) and remove the rest > gpts=("${gpts[@]:1}") > for gpt in "${gpts[@]}"; do >- local file=${gpt#* } >- test -f $file && rm $file >+ local file="${gpt#* }" >+ test -f "$file" && rm "$file" > done > fi > done < <(find "$poldir" -maxdepth 1 -type d -name '{*}') >diff --git a/test/product-tests/samba/single-server.sh b/test/product-tests/samba/single-server.sh >index 5f42dc9a9d..a7a9102468 100644 >--- a/test/product-tests/samba/single-server.sh >+++ b/test/product-tests/samba/single-server.sh >@@ -40,7 +40,7 @@ udm users/user create --position "cn=users,$ldap_base" --set username="newuser01 > udm shares/share create --position "cn=shares,$ldap_base" --set name="testshare" \ > --set host="$(hostname -f)" --set path="/home/testshare" > udm shares/printer create --position "cn=printers,$ldap_base" --set name="printer1" \ >- --set spoolHost=$(hostname -f) --set uri="cups-pdf:/" --set model="cups-pdf/CUPS-PDF.ppd" >+ --set spoolHost="$(hostname -f)" --set uri="cups-pdf:/" --set model="cups-pdf/CUPS-PDF.ppd" > sleep 15 > > # Login als Domänen-Administrator am Windows-Client >@@ -54,36 +54,36 @@ python shared-utils/ucs-winrm.py domain-user-validate-password --domainuser "new > # * Dateirechte aus Homeshare prüfen: > # ** Windows: Rechte Maustaste, Eigenschaften.. > # ** Server: getfacl >-python shared-utils/ucs-winrm.py create-share-file --server $UCS --filename test-admin.txt \ >+python shared-utils/ucs-winrm.py create-share-file --server "$UCS" --filename test-admin.txt \ > --username 'Administrator' --userpwd "$ADMIN_PASSWORD" --share Administrator > stat /home/Administrator/test-admin.txt > getfacl /home/Administrator/test-admin.txt | grep "Domain.*Admin" >-python shared-utils/ucs-winrm.py create-share-file --server $UCS --filename test-newuser01.txt \ >+python shared-utils/ucs-winrm.py create-share-file --server "$UCS" --filename test-newuser01.txt \ > --username 'newuser01' --userpwd "Univention.99" --share newuser01 > stat /home/newuser01/test-newuser01.txt > getfacl /home/newuser01/test-newuser01.txt | grep "Domain.*Users" >-python shared-utils/ucs-winrm.py create-share-file --server $UCS --filename test-admin.txt \ >+python shared-utils/ucs-winrm.py create-share-file --server "$UCS" --filename test-admin.txt \ > --username 'Administrator' --userpwd "$ADMIN_PASSWORD" --share testshare > stat /home/testshare/test-admin.txt > > # this should fail >-python shared-utils/ucs-winrm.py create-share-file --server $UCS --filename test-newuser01.txt \ >+python shared-utils/ucs-winrm.py create-share-file --server "$UCS" --filename test-newuser01.txt \ > --username 'newuser01' --userpwd "Univention.99" --share testshare --debug 2>&1 | grep 'denied.' >-python shared-utils/ucs-winrm.py create-share-file --server $UCS --filename test-newuser01.txt \ >+python shared-utils/ucs-winrm.py create-share-file --server "$UCS" --filename test-newuser01.txt \ > --username 'newuser01' --userpwd "Univention.99" --share Administrator --debug 2>&1 | grep 'denied.' > > # check windows acl's >-python shared-utils/ucs-winrm.py get-acl-for-share-file --server $UCS --filename test-newuser01.txt \ >+python shared-utils/ucs-winrm.py get-acl-for-share-file --server "$UCS" --filename test-newuser01.txt \ > --username 'newuser01' --userpwd "Univention.99" --share newuser01 --debug | grep "Group.*Domain Users" >-python shared-utils/ucs-winrm.py get-acl-for-share-file --server $UCS --filename test-admin.txt \ >+python shared-utils/ucs-winrm.py get-acl-for-share-file --server "$UCS" --filename test-admin.txt \ > --username 'Administrator' --userpwd "$ADMIN_PASSWORD" --share Administrator --debug | grep "Group.*Domain Admins" > su newuser01 -c "touch /home/newuser01/newfile.txt" >-python shared-utils/ucs-winrm.py get-acl-for-share-file --server $UCS --filename newfile.txt \ >+python shared-utils/ucs-winrm.py get-acl-for-share-file --server "$UCS" --filename newfile.txt \ > --username 'newuser01' --userpwd "Univention.99" --share newuser01 --debug | grep "Group.*Domain Users" > > # create files on samba and check share > su Administrator -c "touch /home/Administrator/newfile.txt" >-python shared-utils/ucs-winrm.py get-acl-for-share-file --server $UCS --filename newfile.txt \ >+python shared-utils/ucs-winrm.py get-acl-for-share-file --server "$UCS" --filename newfile.txt \ > --username 'Administrator' --userpwd "$ADMIN_PASSWORD" --share Administrator --debug | grep "Group.*Domain Admins" > > # * GPO's >@@ -128,12 +128,12 @@ for user in $users; do > --set password=$password --set lastname=$user --set username=$user > udm users/user modify \ > --dn "$(univention-ldapsearch -LLL uid=$user dn | sed -n 's/^dn: //p')" \ >- --set password=$password --set overridePWHistory=1 >+ --set password="$password" --set overridePWHistory=1 > done > sleep 10 > for client in $clients; do > for user in $users; do >- smbclient //$client/IPC\$ -U "$user"%"$password" -c exit >+ smbclient //"$client"/IPC\$ -U "$user"%"$password" -c exit > done > done > # password change via windows >@@ -145,18 +145,18 @@ sleep 10 > # check password > for user in $users; do > for client in $clients; do >- smbclient //$client/IPC\$ -U "$user"%"$password" -c exit >+ smbclient //"$client"/IPC\$ -U "$user"%"$password" -c exit > done >- echo $password > /tmp/.usertest >- kinit --password-file=/tmp/.usertest $user >+ echo "$password" > /tmp/.usertest >+ kinit --password-file=/tmp/.usertest "$user" > done > # check sid uid wbinfo > for user in $USERS; do > uidNumber="$(univention-ldapsearch -LLL uid=$user uidNumber | sed -n 's/^uidNumber: //p')" > sid="$(univention-ldapsearch -LLL uid=$user sambaSID | sed -n 's/^sambaSID: //p')" >- test $uidNumber = $(wbinfo -S $sid) >- test $sid = $(wbinfo -U $uidNumber) >- wbinfo -i $windows_domain+$user >+ test "$uidNumber" = "$(wbinfo -S "$sid")" >+ test "$sid" = "$(wbinfo -U "$uidNumber")" >+ wbinfo -i "$windows_domain+$user" > done > >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 48992
: 9924