Univention Bugzilla – Bug 32463
Quoting problems in system setup profile
Last modified: 2013-09-24 11:09:45 CEST
Currently we have a problem with special characters in the system setup profile, for example for the root_password.
Something for our quoting expert ... ;) See also here: http://forum.univention.de/viewtopic.php?f=48&t=2826
The shell function get_profile_var() wrongly stripped all quotes from the profile variable. Please note that the profile file is not shell correctly quoted, but simply uses the format key="value" or key='value'; if value contains " or ' that would breaks shell parsing. Therefore it's required to use the above mentioned shell function. Patch extracted from attachment 5319 [details] of Bug #32324 and applied to 3.2 and 3.1-1. 3.2-0: r43740 univention-system-setup_7.0.35-1.505.201309051608 3.1-1: r43741 univention-system-setup_6.0.76-20.506.201309051608 changelog-3.2.xml, 2013-09-05-univention-system-setup.yaml: r43743 A profile parsing function was fixed to not strip all double quotes from supplied values, which now allows to use quotes in passwords # . /usr/lib/univention-system-setup/scripts/setup_utils.sh # cat >>"$profile_file" <<__TEST__ p1="root" p2='root' p3="root'root" p4='root"root' __TEST__ # get_profile_var p1 # root → root # get_profile_var p2 # 'root' → root # get_profile_var p3 # root'root → root'root # get_profile_var p4 # 'rootroot' → root"root
r43764: Fix '/' in UCRV names 3.2-0: 7.0.35-2.507.201309061048 3.1-0: 6.0.76-21.508.201309061048, YAML r43765 # . /usr/lib/univention-system-setup/scripts/setup_utils.sh # echo 'ldap/base="dc=autotest090,dc=local" >>"$profile_file" # get_profile_var "ldap/base" dc=autotest090,dc=local
OK: works perfectly OK: ucs-3.2 changelog OK: YAML
There was the additional problem, that the password could not contain the hash (#) character, since everything after the first # in a line of the profile was stripped. The regexp to parse the profile has been changed to allow comments only on lines by itself; trailing comments are no longer allowed: OK: # this is a comment variable=value variable="value" variable='value' # trailing space ^ after the final ' or " are stripped INVALID: variable=value # this is a comment (In the invalid example the variable is set to the complete trailing string "value # this is a comment" and not only "value".) Please note, that the current documentation also only mentions full-line comments at <http://docs.univention.de/installation-3.1.html#profile:variables>: > Multiple values for one variable are separated by blank spaces. Lines are commented out with #. r44064 | Bug #32463: Fix parsing profile univention-system-setup_7.0.42-2.516.201309161259
3.1-1: r44147 | Bug #32463: USS: Fix parsing profile r44146 | Bug #32463: USS: Fix parsing profile
OK: ucs-3.1-1 svn OK: ucs-3.2-0 svn OK: works OK: YAML
http://errata.univention.de/ucs/3.1/183.html