View | Details | Raw Unified | Return to bug 44876
Collapse All | Expand All

(-)a/management/univention-management-console-module-diagnostic/umc/python/diagnostic/plugins/samba_tool_sysvolcheck.py (-2 / +85 lines)
Line 0    Link Here 
0
- 
1
#!/usr/bin/python2.7
2
# coding: utf-8
3
#
4
# Univention Management Console module:
5
#  System Diagnosis UMC module
6
#
7
# Copyright 2017 Univention GmbH
8
#
9
# http://www.univention.de/
10
#
11
# All rights reserved.
12
#
13
# The source code of this program is made available
14
# under the terms of the GNU Affero General Public License version 3
15
# (GNU AGPL V3) as published by the Free Software Foundation.
16
#
17
# Binary versions of this program provided by Univention to you as
18
# well as other copyrighted, protected or trademarked materials like
19
# Logos, graphics, fonts, specific documentations and configurations,
20
# cryptographic keys etc. are subject to a license agreement between
21
# you and Univention and not subject to the GNU AGPL V3.
22
#
23
# In the case you use this program under the terms of the GNU AGPL V3,
24
# the program is provided in the hope that it will be useful,
25
# but WITHOUT ANY WARRANTY; without even the implied warranty of
26
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27
# GNU Affero General Public License for more details.
28
#
29
# You should have received a copy of the GNU Affero General Public
30
# License with the Debian GNU/Linux or Univention distribution in file
31
# /usr/share/common-licenses/AGPL-3; if not, see
32
# <http://www.gnu.org/licenses/>.
33
34
import ldap
35
import socket
36
import subprocess
37
38
import univention.uldap
39
from univention.management.console.modules.diagnostic import Warning
40
41
from univention.lib.i18n import Translation
42
_ = Translation('univention-management-console-module-diagnostic').translate
43
44
title = _('Check Samba sysvol ACLs for errors')
45
description = _('No errors found.'),
46
47
48
def is_service_active(service):
49
	lo = univention.uldap.getMachineConnection()
50
	raw_filter = '(&(univentionService=%s)(cn=%s))'
51
	filter_expr = ldap.filter.filter_format(raw_filter, (service, socket.gethostname()))
52
	for (dn, _attr) in lo.search(filter_expr, attr=['cn']):
53
		if dn is not None:
54
			return True
55
	return False
56
57
58
def run_with_output(cmd):
59
	output = list()
60
	process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
61
	(stdout, stderr) = process.communicate()
62
	if stdout:
63
		output.append('\nSTDOUT:\n{}'.format(stdout))
64
	if stderr:
65
		output.append('\nSTDERR:\n{}'.format(stderr))
66
	return (process.returncode == 0, '\n'.join(output))
67
68
69
def run():
70
	if not is_service_active('Samba 4'):
71
		return
72
73
	error_descriptions = list()
74
	cmd = ['samba-tool', 'ntacl', 'sysvolcheck']
75
	(success, output) = run_with_output(cmd)
76
	if not success or output:
77
		error = _('`samba-tool ntacl sysvolcheck` returned a problem with the sysvol ACLs.')
78
		error_descriptions.append(error)
79
		error_descriptions.append(output)
80
		raise Warning(description='\n'.join(error_descriptions))
81
82
83
if __name__ == '__main__':
84
	from univention.management.console.modules.diagnostic import main
85
	main()
1
`samba_tool_sysvolcheck.py` (po)
86
`samba_tool_sysvolcheck.py` (po)
2
--
3
.../umc/python/diagnostic/de.po                        | 18 ++++++++++++++++--
87
.../umc/python/diagnostic/de.po                        | 18 ++++++++++++++++--
4
1 file changed, 16 insertions(+), 2 deletions(-)
88
1 file changed, 16 insertions(+), 2 deletions(-)
(-)a/management/univention-management-console-module-diagnostic/umc/python/diagnostic/de.po (-3 / +16 lines)
 Lines 2-9    Link Here 
2
msgid ""
2
msgid ""
3
msgstr ""
3
msgstr ""
4
"Project-Id-Version: univention-management-console-module-diagnostic\n"
4
"Project-Id-Version: univention-management-console-module-diagnostic\n"
5
"Report-Msgid-Bugs-To: packages@univention.de\n"
5
"Report-Msgid-Bugs-To: \n"
6
"POT-Creation-Date: 2016-01-14 12:19+0100\n"
6
"POT-Creation-Date: 2017-06-27 17:48+0200\n"
7
"PO-Revision-Date: \n"
7
"PO-Revision-Date: \n"
8
"Last-Translator: Univention GmbH <packages@univention.de>\n"
8
"Last-Translator: Univention GmbH <packages@univention.de>\n"
9
"Language-Team: Univention GmbH <packages@univention.de>\n"
9
"Language-Team: Univention GmbH <packages@univention.de>\n"
 Lines 27-32   msgstr "" Link Here 
27
msgid "Adjust to suggested limits"
27
msgid "Adjust to suggested limits"
28
msgstr "An vorgeschlagene Limits anpassen"
28
msgstr "An vorgeschlagene Limits anpassen"
29
29
30
#: umc/python/diagnostic/plugins/samba_tool_sysvolcheck.py:44
31
msgid "Check Samba sysvol ACLs for errors"
32
msgstr "Überprüfe die Samba SYSVOL ACL Einträge auf Fehler"
33
30
#: umc/python/diagnostic/plugins/gateway.py:11
34
#: umc/python/diagnostic/plugins/gateway.py:11
31
msgid "Gateway is not reachable"
35
msgid "Gateway is not reachable"
32
msgstr "Gateway ist nicht erreichbar"
36
msgstr "Gateway ist nicht erreichbar"
 Lines 97-102   msgstr "" Link Here 
97
msgid "Nameserver(s) are not responsive"
101
msgid "Nameserver(s) are not responsive"
98
msgstr "Nameserver sind nicht ansprechbar"
102
msgstr "Nameserver sind nicht ansprechbar"
99
103
104
#: umc/python/diagnostic/plugins/samba_tool_sysvolcheck.py:45
105
msgid "No errors found."
106
msgstr "Keine Fehler gefunden."
107
100
#: umc/python/diagnostic/plugins/package_status.py:11
108
#: umc/python/diagnostic/plugins/package_status.py:11
101
msgid "Package status corrupt"
109
msgid "Package status corrupt"
102
msgstr "Paketstatus korrupt"
110
msgstr "Paketstatus korrupt"
 Lines 260-265   msgstr "" Link Here 
260
"dass Authentifikations-Zugangsdaten (falls existierend) korrekt sind und die "
268
"dass Authentifikations-Zugangsdaten (falls existierend) korrekt sind und die "
261
"ACL's des Proxy-Servers nicht verbieten, Anfragen an %s zu stellen."
269
"ACL's des Proxy-Servers nicht verbieten, Anfragen an %s zu stellen."
262
270
271
#: umc/python/diagnostic/plugins/samba_tool_sysvolcheck.py:77
272
msgid "`samba-tool ntacl sysvolcheck` returned a problem with the sysvol ACLs."
273
msgstr ""
274
"`samba-tool ntacl sysvolcheck` meldet ein Problem mit den SYSVOL ACL "
275
"Einträgen."
276
263
#: umc/python/diagnostic/plugins/package_status.py:28
277
#: umc/python/diagnostic/plugins/package_status.py:28
264
msgid "some"
278
msgid "some"
265
msgstr "einigen"
279
msgstr "einigen"
266
- 

Return to bug 44876