Univention Bugzilla – Attachment 8910 Details for
Bug 36012
Warn about hostnames with underscores
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
36012-diagnostic-hostname-check-420.patch
36012-diagnostic-hostname-check-420.patch (text/plain), 7.59 KB, created by
Lukas Oyen
on 2017-06-08 15:03 CEST
(
hide
)
Description:
36012-diagnostic-hostname-check-420.patch
Filename:
MIME Type:
Creator:
Lukas Oyen
Created:
2017-06-08 15:03 CEST
Size:
7.59 KB
patch
obsolete
>From df3aef4433f1a69043c7c5ef9fb682306f680cc1 Mon Sep 17 00:00:00 2001 >From: Lukas Oyen <oyen@univention.de> >Date: Thu, 8 Jun 2017 14:49:10 +0200 >Subject: [PATCH 1/2] Bug #36012: umc-diagnostic: new check hostame_check.py > >--- > .../python/diagnostic/plugins/hostname_check.py | 83 ++++++++++++++++++++++ > 1 file changed, 83 insertions(+) > create mode 100755 management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/hostname_check.py > >diff --git a/management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/hostname_check.py b/management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/hostname_check.py >new file mode 100755 >index 0000000..aa8c0a9 >--- /dev/null >+++ b/management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/hostname_check.py >@@ -0,0 +1,83 @@ >+#!/usr/bin/python2.7 >+# coding: utf-8 >+# >+# Univention Management Console module: >+# System Diagnosis UMC module >+# >+# Copyright 2017 Univention GmbH >+# >+# http://www.univention.de/ >+# >+# All rights reserved. >+# >+# The source code of this program is made available >+# under the terms of the GNU Affero General Public License version 3 >+# (GNU AGPL V3) as published by the Free Software Foundation. >+# >+# Binary versions of this program provided by Univention to you as >+# well as other copyrighted, protected or trademarked materials like >+# Logos, graphics, fonts, specific documentations and configurations, >+# cryptographic keys etc. are subject to a license agreement between >+# you and Univention and not subject to the GNU AGPL V3. >+# >+# In the case you use this program under the terms of the GNU AGPL V3, >+# the program is provided in the hope that it will be useful, >+# but WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU Affero General Public License for more details. >+# >+# You should have received a copy of the GNU Affero General Public >+# License with the Debian GNU/Linux or Univention distribution in file >+# /usr/share/common-licenses/AGPL-3; if not, see >+# <http://www.gnu.org/licenses/>. >+ >+import re >+ >+import univention.uldap >+from univention.management.console.modules.diagnostic import Warning >+ >+from univention.lib.i18n import Translation >+_ = Translation('univention-management-console-module-diagnostic').translate >+ >+title = _('Check hostname RFC compliance') >+description = _('No non-compliant hostnames found.') >+links = [{ >+ 'name': 'rfc1123', >+ 'href': _('https://tools.ietf.org/html/rfc1123#section-2'), >+ 'label': _('RFC 1123 - 2.1 Host Names and Numbers') >+}] >+ >+VALID_HOSTNAME = re.compile(r"^(?!-)[A-Z0-9-]{1,63}(?<!-)$", re.IGNORECASE) >+ >+ >+def univention_hostnames(): >+ lo = univention.uldap.getMachineConnection() >+ for (dn, attr) in lo.search('(objectClass=univentionHost)', attr=['cn']): >+ if dn is not None: >+ for hostname in attr.get('cn'): >+ yield hostname >+ >+ >+def compliant_hostname(hostname): >+ return bool(VALID_HOSTNAME.match(hostname)) >+ >+ >+def non_compliant_hostnames(): >+ for hostname in univention_hostnames(): >+ if not compliant_hostname(hostname): >+ yield hostname >+ >+ >+def run(): >+ hostnames = list(non_compliant_hostnames()) >+ if hostnames: >+ invalid = _('The following non-compliant hostnames have been found: {hostnames}.') >+ problem = _('This may lead to DNS problems.') >+ specification = _('Please refer to {rfc1123} for the syntax of host names.') >+ description = [invalid.format(hostnames=', '.join(hostnames)), problem, specification] >+ raise Warning(description='\n'.join(description)) >+ >+ >+if __name__ == '__main__': >+ from univention.management.console.modules.diagnostic import main >+ main() >-- >2.7.4 > > >From 215207d844043505a0f15ea9575cb9b598c7fdd8 Mon Sep 17 00:00:00 2001 >From: Lukas Oyen <oyen@univention.de> >Date: Thu, 8 Jun 2017 14:55:20 +0200 >Subject: [PATCH 2/2] Bug #36012: umc-diagnostic: new check hostame_check.py > (pe) > >--- > .../umc/python/diagnostic/de.po | 35 ++++++++++++++++++++-- > 1 file changed, 33 insertions(+), 2 deletions(-) > >diff --git a/management/univention-management-console-module-diagnostic/umc/python/diagnostic/de.po b/management/univention-management-console-module-diagnostic/umc/python/diagnostic/de.po >index affad86..9f3feda 100644 >--- a/management/univention-management-console-module-diagnostic/umc/python/diagnostic/de.po >+++ b/management/univention-management-console-module-diagnostic/umc/python/diagnostic/de.po >@@ -2,8 +2,8 @@ > msgid "" > msgstr "" > "Project-Id-Version: univention-management-console-module-diagnostic\n" >-"Report-Msgid-Bugs-To: packages@univention.de\n" >-"POT-Creation-Date: 2016-01-14 12:19+0100\n" >+"Report-Msgid-Bugs-To: \n" >+"POT-Creation-Date: 2017-06-08 14:53+0200\n" > "PO-Revision-Date: \n" > "Last-Translator: Univention GmbH <packages@univention.de>\n" > "Language-Team: Univention GmbH <packages@univention.de>\n" >@@ -27,6 +27,10 @@ msgstr "" > msgid "Adjust to suggested limits" > msgstr "An vorgeschlagene Limits anpassen" > >+#: umc/python/diagnostic/plugins/hostname_check.py:42 >+msgid "Check hostname RFC compliance" >+msgstr "Ãberprüfe Rechnernamen auf RFC Konformität" >+ > #: umc/python/diagnostic/plugins/gateway.py:11 > msgid "Gateway is not reachable" > msgstr "Gateway ist nicht erreichbar" >@@ -97,6 +101,10 @@ msgstr "" > msgid "Nameserver(s) are not responsive" > msgstr "Nameserver sind nicht ansprechbar" > >+#: umc/python/diagnostic/plugins/hostname_check.py:43 >+msgid "No non-compliant hostnames found." >+msgstr "Keine nicht konformen Rechnernamen gefunden." >+ > #: umc/python/diagnostic/plugins/package_status.py:11 > msgid "Package status corrupt" > msgstr "Paketstatus korrupt" >@@ -116,6 +124,11 @@ msgstr "" > "Bitte sicherstellen, dass die DNS-Einstellungen in {setup:network} korrekt " > "konfiguriert sind." > >+#: umc/python/diagnostic/plugins/hostname_check.py:76 >+#, python-brace-format >+msgid "Please refer to {rfc1123} for the syntax of host names." >+msgstr "Siehe {rfc1123} für die Syntax von Rechnernamen." >+ > #: umc/python/diagnostic/plugins/ssh_connection.py:52 > #, python-format > msgid "" >@@ -129,6 +142,10 @@ msgstr "" > msgid "Proxy server failure" > msgstr "Proxy-Server-Fehler" > >+#: umc/python/diagnostic/plugins/hostname_check.py:47 >+msgid "RFC 1123 - 2.1 Host Names and Numbers" >+msgstr "" >+ > #: umc/python/diagnostic/plugins/ssh_connection.py:16 > msgid "SSH connection to UCS server failed!" > msgstr "SSH-Verbindung zu anderem UCS Server fehlgeschlagen!" >@@ -149,6 +166,12 @@ msgstr "" > "Die folgende Liste zeigt die betroffenen entfernten Rechner und den Grund " > "für die fehlgeschlagene SSH-Verbindung." > >+#: umc/python/diagnostic/plugins/hostname_check.py:74 >+#, python-brace-format >+msgid "The following non-compliant hostnames have been found: {hostnames}." >+msgstr "" >+"Die folgenden nicht konformen Rechnernamen wurden gefunden: {hostnames}." >+ > #: umc/python/diagnostic/plugins/gateway.py:13 > #, python-format > msgid "" >@@ -249,6 +272,10 @@ msgstr "" > "an Samba-Servern unmöglich, Dateioperationen (Kopieren, Verschieben) auf " > "Freigaben kann fehlschlagen, uvm.)" > >+#: umc/python/diagnostic/plugins/hostname_check.py:75 >+msgid "This may lead to DNS problems." >+msgstr "Dies kann zu DNS Problemen führen." >+ > #: umc/python/diagnostic/plugins/proxy.py:83 > #, python-format > msgid "" >@@ -260,6 +287,10 @@ msgstr "" > "dass Authentifikations-Zugangsdaten (falls existierend) korrekt sind und die " > "ACL's des Proxy-Servers nicht verbieten, Anfragen an %s zu stellen." > >+#: umc/python/diagnostic/plugins/hostname_check.py:46 >+msgid "https://tools.ietf.org/html/rfc1123#section-2" >+msgstr "" >+ > #: umc/python/diagnostic/plugins/package_status.py:28 > msgid "some" > msgstr "einigen" >-- >2.7.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 36012
:
8909
| 8910