Bug 25626 - univention-ipcalc --help
univention-ipcalc --help
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Network
UCS 3.0
Other Linux
: P5 normal (vote)
: UCS 3.1
Assigned To: Philipp Hahn
Janek Walkenhorst
: interim-1
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-23 16:09 CET by Stefan Gohmann
Modified: 2012-12-12 21:10 CET (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): Cleanup, Troubleshooting
Max CVSS v3 score:
hahn: Patch_Available+


Attachments
Rewrite (7.29 KB, text/plain)
2012-08-06 22:14 CEST, Philipp Hahn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Gohmann univentionstaff 2011-12-23 16:09:30 CET
root@master611:~# /usr/bin/univention-ipcalc --help
option --help not recognized
Comment 1 Stefan Gohmann univentionstaff 2011-12-23 16:09:47 CET
Es sollte eine Hilfeausgabe hinzugefügt werden.
Comment 2 Philipp Hahn univentionstaff 2012-08-06 22:13:48 CEST
Das Programm braucht nicht nur eine Hilfe (vgl Bug #28143), sondern auch einen Rewrite.

|	for i in range(4):
|		...
|			if calc == '0' and i == '4':
|				broadcast.append(str('255'))
Der Fall kann nie eintreten.


| # univention-ipcalc --ip 1.2.3.4 --netmask 255.0.0.0 --output pointer
| 4.3.2
| # univention-ipcalc --ip 1.2.3.4 --netmask 255.255.0.0 --output pointer
| 3.4
| # univention-ipcalc --ip 1.2.3.4 --netmask 255.255.255.0 --output pointer
| 4
Die Reihenfolge wird bei jedem(!) Schleifendurchlauf invertiert:
|	for i in range(4):
|...
|			pointer.reverse()


| # univention-ipcalc --ip 1.2.3.4 --netmask 255.255.255.255  --calcdns
| Reverse: 1.2.3
| # univention-ipcalc --ip 1.2.3.4 --netmask 255.255.255.0  --calcdns
| Reverse: 3.2.1
Im folgenden Code zeigen reverse und net auf die selbe(!) Liste, d.h. net.revertse() invertiert auch reverse, außer es handelt sich um ein /32 Netz, denn dann ist reverse eine (Teil-)Kopie von net und damit eigenständig, weshalb das net.reverse() keine Wirkung hat:
|reverse = net
|if netmask == "255.255.255.255":
|	reverse = net[:-1]
|if ...
|	print 'Network: %s' % string.join(net,'.')
|	net.reverse()
|	print 'Reverse: %s' % string.join(reverse,'.')
|	net.reverse()



| # univention-ipcalc --ip 1.2.3.4 --netmask 255.255.255.0  --output reverse --calcdns
| 1.2.3
| c# univention-ipcalc --ip 1.2.3.4 --netmask 255.255.255.0  --calcdns | grep Reverse
| Reverse: 3.2.1
Je nach Ausgabeformat unterscheidet sich das Ergebnis


| # univention-ipcalc --ip 0.0.0.0 --netmask 0.0.0.0 --full
| Traceback (most recent call last):
|   File "/usr/bin/univention-ipcalc", line 141, in <module>
|     netpart=copy.copy(netpart)
| NameError: name 'netpart' is not defined
Comment 3 Philipp Hahn univentionstaff 2012-08-06 22:14:33 CEST
Created attachment 4577 [details]
Rewrite

#!/bin/sh
# diff -y <(./test.sh './' --calcdns) <(./test.sh '' --calcdns)
path=${1:-./}
[ -n "$1" ] && shift
${path}univention-ipcalc --ip 170.85.170.85 --netmask 0.0.0.0 "$@"
${path}univention-ipcalc --ip 170.85.170.85 --netmask 128.0.0.0 "$@"
${path}univention-ipcalc --ip 170.85.170.85 --netmask 255.0.0.0 "$@"
${path}univention-ipcalc --ip 170.85.170.85 --netmask 255.255.0.0 "$@"
${path}univention-ipcalc --ip 170.85.170.85 --netmask 255.255.255.0 "$@"
${path}univention-ipcalc --ip 170.85.170.85 --netmask 255.255.255.255 "$@"
Comment 4 Philipp Hahn univentionstaff 2012-08-14 19:36:00 CEST
univention-ipcalc wurde um eine Hilfe erweitert und berechnet nun reversed korrekt. (siehe univention-ipcalc --test -v)

svn34831, univention-ipcalc_4.0.0-1.24.201208141906

ChangeLog: svn14314
\item \ucsCommand{univention-ipcalc} and \item \ucsCommand{univention-ipcalc6} now provides both a \emph{-{}-help} message. The calculation for reverse DNS zones has been fixed (\ucsBug{25626}, \ucsBug{28143}).
Comment 5 Janek Walkenhorst univentionstaff 2012-09-14 12:27:47 CEST
Hilfe: vorhanden
Verhalten: Wie univention-ipcalc6
(Ausnahme: Netzmasken < /8 -- das wird aber nicht unterstützt)
Changelog: OK
Comment 6 Stefan Gohmann univentionstaff 2012-12-12 21:10:12 CET
UCS 3.1-0 has been released: 
 http://forum.univention.de/viewtopic.php?f=54&t=2125

If this error occurs again, please use "Clone This Bug".