Univention Bugzilla – Bug 33727
Wrong netmask in univention-server-join - needs additional shell indirection
Last modified: 2017-08-08 07:10:41 CEST
management/univention-join/univention-server-join:324 does not work as expected: @@ -316,7 +321,8 @@ if [ -n "$IP" ]; then subnet="$(univention-ipcalc6 --ip "$IP" --netmask "$NETMASK" --output reverse --calcdns)" else # Fallback - subnet="$(univention-ipcalc6 --ip "$IP" --netmask "$interfaces_${interfaces_primary:-eth0}_netmask" --output reverse --calcdns)" + varname="interfaces_${interfaces_primary:-eth0}_netmask" + subnet="$(univention-ipcalc6 --ip "$IP" --netmask "${!varname}" --output reverse --calcdns)" fi log 0 " Calculated subnet = $subnet" Bug #28562 would better, as it would also support passing multiple IPs.
Same problem is also in univention-join:879 @@ -875,7 +876,8 @@ if [ -d /etc/runit/univention-directory-listener ]; then /etc/init.d/univention-directory-listener restart >>/var/log/univention/join.log 2>&1 fi -if [ "$interfaces_${interfaces_primary:-eth0}_type" != "dhcp" ]; then +varname="interfaces_${interfaces_primary:-eth0}_type" +if [ "${!varname}" != "dhcp" ]; then univention-config-registry commit /etc/resolv.conf >>/var/log/univention/join.log 2>&1 fi
What is the result?
(In reply to Stefan Gohmann from comment #2) > What is the result? $ bash $ interfaces_primary=eth1 $ interfaces_eth1_type=xxx $ echo "$interfaces_${interfaces_primary:-eth0}_type" eth1_type $ varname="interfaces_${interfaces_primary:-eth0}_type" $ echo "${!varname}" xxx $interfaces_primary is ignored and so the wrong interface of the server is registered, leading to strage problems.
(In reply to Stefan Gohmann from comment #2) > What is the result? See Bug #33258 where the registration went wrong.
This issue has been filed against UCS 3. UCS 3 is out of the normal maintenance and many UCS components have vastly changed in UCS 4. If this issue is still valid, please change the version to a newer UCS version otherwise this issue will be automatically closed in the next weeks.
This issue has been filed against UCS 3.2. UCS 3.2 is out of maintenance and many UCS components have vastly changed in later releases. Thus, this issue is now being closed. If this issue still occurs in newer UCS versions, please use "Clone this bug" or reopen this issue. In this case please provide detailed information on how this issue is affecting you.