Bug 40031 - missing escapes in "univention-lib"
missing escapes in "univention-lib"
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UCR
UCS 4.1
Other Linux
: P5 normal (vote)
: UCS 4.1-0-errata
Assigned To: Philipp Hahn
Florian Best
:
Depends on: 41597
Blocks: 40384 40479 40712
  Show dependency treegraph
 
Reported: 2015-11-19 10:15 CET by Jens Thorp-Hansen
Modified: 2016-07-11 17:19 CEST (History)
4 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Thorp-Hansen univentionstaff 2015-11-19 10:15:14 CET

    
Comment 1 Florian Best univentionstaff 2015-11-19 10:20:28 CET
Can you please describe what you mean?
Comment 2 Jens Thorp-Hansen univentionstaff 2015-11-19 10:21:27 CET
When executing some univention commands the following line appears in the terminal:

tr: misaligned [:upper:] and/or [:lower:] construct

The problem seems to be in the function " is_ucr_true" in the file /usr/share/univention-lib/ucr.sh. there the parameter " [:upper:]" und " [:lower:]" for tr do not escape properly - now all files in the working directory (normally /root/) and with names like u, p, e, r, l, o or w will be matched as shell-pattern. 

Then the function produces these results.
Comment 3 Philipp Hahn univentionstaff 2016-01-06 21:07:50 CET
Fix the following instances of is_ucr_XXX and derivates:

base/univention-heimdal/15univention-heimdal-kdc.inst
base/univention-lib/shell/base.sh
base/univention-lib/shell/ucr.sh
base/univention-system-setup/usr/lib/univention-system-setup/scripts/10_basis/10hostname
base/univention-system-setup/usr/lib/univention-system-setup/scripts/setup_utils.sh
base/univention-updater/script/postup.sh
base/univention-updater/script/preup.sh
management/univention-directory-manager-modules/test/univention-admin-test
management/univention-ldap/10univention-ldap-server.inst
services/univention-bind/90univention-bind-post.inst
services/univention-samba4/lib/base.sh
services/univention-samba4/scripts/setup-dns-in-ucsldap.sh
test/ucs-test/tests/10_ldap/42replication_uppercase
test/ucs-test/tests/59_udm/udm.sh

Package: univention-heimdal
Version: 9.0.1-2.159.201601062025
Branch: ucs_4.1-0
Scope: errata4.1-0

Package: univention-lib
Version: 5.0.0-13.319.201601062026
Branch: ucs_4.1-0
Scope: errata4.1-0

Package: univention-system-setup
Version: 9.0.2-23.939.201601062027
Branch: ucs_4.1-0
Scope: errata4.1-0

Package: univention-updater
Version: 11.0.7-11.1441.201601062031
Branch: ucs_4.1-0
Scope: errata4.1-0

Package: univention-directory-manager-modules
Version: 11.0.2-10.1361.201601062032
Branch: ucs_4.1-0
Scope: errata4.1-0

Package: univention-ldap
Version: 12.1.6-7.792.201601062033
Branch: ucs_4.1-0
Scope: errata4.1-0

Package: univention-bind
Version: 10.0.2-5.218.201601062034
Branch: ucs_4.1-0
Scope: errata4.1-0

Package: univention-samba4
Version: 5.0.1-18.638.201601062034
Branch: ucs_4.1-0
Scope: errata4.1-0

Package: ucs-test
Version: 6.0.31-8.1378.201601062035
Branch: ucs_4.1-0
Scope: errata4.1-0

r66615 | Bug #40031: Fix shell escaping YAML
 univention-bind.yaml
 univention-directory-manager-modules.yaml
 univention-heimdal.yaml
 univention-ldap.yaml
 univention-lib.yaml
 univention-samba4.yaml
 univention-system-setup.yaml
 univention-updater.yaml
Comment 4 Florian Best univentionstaff 2016-01-08 13:01:39 CET
Hm, It would have been better to replace all the is_ucr_false copies by that new function in univention-lib.

(In reply to Philipp Hahn from comment #3)
> Fix the following instances of is_ucr_XXX and derivates:
> 
> base/univention-heimdal/15univention-heimdal-kdc.inst
OK
> base/univention-lib/shell/base.sh
custom_username → OK
custom_groupname → OK
> base/univention-lib/shell/ucr.sh
is_ucr_true → OK
is_ucr_false → OK
> base/univention-system-setup/usr/lib/univention-system-setup/scripts/
> 10_basis/10hostname
OK
> base/univention-system-setup/usr/lib/univention-system-setup/scripts/
> setup_utils.sh
is_profile_var_true → OK
> base/univention-updater/script/postup.sh
Code-Review: OK
> base/univention-updater/script/preup.sh
Code-Review: OK
> management/univention-directory-manager-modules/test/univention-admin-test
Code-Review: OK
> management/univention-ldap/10univention-ldap-server.inst
OK
> services/univention-bind/90univention-bind-post.inst
OK
> services/univention-samba4/lib/base.sh
univention_samba4_is_ucr_false → OK
> services/univention-samba4/scripts/setup-dns-in-ucsldap.sh
OK
> test/ucs-test/tests/10_ldap/42replication_uppercase
Code-Review: OK
> test/ucs-test/tests/59_udm/udm.sh
Code-Review: OK
Comment 6 Stefan Gohmann univentionstaff 2016-01-14 09:12:55 CET
Resetting to verified since not all errata updates have been announced.
Comment 7 Janek Walkenhorst univentionstaff 2016-01-20 13:24:47 CET
<http://errata.software-univention.de/ucs/4.1/58.html>
Comment 8 Stefan Gohmann univentionstaff 2016-01-20 13:37:13 CET
Resetting to verified since not all errata updates have been announced.
Comment 9 Arvid Requate univentionstaff 2016-01-20 18:24:33 CET
Note: This is the german translation of the error message:

tr: fehlerhaft positioniertes [:upper:]- und/oder [:lower:]-Konstrukt

We have seen this at Ticket#2016011921000162 on one UCS 4.0-4 DC Slave (errata 386 at the time of analysis), where is_ucr_true failed with this message in a joinscript. As a result it took the wrong if/then/else branch.
Comment 10 Janek Walkenhorst univentionstaff 2016-01-27 16:28:10 CET
<http://errata.software-univention.de/ucs/4.1/68.html>
Comment 11 Arvid Requate univentionstaff 2016-01-27 19:32:03 CET
Resetting to verified since not all errata updates have been announced.