Bug 33727 - Wrong netmask in univention-server-join - needs additional shell indirection
Wrong netmask in univention-server-join - needs additional shell indirection
Status: RESOLVED WONTFIX
Product: UCS
Classification: Unclassified
Component: Join (univention-join)
UCS 3.2
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-12-11 14:21 CET by Philipp Hahn
Modified: 2017-08-08 07:10 CEST (History)
1 user (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:
Flags outvoted (downgraded) after PO Review:
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 Philipp Hahn univentionstaff 2013-12-11 14:21:44 CET
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.
Comment 1 Philipp Hahn univentionstaff 2013-12-11 14:38:54 CET
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
Comment 2 Stefan Gohmann univentionstaff 2013-12-17 08:20:18 CET
What is the result?
Comment 3 Philipp Hahn univentionstaff 2014-01-13 09:51:27 CET
(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.
Comment 4 Philipp Hahn univentionstaff 2014-01-13 11:41:47 CET
(In reply to Stefan Gohmann from comment #2)
> What is the result?

See Bug #33258 where the registration went wrong.
Comment 5 Stefan Gohmann univentionstaff 2017-06-16 20:36:02 CEST
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.
Comment 6 Stefan Gohmann univentionstaff 2017-08-08 07:10:41 CEST
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.