delete old packages
git-svn-id: https://svn.disconnected-by-peer.at/svn/linamh/trunk/mds@2127 6952d904-891a-0410-993b-d76249ca496b
This commit is contained in:
parent
3f192104f8
commit
26b29bdf5c
@ -1,94 +0,0 @@
|
|||||||
# ChangeLog for app-admin/mmc-agent
|
|
||||||
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
|
|
||||||
# $Header: $
|
|
||||||
|
|
||||||
21 Feb 2010; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
mmc-agent-2.3.2_p798.ebuild:
|
|
||||||
correct inherit error
|
|
||||||
|
|
||||||
21 Feb 2010; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
mmc-agent-2.3.2_p798.ebuild:
|
|
||||||
add eutils class
|
|
||||||
|
|
||||||
18 Feb 2010; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
mmc-agent-2.3.2-r1.ebuild, mmc-agent-2.3.2-r2.ebuild,
|
|
||||||
mmc-agent-2.3.2-r3.ebuild, mmc-agent-2.3.2-r4.ebuild,
|
|
||||||
mmc-agent-2.3.2_p798.ebuild:
|
|
||||||
add arm keyword
|
|
||||||
|
|
||||||
05 Feb 2010; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
mmc-agent-2.3.2_p798.ebuild, +files/mmc-agent-2.3.2-userquota-2.patch:
|
|
||||||
update userquota plugin
|
|
||||||
|
|
||||||
02 Feb 2010; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
+files/mmc-agent-2.3.2-bulkimport-2.patch:
|
|
||||||
Bump bulkimport patch
|
|
||||||
|
|
||||||
29 Jan 2010; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
mmc-agent-2.3.2_p798.ebuild, +files/mmc-agent-2.3.2-bulkimport-1.patch,
|
|
||||||
+files/mmc-agent-2.3.2-userquota-1.patch:
|
|
||||||
Add Userquota & bulkimport module
|
|
||||||
|
|
||||||
05 Dec 2009; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
+mmc-agent-2.3.2_p798.ebuild:
|
|
||||||
Use the special pulse2 release
|
|
||||||
|
|
||||||
09 Sep 2009; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
mmc-agent-2.3.2-r4.ebuild:
|
|
||||||
correct typo
|
|
||||||
|
|
||||||
*mmc-agent-2.3.2-r4 (03 Sep 2009)
|
|
||||||
|
|
||||||
03 Sep 2009; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
+mmc-agent-2.3.2-r4.ebuild:
|
|
||||||
add missing dependencies
|
|
||||||
|
|
||||||
*mmc-agent-2.3.2-r3 (04 Jul 2009)
|
|
||||||
|
|
||||||
04 Jul 2009; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
+mmc-agent-2.3.2-r3.ebuild, +files/mmc-agent-2.3.2-powerdns-2.patch:
|
|
||||||
update the powerdns patch
|
|
||||||
|
|
||||||
* mmc-agent-2.3.2-r2 (17 Apr 2009)
|
|
||||||
|
|
||||||
17 Apr 2009; Mario Fetka <mario.fetka@gmail.com> mmc-agent-2.3.2-r2:
|
|
||||||
EAPI2 and test cleanup
|
|
||||||
|
|
||||||
16 Apr 2009; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
mmc-agent-2.3.2-r1.ebuild:
|
|
||||||
add die to do*
|
|
||||||
|
|
||||||
30 Mar 2009; Mario Fetka <mario.fetka@gmail.com> ChangeLog:
|
|
||||||
Add PowerDNS Support
|
|
||||||
|
|
||||||
16 Mar 2009; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
files/mmc-agent-2.3.1-kerberos-1.patch:
|
|
||||||
Remove diff from patch
|
|
||||||
|
|
||||||
13 Mar 2009; Mario Fetka <mario.fetka@gmail.com> mmc-agent-2.3.2.ebuild:
|
|
||||||
remove wrong dependency on gettext
|
|
||||||
|
|
||||||
13 Mar 2009; Mario Fetka <mario.fetka@gmail.com> mmc-agent-2.3.2.ebuild:
|
|
||||||
new dependencies on gettext
|
|
||||||
|
|
||||||
27 Feb 2009; Mario Fetka <mario.fetka@gmail.com> mmc-agent-2.3.2.ebuild:
|
|
||||||
Add Dependency
|
|
||||||
|
|
||||||
21 Jan 2009; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
files/mmc-agent-2.3.1-kerberos-1.patch,
|
|
||||||
+files/mmc-agent-2.3.2-printing-1.patch:
|
|
||||||
Update kerberos Patch
|
|
||||||
|
|
||||||
11 Jan 2009; Mario Fetka <mario.fetka@gmail.com> +mmc-agent-2.3.2.ebuild:
|
|
||||||
Bump
|
|
||||||
|
|
||||||
02 Nov 2008; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
files/mmc-agent-2.3.1-kerberos-1.patch:
|
|
||||||
update patch
|
|
||||||
|
|
||||||
31 Jul 2008; Mario Fetka <mario.fetka@gmail.com> mmc-agent-2.3.1.ebuild:
|
|
||||||
repoman Cleanup
|
|
||||||
|
|
||||||
14 Jun 2008; Mario Fetka <mario-fetka@gmx.at> +metadata.xml:
|
|
||||||
Initial import
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
|||||||
AUX mmc-agent-2.3.1-kerberos-1.patch 16835 RMD160 c7bc79766967ed988a6b9d85be73a5f4cdf90f2b SHA1 fa43b2173e716b207cc6fbc10e739efef188e048 SHA256 69d7c88f5b3a35910c8650f69fdd9f9ee877248a41c03e7e99fa0a1a3b109c1c
|
|
||||||
AUX mmc-agent-2.3.2-bulkimport-1.patch 6855 RMD160 13c16e3322a072ae41663696e8a53f299861b718 SHA1 ebea9f8d6f8f3b20b5ab19e328228dd17db2dd2b SHA256 fd76b1e7fde2547c1b505960d43dc363a3432937ea09f4b3d0619277edec5cac
|
|
||||||
AUX mmc-agent-2.3.2-bulkimport-2.patch 6849 RMD160 a75bdd558062db3f4cf1e9b30f5e973609559ff9 SHA1 28e8064139e337dd93b86980433a8bcacb9cdb6b SHA256 3dec3be08103960a9235a37dc75ba480bf424445ceef9b5dc4af87bfe0aca6ae
|
|
||||||
AUX mmc-agent-2.3.2-powerdns-1.patch 37711 RMD160 dfade7296129ea3a302fad701845d057e9050bd4 SHA1 711c0dd404ce59470e3b1418a9f83726a10e0aac SHA256 6c0f6df0dccca0b42d0860c289333e3d670fa1ef416885bdf561124aec45d258
|
|
||||||
AUX mmc-agent-2.3.2-powerdns-2.patch 38803 RMD160 ecde3d096a278446fbe0f866d6165f5940d53fb2 SHA1 d4518fc05dd57aadb4f05689e9675aa6b96d451b SHA256 33f4d1bd8e6509833bae5eec194c67371cb471c2c25d6978979057af2d67464a
|
|
||||||
AUX mmc-agent-2.3.2-printing-1.patch 33371 RMD160 f7064ec4dfc2e923c522f01190ca5d4f7d493d43 SHA1 ca9219b982e210bd92c85db8f982e1a3c6b9d48b SHA256 97dc50bb286361286e5451d2e85ea9b9d8609a2f92c3f3ca3836e9bcbcd1c931
|
|
||||||
AUX mmc-agent-2.3.2-userquota-1.patch 28599 RMD160 4f2695794b23d666f8b00769452359700c1cd63a SHA1 88515db08641e0ac0dfef2ea71ea0f223d75bfbe SHA256 3397c6c3642826fefc0314572abf59bfd01a455f1c6048478b38a6e7eb0094cb
|
|
||||||
AUX mmc-agent-2.3.2-userquota-2.patch 48077 RMD160 76de23a7b625d58f5d1af0f0217470a5829f1d41 SHA1 a10b39598129bf68be78f068bc68e1aca2f84c2c SHA256 779093f7c77c3b418fad7e4d9b5a30996e5f05005959aaf26413b6a4139a3c06
|
|
||||||
AUX mmc-agent.initd 438 RMD160 d7dc64366782ab0d6fe4347d6a169b88a4e03a49 SHA1 e4ae8808678161237703bbb63b144899c9a544c9 SHA256 922d0bacad3eda749f8807e3ae5c183f636fa93e0d41d7079e570c58ebccb879
|
|
||||||
DIST mmc-agent-2.3.2-798.tar.gz 122211 RMD160 2630890c80e3e9fdf2d3510659e00692b1d487cb SHA1 914d3ce64f5e49abe1558eab23fa316b8a8ce3ec SHA256 411bb2a8475dda2f08450cae40812f35a5d426047cccd1a560881d41d621c55c
|
|
||||||
DIST mmc-agent-2.3.2.tar.gz 120949 RMD160 871b3b7766d69019de392e42ebf25a216d217c71 SHA1 1e7c634243c00c6b214f24c3467315d31a444215 SHA256 0ac8ff97818c58008cadb3c6b08dba39e42b078fea9d392fda649e036eabaea2
|
|
||||||
EBUILD mmc-agent-2.3.2-r1.ebuild 1640 RMD160 8e3ee43b9d819bda4c3553bf7804a71f7b1a6f95 SHA1 a6b4930a7b150724b196c57b847968bebda28bc6 SHA256 d616b7257da5145c777d3a48612926827dfcad9d3f01ba1c9848dfc20f125d95
|
|
||||||
EBUILD mmc-agent-2.3.2-r2.ebuild 1562 RMD160 3ba9a20dade26b267dccf5c4e430dfeea4277d46 SHA1 2f16791a144864c81e1934ee86e37f9b60e94851 SHA256 e53e3a4b25eedb8b3e3fa3512a82b089e9e8c5f0441521b7ec1500d2b1a311d3
|
|
||||||
EBUILD mmc-agent-2.3.2-r3.ebuild 1562 RMD160 ec74557aeb688f8d9294f2af4d98a1bae29a405f SHA1 d93082e24f1e1853f16552402808b8eb891c7e5a SHA256 9f34a1f36d235ae8367c7d24b752269592e14f89fb403e2c549fae704ef01d01
|
|
||||||
EBUILD mmc-agent-2.3.2-r4.ebuild 1621 RMD160 fe5f677d9e787dde9e479d9992c4db70fd212b88 SHA1 903776dd2e1209e22f1c314613c4f23864729503 SHA256 e423589705276dd40de5d0b9731994a18649ab591e96631f89fa319ee16ad389
|
|
||||||
EBUILD mmc-agent-2.3.2_p798.ebuild 1906 RMD160 af7f95670e289e2fa85ca6d94d432026a05ba098 SHA1 e03916ed8682a524bcf62208f19f7277325b14f6 SHA256 55e7505bc23352a4ac30ee3f7790ff8b08935fde427037632b2b56b642f53f53
|
|
||||||
MISC ChangeLog 2840 RMD160 dcce269790797e36cff6c62549ec34f7189ef3ee SHA1 5c5329227787c70c4c09836a0eae134d003d1698 SHA256 273406fbfb2a8a4030ca52a98e9b97d2b8b1f3e29979d0e5856cac8dbcb4a219
|
|
||||||
MISC metadata.xml 170 RMD160 645927a396fdc21cdeb089fe42c5397332420ea6 SHA1 ac7f48a14fec325926f9ce1be8fbf1f311b4f2e4 SHA256 d797a2ec6f9dc516c9f9c1a758ee87ad3e8c43101b5dc76c2f872d5bd4639b42
|
|
@ -1,392 +0,0 @@
|
|||||||
Submitted By: Mario Fetka (mario-fetka at gmx dot at)
|
|
||||||
Date: 2008-06-14
|
|
||||||
Initial Package Version: 2.2.0
|
|
||||||
Origin: Ticket #144
|
|
||||||
Upstream Status: Accepted
|
|
||||||
Description: Kerberized accounts in ou=People
|
|
||||||
|
|
||||||
|
|
||||||
diff -Naur mmc-agent-2.3.1.orig/conf/plugins/kerberos.ini mmc-agent-2.3.1/conf/plugins/kerberos.ini
|
|
||||||
--- mmc-agent-2.3.1.orig/conf/plugins/kerberos.ini 1970-01-01 00:00:00.000000000 +0000
|
|
||||||
+++ mmc-agent-2.3.1/conf/plugins/kerberos.ini 2008-05-17 13:04:35.000000000 +0000
|
|
||||||
@@ -0,0 +1,5 @@
|
|
||||||
+[main]
|
|
||||||
+disable = 0
|
|
||||||
+
|
|
||||||
+[kerberos]
|
|
||||||
+realm = EXAMPLE.COM
|
|
||||||
diff -Naur mmc-agent-2.3.1.orig/mmc/plugins/base/__init__.py mmc-agent-2.3.1/mmc/plugins/base/__init__.py
|
|
||||||
--- mmc-agent-2.3.1.orig/mmc/plugins/base/__init__.py 2008-04-29 15:15:48.000000000 +0000
|
|
||||||
+++ mmc-agent-2.3.1/mmc/plugins/base/__init__.py 2008-06-14 09:22:59.000000000 +0000
|
|
||||||
@@ -1229,6 +1229,10 @@
|
|
||||||
attrs = []
|
|
||||||
attrib = self.l.search_s(dn, ldap.SCOPE_BASE)
|
|
||||||
c, attrs = attrib[0]
|
|
||||||
+ # kerberos -> remove binary key from attrs
|
|
||||||
+ try: attrs.pop('krb5Key')
|
|
||||||
+ except: pass
|
|
||||||
+ #
|
|
||||||
newattrs = copy.deepcopy(attrs)
|
|
||||||
return newattrs
|
|
||||||
|
|
||||||
@@ -1249,6 +1253,10 @@
|
|
||||||
attrib = self.l.search_s(cn, ldap.SCOPE_BASE)
|
|
||||||
|
|
||||||
c,attrs=attrib[0]
|
|
||||||
+ # kerberos -> remove binary key from attrs
|
|
||||||
+ try: attrs.pop('krb5Key')
|
|
||||||
+ except: pass
|
|
||||||
+ #
|
|
||||||
|
|
||||||
newattrs = copy.deepcopy(attrs)
|
|
||||||
|
|
||||||
@@ -1402,8 +1410,13 @@
|
|
||||||
@rtype: list
|
|
||||||
"""
|
|
||||||
if not base: base = self.baseUsersDN
|
|
||||||
- if (pattern==''): searchFilter = "uid=*"
|
|
||||||
- else: searchFilter = pattern
|
|
||||||
+ # kerberos -> search only PosixAccount
|
|
||||||
+ if (pattern==''): searchFilter = "(&(objectClass=posixAccount)(uid=*))"
|
|
||||||
+ elif pattern[0] == '(':
|
|
||||||
+ searchFilter = "(&(objectClass=posixAccount)%s)" % (pattern)
|
|
||||||
+ else:
|
|
||||||
+ searchFilter = "(&(objectClass=posixAccount)(%s))" % (pattern)
|
|
||||||
+ #
|
|
||||||
monoattrs = ["uid", "sn", "givenName", "mail"]
|
|
||||||
result_set = self.search(searchFilter, base, monoattrs + ["telephoneNumber", "loginShell", "objectClass"], ldap.SCOPE_ONELEVEL)
|
|
||||||
|
|
||||||
diff -Naur mmc-agent-2.3.1.orig/mmc/plugins/kerberos/__init__.py mmc-agent-2.3.1/mmc/plugins/kerberos/__init__.py
|
|
||||||
--- mmc-agent-2.3.1.orig/mmc/plugins/kerberos/__init__.py 1970-01-01 00:00:00.000000000 +0000
|
|
||||||
+++ mmc-agent-2.3.1/mmc/plugins/kerberos/__init__.py 2007-11-21 09:56:21.000000000 +0000
|
|
||||||
@@ -0,0 +1,180 @@
|
|
||||||
+# -*- coding: utf-8; -*-
|
|
||||||
+#
|
|
||||||
+# (c) 2004-2007 Linbox / Free&ALter Soft, http://linbox.com
|
|
||||||
+# (c) 2007 Mandriva, http://www.mandriva.com/
|
|
||||||
+# (c) 2007 Kids-und-Co g.e.V http://www.kids-und-co.de
|
|
||||||
+#
|
|
||||||
+# $Id: __init__.py 108 2007-11-21 09:56:21Z iosifb $
|
|
||||||
+#
|
|
||||||
+# This file is part of Mandriva Management Console (MMC).
|
|
||||||
+#
|
|
||||||
+# MMC is free software; you can redistribute it and/or modify
|
|
||||||
+# it under the terms of the GNU General Public License as published by
|
|
||||||
+# the Free Software Foundation; either version 2 of the License, or
|
|
||||||
+# (at your option) any later version.
|
|
||||||
+#
|
|
||||||
+# MMC is distributed 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 General Public License for more details.
|
|
||||||
+#
|
|
||||||
+# You should have received a copy of the GNU General Public License
|
|
||||||
+# along with MMC; if not, write to the Free Software
|
|
||||||
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
+
|
|
||||||
+import logging
|
|
||||||
+import ldap.modlist
|
|
||||||
+import copy
|
|
||||||
+from mmc.plugins.base import ldapUserGroupControl
|
|
||||||
+import xmlrpclib
|
|
||||||
+from mmc.support.errorObj import errorMessage
|
|
||||||
+from mmc.support.mmcException import *
|
|
||||||
+from mmc.support import mmctools
|
|
||||||
+import mmc.plugins.base
|
|
||||||
+from mmc.support.config import *
|
|
||||||
+from mmc.plugins.base import ldapUserGroupControl
|
|
||||||
+
|
|
||||||
+VERSION = "2.3.1"
|
|
||||||
+APIVERSION = "4:2:0"
|
|
||||||
+REVISION = int("$Rev: 108 $".split(':')[1].strip(' $'))
|
|
||||||
+
|
|
||||||
+def getVersion(): return VERSION
|
|
||||||
+def getApiVersion(): return APIVERSION
|
|
||||||
+def getRevision(): return REVISION
|
|
||||||
+
|
|
||||||
+def activate():
|
|
||||||
+ """
|
|
||||||
+ this function define if the module "base" can be activated.
|
|
||||||
+ @return: return True if this module can be activate
|
|
||||||
+ @rtype: boolean
|
|
||||||
+ """
|
|
||||||
+ config = KerberosConfig("kerberos")
|
|
||||||
+ logger = logging.getLogger()
|
|
||||||
+
|
|
||||||
+ if config.disabled:
|
|
||||||
+ logger.info("Kerberos plugin disabled by configuration.")
|
|
||||||
+ return False
|
|
||||||
+
|
|
||||||
+ try:
|
|
||||||
+ ldapObj = ldapUserGroupControl()
|
|
||||||
+ except ldap.INVALID_CREDENTIALS:
|
|
||||||
+ logger.error("Can't bind to LDAP: invalid credentials.")
|
|
||||||
+ return False
|
|
||||||
+
|
|
||||||
+ # Test if the Kerberos LDAP schema is available in the directory
|
|
||||||
+ try:
|
|
||||||
+ schema = ldapObj.getSchema("krb5KDCEntry")
|
|
||||||
+ if len(schema) <= 0:
|
|
||||||
+ logger.error("Kerberos schema is not included in LDAP directory");
|
|
||||||
+ return False
|
|
||||||
+ except:
|
|
||||||
+ logger.exception("invalid schema")
|
|
||||||
+ return False
|
|
||||||
+ try:
|
|
||||||
+ schema = ldapObj.getSchema("krb5Principal")
|
|
||||||
+ if len(schema) <= 0:
|
|
||||||
+ logger.error("Kerberos schema is not included in LDAP directory");
|
|
||||||
+ return False
|
|
||||||
+ except:
|
|
||||||
+ logger.exception("invalid schema")
|
|
||||||
+ return False
|
|
||||||
+ """
|
|
||||||
+ TODO: Check kerberos database
|
|
||||||
+ """
|
|
||||||
+ return True
|
|
||||||
+
|
|
||||||
+def isKrbUser(uid):
|
|
||||||
+ return kerberosLdapControl().isKerberosUser(uid)
|
|
||||||
+
|
|
||||||
+def addKrbAttr(uid,password):
|
|
||||||
+ return kerberosLdapControl().addKerberosAttr(uid,password)
|
|
||||||
+
|
|
||||||
+def delKrbAttr(uid,password):
|
|
||||||
+ return kerberosLdapControl().delKerberosAttr(uid,password)
|
|
||||||
+
|
|
||||||
+def changePassword(uid,password):
|
|
||||||
+ return kerberosLdapControl().changePassword(uid, password)
|
|
||||||
+
|
|
||||||
+class KerberosConfig(PluginConfig):
|
|
||||||
+ def __init__(self,name, conffile = None):
|
|
||||||
+ PluginConfig.__init__(self,name, conffile = None)
|
|
||||||
+ self.setDefault()
|
|
||||||
+ self.readConfig()
|
|
||||||
+
|
|
||||||
+ def readConfig(self):
|
|
||||||
+ PluginConfig.readConf(self)
|
|
||||||
+ self.realm = self.get("kerberos", "realm")
|
|
||||||
+
|
|
||||||
+class kerberosLdapControl(mmc.plugins.base.ldapUserGroupControl):
|
|
||||||
+
|
|
||||||
+ def __init__(self, conffile = None, conffilebase = None):
|
|
||||||
+ mmc.plugins.base.ldapUserGroupControl.__init__(self, conffilebase)
|
|
||||||
+ self.configKerberos = KerberosConfig("kerberos", conffile)
|
|
||||||
+ self.realm = self.configKerberos.realm
|
|
||||||
+
|
|
||||||
+ def delKerberosAttr(self,uid,password):
|
|
||||||
+ # If the password has been encoded in the XML-RPC stream, decode it
|
|
||||||
+ if isinstance(password, xmlrpclib.Binary):
|
|
||||||
+ password = str(password)
|
|
||||||
+ dn = 'uid=' + uid + ',' + self.baseUsersDN
|
|
||||||
+ s = self.l.search_s(dn, ldap.SCOPE_BASE)
|
|
||||||
+ c, attr = s[0]
|
|
||||||
+ old = {}
|
|
||||||
+ new = {}
|
|
||||||
+ for key in attr.keys(): old[key.lower()] = attr[key]
|
|
||||||
+ new = copy.deepcopy(old)
|
|
||||||
+ # remove krb attributes
|
|
||||||
+ new.pop('krb5kdcflags')
|
|
||||||
+ new.pop('krb5principalname')
|
|
||||||
+ new.pop('krb5keyversionnumber')
|
|
||||||
+ try: new.pop('krb5key')
|
|
||||||
+ except KeyError: pass
|
|
||||||
+ newobjclasses = ()
|
|
||||||
+ for s in new.pop('objectclass'):
|
|
||||||
+ if s[0:4] == 'krb5': pass
|
|
||||||
+ else: newobjclasses = newobjclasses + (s,)
|
|
||||||
+ new['objectclass'] = newobjclasses
|
|
||||||
+ modlist = ldap.modlist.modifyModlist(old, new)
|
|
||||||
+ #logger = logging.getLogger()
|
|
||||||
+ #logger.debug(newobjclasses)
|
|
||||||
+ #logger.debug(modlist)
|
|
||||||
+ self.l.modify_s(dn, modlist)
|
|
||||||
+ mmc.plugins.base.ldapUserGroupControl.changeUserPasswd(self,uid,password)
|
|
||||||
+ return True
|
|
||||||
+
|
|
||||||
+ def addKerberosAttr(self,uid,password):
|
|
||||||
+ # If the password has been encoded in the XML-RPC stream, decode it
|
|
||||||
+ if isinstance(password, xmlrpclib.Binary):
|
|
||||||
+ password = str(password)
|
|
||||||
+ dn = 'uid=' + uid + ',' + self.baseUsersDN
|
|
||||||
+ s = self.l.search_s(dn, ldap.SCOPE_BASE)
|
|
||||||
+ c, attr = s[0]
|
|
||||||
+ old = {}
|
|
||||||
+ new = {}
|
|
||||||
+ for key in attr.keys(): old[key.lower()] = attr[key]
|
|
||||||
+ new = copy.deepcopy(old)
|
|
||||||
+ new['objectclass'] = new['objectclass'] + ['krb5Principal','krb5KDCEntry']
|
|
||||||
+ new['userpassword'] = ['{K5Key}']
|
|
||||||
+ new['krb5kdcflags'] = ['126']
|
|
||||||
+ new['krb5keyversionnumber'] = ['0']
|
|
||||||
+ new['krb5principalname'] = [uid+'@' +self.realm]
|
|
||||||
+ modlist = ldap.modlist.modifyModlist(old, new)
|
|
||||||
+ self.l.modify_s(dn, modlist)
|
|
||||||
+ self.l.passwd_s(dn, None, password)
|
|
||||||
+ return True
|
|
||||||
+
|
|
||||||
+ def isKerberosUser(self,uid):
|
|
||||||
+ ret = False
|
|
||||||
+ if self.existUser(uid): ret = "krb5Principal" in self.getDetailedUser(uid)["objectClass"]
|
|
||||||
+ return ret
|
|
||||||
+
|
|
||||||
+ def changePassword(self,uid,password):
|
|
||||||
+ # If the password has been encoded in the XML-RPC stream, decode it
|
|
||||||
+ if isinstance(password, xmlrpclib.Binary):
|
|
||||||
+ password = str(password)
|
|
||||||
+ dn = 'uid=' + uid + ',' + self.baseUsersDN
|
|
||||||
+ self.l.modify_s(dn, [(ldap.MOD_REPLACE,'userPassWord','{K5KEY}')])
|
|
||||||
+ self.l.passwd_s(dn, None, password)
|
|
||||||
+ return True
|
|
||||||
+
|
|
||||||
+
|
|
||||||
diff -Naur mmc-agent-2.3.1.orig/setup.py mmc-agent-2.3.1/setup.py
|
|
||||||
--- mmc-agent-2.3.1.orig/setup.py 2007-09-10 08:20:59.000000000 +0000
|
|
||||||
+++ mmc-agent-2.3.1/setup.py 2008-06-14 09:24:15.000000000 +0000
|
|
||||||
@@ -8,5 +8,5 @@
|
|
||||||
author_email = "cdelfosse@mandriva.com",
|
|
||||||
maintainer = "Cedric Delfosse",
|
|
||||||
maintainer_email = "cdelfosse@mandriva.com",
|
|
||||||
- packages = ["mmc", "mmc.support", "mmc.plugins", "mmc.plugins.base", "mmc.plugins.samba", "mmc.plugins.proxy", "mmc.plugins.mail", "mmc.plugins.network"],
|
|
||||||
+ packages = ["mmc", "mmc.support", "mmc.plugins", "mmc.plugins.base", "mmc.plugins.samba", "mmc.plugins.proxy", "mmc.plugins.mail", "mmc.plugins.network", "mmc.plugins.kerberos"],
|
|
||||||
)
|
|
||||||
diff -Naur mmc-agent-2.3.1.orig/contrib/ldap/krb5-kdc.schema mmc-agent-2.3.1/contrib/ldap/krb5-kdc.schema
|
|
||||||
--- mmc-agent-2.3.1.orig/contrib/ldap/krb5-kdc.schema
|
|
||||||
+++ mmc-agent-2.3.1/contrib/ldap/krb5-kdc.schema
|
|
||||||
@@ -0,0 +1,136 @@
|
|
||||||
+# $Id: krb5-kdc.schema,v 1.1 2004-03-22 17:25:05 quanah Exp $
|
|
||||||
+# Definitions for a Kerberos V KDC schema
|
|
||||||
+
|
|
||||||
+# OID Base is iso(1) org(3) dod(6) internet(1) private(4) enterprise(1) padl(5322) kdcSchema(10)
|
|
||||||
+#
|
|
||||||
+# Syntaxes are under 1.3.6.1.4.1.5322.10.0
|
|
||||||
+# Attributes types are under 1.3.6.1.4.1.5322.10.1
|
|
||||||
+# Object classes are under 1.3.6.1.4.1.5322.10.2
|
|
||||||
+
|
|
||||||
+# Syntax definitions
|
|
||||||
+
|
|
||||||
+#krb5KDCFlagsSyntax SYNTAX ::= {
|
|
||||||
+# WITH SYNTAX INTEGER
|
|
||||||
+#-- initial(0), -- require as-req
|
|
||||||
+#-- forwardable(1), -- may issue forwardable
|
|
||||||
+#-- proxiable(2), -- may issue proxiable
|
|
||||||
+#-- renewable(3), -- may issue renewable
|
|
||||||
+#-- postdate(4), -- may issue postdatable
|
|
||||||
+#-- server(5), -- may be server
|
|
||||||
+#-- client(6), -- may be client
|
|
||||||
+#-- invalid(7), -- entry is invalid
|
|
||||||
+#-- require-preauth(8), -- must use preauth
|
|
||||||
+#-- change-pw(9), -- change password service
|
|
||||||
+#-- require-hwauth(10), -- must use hwauth
|
|
||||||
+#-- ok-as-delegate(11), -- as in TicketFlags
|
|
||||||
+#-- user-to-user(12), -- may use user-to-user auth
|
|
||||||
+#-- immutable(13) -- may not be deleted
|
|
||||||
+# ID { 1.3.6.1.4.1.5322.10.0.1 }
|
|
||||||
+#}
|
|
||||||
+
|
|
||||||
+#krb5PrincipalNameSyntax SYNTAX ::= {
|
|
||||||
+# WITH SYNTAX OCTET STRING
|
|
||||||
+#-- String representations of distinguished names as per RFC1510
|
|
||||||
+# ID { 1.3.6.1.4.1.5322.10.0.2 }
|
|
||||||
+#}
|
|
||||||
+
|
|
||||||
+# Attribute type definitions
|
|
||||||
+
|
|
||||||
+attributetype ( 1.3.6.1.4.1.5322.10.1.1
|
|
||||||
+ NAME 'krb5PrincipalName'
|
|
||||||
+ DESC 'The unparsed Kerberos principal name'
|
|
||||||
+ EQUALITY caseExactIA5Match
|
|
||||||
+ SINGLE-VALUE
|
|
||||||
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
|
|
||||||
+
|
|
||||||
+attributetype ( 1.3.6.1.4.1.5322.10.1.2
|
|
||||||
+ NAME 'krb5KeyVersionNumber'
|
|
||||||
+ EQUALITY integerMatch
|
|
||||||
+ SINGLE-VALUE
|
|
||||||
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 )
|
|
||||||
+
|
|
||||||
+attributetype ( 1.3.6.1.4.1.5322.10.1.3
|
|
||||||
+ NAME 'krb5MaxLife'
|
|
||||||
+ EQUALITY integerMatch
|
|
||||||
+ SINGLE-VALUE
|
|
||||||
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 )
|
|
||||||
+
|
|
||||||
+attributetype ( 1.3.6.1.4.1.5322.10.1.4
|
|
||||||
+ NAME 'krb5MaxRenew'
|
|
||||||
+ EQUALITY integerMatch
|
|
||||||
+ SINGLE-VALUE
|
|
||||||
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 )
|
|
||||||
+
|
|
||||||
+attributetype ( 1.3.6.1.4.1.5322.10.1.5
|
|
||||||
+ NAME 'krb5KDCFlags'
|
|
||||||
+ EQUALITY integerMatch
|
|
||||||
+ SINGLE-VALUE
|
|
||||||
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 )
|
|
||||||
+
|
|
||||||
+attributetype ( 1.3.6.1.4.1.5322.10.1.6
|
|
||||||
+ NAME 'krb5EncryptionType'
|
|
||||||
+ EQUALITY integerMatch
|
|
||||||
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 )
|
|
||||||
+
|
|
||||||
+attributetype ( 1.3.6.1.4.1.5322.10.1.7
|
|
||||||
+ NAME 'krb5ValidStart'
|
|
||||||
+ EQUALITY generalizedTimeMatch
|
|
||||||
+ ORDERING generalizedTimeOrderingMatch
|
|
||||||
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.24
|
|
||||||
+ SINGLE-VALUE )
|
|
||||||
+
|
|
||||||
+attributetype ( 1.3.6.1.4.1.5322.10.1.8
|
|
||||||
+ NAME 'krb5ValidEnd'
|
|
||||||
+ EQUALITY generalizedTimeMatch
|
|
||||||
+ ORDERING generalizedTimeOrderingMatch
|
|
||||||
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.24
|
|
||||||
+ SINGLE-VALUE )
|
|
||||||
+
|
|
||||||
+attributetype ( 1.3.6.1.4.1.5322.10.1.9
|
|
||||||
+ NAME 'krb5PasswordEnd'
|
|
||||||
+ EQUALITY generalizedTimeMatch
|
|
||||||
+ ORDERING generalizedTimeOrderingMatch
|
|
||||||
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.24
|
|
||||||
+ SINGLE-VALUE )
|
|
||||||
+
|
|
||||||
+# this is temporary; keys will eventually
|
|
||||||
+# be child entries or compound attributes.
|
|
||||||
+attributetype ( 1.3.6.1.4.1.5322.10.1.10
|
|
||||||
+ NAME 'krb5Key'
|
|
||||||
+ DESC 'Encoded ASN1 Key as an octet string'
|
|
||||||
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 )
|
|
||||||
+
|
|
||||||
+attributetype ( 1.3.6.1.4.1.5322.10.1.11
|
|
||||||
+ NAME 'krb5PrincipalRealm'
|
|
||||||
+ DESC 'Distinguished name of krb5Realm entry'
|
|
||||||
+ SUP distinguishedName )
|
|
||||||
+
|
|
||||||
+attributetype ( 1.3.6.1.4.1.5322.10.1.12
|
|
||||||
+ NAME 'krb5RealmName'
|
|
||||||
+ EQUALITY octetStringMatch
|
|
||||||
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{128} )
|
|
||||||
+
|
|
||||||
+# Object class definitions
|
|
||||||
+
|
|
||||||
+objectclass ( 1.3.6.1.4.1.5322.10.2.1
|
|
||||||
+ NAME 'krb5Principal'
|
|
||||||
+ SUP top
|
|
||||||
+ AUXILIARY
|
|
||||||
+ MUST ( krb5PrincipalName )
|
|
||||||
+ MAY ( cn $ krb5PrincipalRealm ) )
|
|
||||||
+
|
|
||||||
+objectclass ( 1.3.6.1.4.1.5322.10.2.2
|
|
||||||
+ NAME 'krb5KDCEntry'
|
|
||||||
+ SUP krb5Principal
|
|
||||||
+ AUXILIARY
|
|
||||||
+ MUST ( krb5KeyVersionNumber )
|
|
||||||
+ MAY ( krb5ValidStart $ krb5ValidEnd $ krb5PasswordEnd $
|
|
||||||
+ krb5MaxLife $ krb5MaxRenew $ krb5KDCFlags $
|
|
||||||
+ krb5EncryptionType $ krb5Key ) )
|
|
||||||
+
|
|
||||||
+objectclass ( 1.3.6.1.4.1.5322.10.2.3
|
|
||||||
+ NAME 'krb5Realm'
|
|
||||||
+ SUP top
|
|
||||||
+ AUXILIARY
|
|
||||||
+ MUST ( krb5RealmName ) )
|
|
||||||
+
|
|
@ -1,198 +0,0 @@
|
|||||||
Submitted By: Mario Fetka (geos_one) (mario dot fetka at gmail dot com)
|
|
||||||
Date: 2010-01-29
|
|
||||||
Initial Package Version: 2.3.2
|
|
||||||
Origin: https://ml.mandriva.net/wws/arc/mds-devel/2010-01/msg00004.html
|
|
||||||
Upstream Status: unknown
|
|
||||||
Description: Add the bulk user import module
|
|
||||||
|
|
||||||
diff -Naur mmc-agent-2.3.2.orig/conf/plugins/bulkimport.ini mmc-agent-2.3.2/conf/plugins/bulkimport.ini
|
|
||||||
--- mmc-agent-2.3.2.orig/conf/plugins/bulkimport.ini 1970-01-01 00:00:00.000000000 +0000
|
|
||||||
+++ mmc-agent-2.3.2/conf/plugins/bulkimport.ini 2010-01-24 23:03:45.000000000 +0000
|
|
||||||
@@ -0,0 +1,2 @@
|
|
||||||
+[main]
|
|
||||||
+disable = 0
|
|
||||||
diff -Naur mmc-agent-2.3.2.orig/contrib/bulkimport/README mmc-agent-2.3.2/contrib/bulkimport/README
|
|
||||||
--- mmc-agent-2.3.2.orig/contrib/bulkimport/README 1970-01-01 00:00:00.000000000 +0000
|
|
||||||
+++ mmc-agent-2.3.2/contrib/bulkimport/README 2010-01-24 23:50:03.000000000 +0000
|
|
||||||
@@ -0,0 +1,120 @@
|
|
||||||
+Description:
|
|
||||||
+
|
|
||||||
+The bulk user management tool has been designed as a plugin for MDS. It reads a CSV file and then imports, deletes
|
|
||||||
+and modifies user attributes for each user in the CSV file. It does this using a two step process and performs all the
|
|
||||||
+changes while the user waits for the page to refresh.
|
|
||||||
+
|
|
||||||
+For each record, it calls the appropriate methods in the user base module of mmc (python back end).
|
|
||||||
+
|
|
||||||
+Installation:
|
|
||||||
+The following changes are needed to mmc:
|
|
||||||
+
|
|
||||||
+1. Bug fix in PageGenerator, this has already been fixed up stream, but if not, apply the patch.
|
|
||||||
+2. Add in a require to page generator and add menu item to sidebar of user plugin.
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+Apply patches from: bulkuserimport.patch
|
|
||||||
+Apply patch, with
|
|
||||||
+
|
|
||||||
+cd /usr/share/mmc
|
|
||||||
+patch -p1 < /tmp/bulkuserimport.patch
|
|
||||||
+
|
|
||||||
+Patched versions of the following files are included, but not needed if you apply the patch above:
|
|
||||||
+./mmc-web/main.php
|
|
||||||
+./mmc-web/modules/base/users/localSidebar.php
|
|
||||||
+./mmc-web/includes/PageGenerator.php
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+The following files need to be installed:
|
|
||||||
+cp -r ./mmc-web/modules/csvimport /usr/share/mmc/modules
|
|
||||||
+cp ./etc/mmc/plugins/csvimport.ini /etc/mmc/plugins/
|
|
||||||
+cp -r ./mmc-python/plugins/csvimport /usr/lib64/python2.6/site-packages/mmc/plugins/
|
|
||||||
+
|
|
||||||
+Restart mmc-agent after copying files.
|
|
||||||
+
|
|
||||||
+Usage:
|
|
||||||
+
|
|
||||||
+CSV Formatting:
|
|
||||||
+
|
|
||||||
+Delimiator: ,
|
|
||||||
+Wrapper: "
|
|
||||||
+Escape characture: \
|
|
||||||
+
|
|
||||||
+CSV Header requirements:
|
|
||||||
+
|
|
||||||
+Required attribute: "login"
|
|
||||||
+Require for import: "password","firstname","surname"
|
|
||||||
+Additional headers can be set and must match the attribute name in ldap, for example:
|
|
||||||
+"login","password","firstname","surname","primarygroup","mail"
|
|
||||||
+
|
|
||||||
+Special attributes
|
|
||||||
+
|
|
||||||
+The following can be set to: yes or no.
|
|
||||||
+createhomedir (yes by default)
|
|
||||||
+files (default set to yes for delete operation, users home directory will be removed.)
|
|
||||||
+
|
|
||||||
+Defaults
|
|
||||||
+
|
|
||||||
+homdir (homedir/username by default)
|
|
||||||
+primaryGroup (default primary group as per base.ini plugin config)
|
|
||||||
+
|
|
||||||
+Currently supported attributes are:
|
|
||||||
+
|
|
||||||
+ * audio
|
|
||||||
+ * carLicense
|
|
||||||
+ * departmentNumber
|
|
||||||
+ * description
|
|
||||||
+ * files
|
|
||||||
+ * firstname
|
|
||||||
+ * gecos
|
|
||||||
+ * localityName
|
|
||||||
+ * login
|
|
||||||
+ * loginShell
|
|
||||||
+ * mail
|
|
||||||
+ * manager
|
|
||||||
+ * mobile
|
|
||||||
+ * organizationName
|
|
||||||
+ * pager
|
|
||||||
+ * password
|
|
||||||
+ * physicalDeliveryOfficeName
|
|
||||||
+ * postalAddress
|
|
||||||
+ * postalCode
|
|
||||||
+ * preferredLanguage
|
|
||||||
+ * primarygroup
|
|
||||||
+ * roomNumber
|
|
||||||
+ * surname
|
|
||||||
+ * telephoneNumber
|
|
||||||
+ * title
|
|
||||||
+
|
|
||||||
+Examples CSV file contents. Create some users:
|
|
||||||
+
|
|
||||||
+"firstname","surname","mail","login","password","telephoneNumber","localityName"
|
|
||||||
+"User1","Last1","user1@example.com","user1","test1",,"Auckland"
|
|
||||||
+"User2","Last2","user2@example.com","user2","test2",,"Auckland"
|
|
||||||
+"User3","Last3","user3@example.com","user3","test3",,"Auckland"
|
|
||||||
+
|
|
||||||
+Modify the mail and loginShell attributes:
|
|
||||||
+
|
|
||||||
+"mail","login","loginShell"
|
|
||||||
+"user1@oss.co.nz","user1","/bin/bash"
|
|
||||||
+"user2@oss.co.nz","user2","/bin/zsh"
|
|
||||||
+"user3@oss.co.nz","user3","/bin/zsh"
|
|
||||||
+
|
|
||||||
+Delete some users:
|
|
||||||
+
|
|
||||||
+"login"
|
|
||||||
+"user1"
|
|
||||||
+"user2"
|
|
||||||
+
|
|
||||||
+Generating user login names, email addresses, etc.
|
|
||||||
+
|
|
||||||
+This tool does not generate data for you. To generate data from a list of names, use functions in OpenOffice Calc, for example, to generate the
|
|
||||||
+email address, use the function:
|
|
||||||
+
|
|
||||||
+=CONCATENATE(a1,"@example.com")
|
|
||||||
+
|
|
||||||
+and for user names:
|
|
||||||
+
|
|
||||||
+=LOWER(CONCATENATE(LEFT(B1),MID(C1,1,5)))
|
|
||||||
+where B1 is first name, C1 is Last name.
|
|
||||||
+
|
|
||||||
diff -Naur mmc-agent-2.3.2.orig/mmc/plugins/bulkimport/__init__.py mmc-agent-2.3.2/mmc/plugins/bulkimport/__init__.py
|
|
||||||
--- mmc-agent-2.3.2.orig/mmc/plugins/bulkimport/__init__.py 1970-01-01 00:00:00.000000000 +0000
|
|
||||||
+++ mmc-agent-2.3.2/mmc/plugins/bulkimport/__init__.py 2010-01-29 15:57:48.381422910 +0000
|
|
||||||
@@ -0,0 +1,47 @@
|
|
||||||
+# -*- coding: utf-8; -*-
|
|
||||||
+#
|
|
||||||
+# (c) 2009 Open Systems Specilists - Glen Ogilvie
|
|
||||||
+#
|
|
||||||
+# $Id: __init__.py 743 2008-12-15 14:20:35Z cdelfosse $
|
|
||||||
+#
|
|
||||||
+# This file is part of Mandriva Management Console (MMC).
|
|
||||||
+#
|
|
||||||
+# MMC is free software; you can redistribute it and/or modify
|
|
||||||
+# it under the terms of the GNU General Public License as published by
|
|
||||||
+# the Free Software Foundation; either version 2 of the License, or
|
|
||||||
+# (at your option) any later version.
|
|
||||||
+#
|
|
||||||
+# MMC is distributed 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 General Public License for more details.
|
|
||||||
+#
|
|
||||||
+# You should have received a copy of the GNU General Public License
|
|
||||||
+# along with MMC; if not, write to the Free Software
|
|
||||||
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
+
|
|
||||||
+import socket
|
|
||||||
+import ldap
|
|
||||||
+import logging
|
|
||||||
+import os
|
|
||||||
+import os.path
|
|
||||||
+import grp
|
|
||||||
+
|
|
||||||
+from mmc.plugins.base import ldapUserGroupControl
|
|
||||||
+from mmc.support.config import *
|
|
||||||
+from mmc.support import mmctools
|
|
||||||
+import mmc
|
|
||||||
+
|
|
||||||
+INI = "/etc/mmc/plugins/bulkimport.ini"
|
|
||||||
+
|
|
||||||
+VERSION = "0.0.1"
|
|
||||||
+APIVERSION = "1:0:0"
|
|
||||||
+REVISION = int("$Rev: 1 $".split(':')[1].strip(' $'))
|
|
||||||
+
|
|
||||||
+def getVersion(): return VERSION
|
|
||||||
+def getApiVersion(): return APIVERSION
|
|
||||||
+def getRevision(): return REVISION
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+def activate():
|
|
||||||
+ return True
|
|
||||||
diff -Naur mmc-agent-2.3.2.orig/setup.py mmc-agent-2.3.2/setup.py
|
|
||||||
--- mmc-agent-2.3.2.orig/setup.py 2010-01-29 15:56:43.394175082 +0000
|
|
||||||
+++ mmc-agent-2.3.2/setup.py 2010-01-29 16:00:13.916426330 +0000
|
|
||||||
@@ -8,5 +8,5 @@
|
|
||||||
author_email = "cdelfosse@mandriva.com",
|
|
||||||
maintainer = "Cedric Delfosse",
|
|
||||||
maintainer_email = "cdelfosse@mandriva.com",
|
|
||||||
- packages = ["mmc", "mmc.support", "mmc.plugins", "mmc.plugins.base", "mmc.plugins.samba", "mmc.plugins.proxy", "mmc.plugins.mail", "mmc.plugins.network", "mmc.plugins.kerberos", "mmc.plugins.printstats", "mmc.plugins.printing", "mmc.plugins.userquota"],
|
|
||||||
+ packages = ["mmc", "mmc.support", "mmc.plugins", "mmc.plugins.base", "mmc.plugins.samba", "mmc.plugins.proxy", "mmc.plugins.mail", "mmc.plugins.network", "mmc.plugins.kerberos", "mmc.plugins.printstats", "mmc.plugins.printing", "mmc.plugins.userquota", "mmc.plugins.bulkimport"],
|
|
||||||
)
|
|
@ -1,198 +0,0 @@
|
|||||||
Submitted By: Mario Fetka (geos_one) (mario dot fetka at gmail dot com)
|
|
||||||
Date: 2010-02-02
|
|
||||||
Initial Package Version: 2.3.2
|
|
||||||
Origin: https://ml.mandriva.net/wws/arc/mds-devel/2010-02/msg00000.html
|
|
||||||
Upstream Status: unknown
|
|
||||||
Description: add the bulkimport plugin
|
|
||||||
|
|
||||||
diff -Naur mmc-agent-2.3.2.orig/conf/plugins/bulkimport.ini mmc-agent-2.3.2/conf/plugins/bulkimport.ini
|
|
||||||
--- mmc-agent-2.3.2.orig/conf/plugins/bulkimport.ini 1970-01-01 00:00:00.000000000 +0000
|
|
||||||
+++ mmc-agent-2.3.2/conf/plugins/bulkimport.ini 2010-02-01 21:06:38.000000000 +0000
|
|
||||||
@@ -0,0 +1,2 @@
|
|
||||||
+[main]
|
|
||||||
+disable = 0
|
|
||||||
diff -Naur mmc-agent-2.3.2.orig/contrib/bulkimport/README mmc-agent-2.3.2/contrib/bulkimport/README
|
|
||||||
--- mmc-agent-2.3.2.orig/contrib/bulkimport/README 1970-01-01 00:00:00.000000000 +0000
|
|
||||||
+++ mmc-agent-2.3.2/contrib/bulkimport/README 2010-02-02 06:06:10.529049665 +0000
|
|
||||||
@@ -0,0 +1,120 @@
|
|
||||||
+Description:
|
|
||||||
+
|
|
||||||
+The bulk user management tool has been designed as a plugin for MDS. It reads a CSV file and then imports, deletes
|
|
||||||
+and modifies user attributes for each user in the CSV file. It does this using a two step process and performs all the
|
|
||||||
+changes while the user waits for the page to refresh.
|
|
||||||
+
|
|
||||||
+For each record, it calls the appropriate methods in the user base module of mmc (python back end).
|
|
||||||
+
|
|
||||||
+Installation:
|
|
||||||
+The following changes are needed to mmc:
|
|
||||||
+
|
|
||||||
+1. Bug fix in PageGenerator, this has already been fixed up stream, but if not, apply the patch.
|
|
||||||
+2. Add in a require to page generator and add menu item to sidebar of user plugin.
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+Apply patches from: bulkuserimport.patch
|
|
||||||
+Apply patch, with
|
|
||||||
+
|
|
||||||
+cd /usr/share/mmc
|
|
||||||
+patch -p1 < /tmp/bulkuserimport.patch
|
|
||||||
+
|
|
||||||
+Patched versions of the following files are included, but not needed if you apply the patch above:
|
|
||||||
+./mmc-web/main.php
|
|
||||||
+./mmc-web/modules/base/users/localSidebar.php
|
|
||||||
+./mmc-web/includes/PageGenerator.php
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+The following files need to be installed:
|
|
||||||
+cp -r ./mmc-web/modules/csvimport /usr/share/mmc/modules
|
|
||||||
+cp ./etc/mmc/plugins/csvimport.ini /etc/mmc/plugins/
|
|
||||||
+cp -r ./mmc-python/plugins/csvimport /usr/lib64/python2.6/site-packages/mmc/plugins/
|
|
||||||
+
|
|
||||||
+Restart mmc-agent after copying files.
|
|
||||||
+
|
|
||||||
+Usage:
|
|
||||||
+
|
|
||||||
+CSV Formatting:
|
|
||||||
+
|
|
||||||
+Delimiator: ,
|
|
||||||
+Wrapper: "
|
|
||||||
+Escape characture: \
|
|
||||||
+
|
|
||||||
+CSV Header requirements:
|
|
||||||
+
|
|
||||||
+Required attribute: "login"
|
|
||||||
+Require for import: "password","firstname","surname"
|
|
||||||
+Additional headers can be set and must match the attribute name in ldap, for example:
|
|
||||||
+"login","password","firstname","surname","primarygroup","mail"
|
|
||||||
+
|
|
||||||
+Special attributes
|
|
||||||
+
|
|
||||||
+The following can be set to: yes or no.
|
|
||||||
+createhomedir (yes by default)
|
|
||||||
+files (default set to yes for delete operation, users home directory will be removed.)
|
|
||||||
+
|
|
||||||
+Defaults
|
|
||||||
+
|
|
||||||
+homdir (homedir/username by default)
|
|
||||||
+primaryGroup (default primary group as per base.ini plugin config)
|
|
||||||
+
|
|
||||||
+Currently supported attributes are:
|
|
||||||
+
|
|
||||||
+ * audio
|
|
||||||
+ * carLicense
|
|
||||||
+ * departmentNumber
|
|
||||||
+ * description
|
|
||||||
+ * files
|
|
||||||
+ * firstname
|
|
||||||
+ * gecos
|
|
||||||
+ * localityName
|
|
||||||
+ * login
|
|
||||||
+ * loginShell
|
|
||||||
+ * mail
|
|
||||||
+ * manager
|
|
||||||
+ * mobile
|
|
||||||
+ * organizationName
|
|
||||||
+ * pager
|
|
||||||
+ * password
|
|
||||||
+ * physicalDeliveryOfficeName
|
|
||||||
+ * postalAddress
|
|
||||||
+ * postalCode
|
|
||||||
+ * preferredLanguage
|
|
||||||
+ * primarygroup
|
|
||||||
+ * roomNumber
|
|
||||||
+ * surname
|
|
||||||
+ * telephoneNumber
|
|
||||||
+ * title
|
|
||||||
+
|
|
||||||
+Examples CSV file contents. Create some users:
|
|
||||||
+
|
|
||||||
+"firstname","surname","mail","login","password","telephoneNumber","localityName"
|
|
||||||
+"User1","Last1","user1@example.com","user1","test1",,"Auckland"
|
|
||||||
+"User2","Last2","user2@example.com","user2","test2",,"Auckland"
|
|
||||||
+"User3","Last3","user3@example.com","user3","test3",,"Auckland"
|
|
||||||
+
|
|
||||||
+Modify the mail and loginShell attributes:
|
|
||||||
+
|
|
||||||
+"mail","login","loginShell"
|
|
||||||
+"user1@oss.co.nz","user1","/bin/bash"
|
|
||||||
+"user2@oss.co.nz","user2","/bin/zsh"
|
|
||||||
+"user3@oss.co.nz","user3","/bin/zsh"
|
|
||||||
+
|
|
||||||
+Delete some users:
|
|
||||||
+
|
|
||||||
+"login"
|
|
||||||
+"user1"
|
|
||||||
+"user2"
|
|
||||||
+
|
|
||||||
+Generating user login names, email addresses, etc.
|
|
||||||
+
|
|
||||||
+This tool does not generate data for you. To generate data from a list of names, use functions in OpenOffice Calc, for example, to generate the
|
|
||||||
+email address, use the function:
|
|
||||||
+
|
|
||||||
+=CONCATENATE(a1,"@example.com")
|
|
||||||
+
|
|
||||||
+and for user names:
|
|
||||||
+
|
|
||||||
+=LOWER(CONCATENATE(LEFT(B1),MID(C1,1,5)))
|
|
||||||
+where B1 is first name, C1 is Last name.
|
|
||||||
+
|
|
||||||
diff -Naur mmc-agent-2.3.2.orig/mmc/plugins/bulkimport/__init__.py mmc-agent-2.3.2/mmc/plugins/bulkimport/__init__.py
|
|
||||||
--- mmc-agent-2.3.2.orig/mmc/plugins/bulkimport/__init__.py 1970-01-01 00:00:00.000000000 +0000
|
|
||||||
+++ mmc-agent-2.3.2/mmc/plugins/bulkimport/__init__.py 2010-02-02 03:31:41.000000000 +0000
|
|
||||||
@@ -0,0 +1,47 @@
|
|
||||||
+# -*- coding: utf-8; -*-
|
|
||||||
+#
|
|
||||||
+# (c) 2009 Open Systems Specilists - Glen Ogilvie
|
|
||||||
+#
|
|
||||||
+# $Id: __init__.py 743 2008-12-15 14:20:35Z cdelfosse $
|
|
||||||
+#
|
|
||||||
+# This file is part of Mandriva Management Console (MMC).
|
|
||||||
+#
|
|
||||||
+# MMC is free software; you can redistribute it and/or modify
|
|
||||||
+# it under the terms of the GNU General Public License as published by
|
|
||||||
+# the Free Software Foundation; either version 2 of the License, or
|
|
||||||
+# (at your option) any later version.
|
|
||||||
+#
|
|
||||||
+# MMC is distributed 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 General Public License for more details.
|
|
||||||
+#
|
|
||||||
+# You should have received a copy of the GNU General Public License
|
|
||||||
+# along with MMC; if not, write to the Free Software
|
|
||||||
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
+
|
|
||||||
+import socket
|
|
||||||
+import ldap
|
|
||||||
+import logging
|
|
||||||
+import os
|
|
||||||
+import os.path
|
|
||||||
+import grp
|
|
||||||
+
|
|
||||||
+from mmc.plugins.base import ldapUserGroupControl
|
|
||||||
+from mmc.support.config import *
|
|
||||||
+from mmc.support import mmctools
|
|
||||||
+import mmc
|
|
||||||
+
|
|
||||||
+INI = "/etc/mmc/plugins/bulkimport.ini"
|
|
||||||
+
|
|
||||||
+VERSION = "0.0.2"
|
|
||||||
+APIVERSION = "1:0:0"
|
|
||||||
+REVISION = int("$Rev: 1 $".split(':')[1].strip(' $'))
|
|
||||||
+
|
|
||||||
+def getVersion(): return VERSION
|
|
||||||
+def getApiVersion(): return APIVERSION
|
|
||||||
+def getRevision(): return REVISION
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+def activate():
|
|
||||||
+ return True
|
|
||||||
diff -Naur mmc-agent-2.3.2.orig/setup.py mmc-agent-2.3.2/setup.py
|
|
||||||
--- mmc-agent-2.3.2.orig/setup.py 2010-02-02 06:05:59.608049317 +0000
|
|
||||||
+++ mmc-agent-2.3.2/setup.py 2010-02-02 06:06:10.529049665 +0000
|
|
||||||
@@ -8,5 +8,5 @@
|
|
||||||
author_email = "cdelfosse@mandriva.com",
|
|
||||||
maintainer = "Cedric Delfosse",
|
|
||||||
maintainer_email = "cdelfosse@mandriva.com",
|
|
||||||
- packages = ["mmc", "mmc.support", "mmc.plugins", "mmc.plugins.base", "mmc.plugins.samba", "mmc.plugins.proxy", "mmc.plugins.mail", "mmc.plugins.network", "mmc.plugins.kerberos", "mmc.plugins.printstats", "mmc.plugins.printing", "mmc.plugins.userquota"],
|
|
||||||
+ packages = ["mmc", "mmc.support", "mmc.plugins", "mmc.plugins.base", "mmc.plugins.samba", "mmc.plugins.proxy", "mmc.plugins.mail", "mmc.plugins.network", "mmc.plugins.kerberos", "mmc.plugins.printstats", "mmc.plugins.printing", "mmc.plugins.userquota", "mmc.plugins.bulkimport"],
|
|
||||||
)
|
|
@ -1,771 +0,0 @@
|
|||||||
Submitted By: Mario Fetka (mario dot fetka at gmail dot com)
|
|
||||||
Date: 2009-03-30
|
|
||||||
Initial Package Version: 2.3.2
|
|
||||||
Origin: http://mds.mandriva.org/ticket/244
|
|
||||||
Upstream Status: accepted
|
|
||||||
Description: add PowerDNS support to mmc
|
|
||||||
|
|
||||||
diff -Naur mmc-agent-2.3.2.orig/conf/plugins/network.ini mmc-agent-2.3.2/conf/plugins/network.ini
|
|
||||||
--- mmc-agent-2.3.2.orig/conf/plugins/network.ini 2008-05-16 07:39:44.000000000 +0000
|
|
||||||
+++ mmc-agent-2.3.2/conf/plugins/network.ini 2009-03-30 10:08:24.623244489 +0000
|
|
||||||
@@ -9,6 +9,10 @@
|
|
||||||
leases = /var/lib/dhcp3/dhcpd.leases
|
|
||||||
|
|
||||||
[dns]
|
|
||||||
+# DNS Server Type : (default: bind)
|
|
||||||
+# - bind (ISC Bind)
|
|
||||||
+# - pdns (PowerDNS)
|
|
||||||
+# type = bind
|
|
||||||
dn = ou=DNS,dc=mandriva,dc=com
|
|
||||||
pidfile = /var/run/bind/run/named.pid
|
|
||||||
init = /etc/init.d/bind9
|
|
||||||
diff -Naur mmc-agent-2.3.2.orig/mmc/plugins/network/__init__.py mmc-agent-2.3.2/mmc/plugins/network/__init__.py
|
|
||||||
--- mmc-agent-2.3.2.orig/mmc/plugins/network/__init__.py 2008-12-15 14:20:35.000000000 +0000
|
|
||||||
+++ mmc-agent-2.3.2/mmc/plugins/network/__init__.py 2009-03-30 10:09:41.023104866 +0000
|
|
||||||
@@ -71,13 +71,27 @@
|
|
||||||
return False
|
|
||||||
|
|
||||||
# Test if the DNS/LDAP schema is available in the directory
|
|
||||||
- try:
|
|
||||||
- schema = ldapObj.getSchema("dNSZone")
|
|
||||||
- if len(schema) <= 0:
|
|
||||||
- logger.error("DNS zone schema is not included in LDAP directory");
|
|
||||||
+ serverType = config.dnsType
|
|
||||||
+ if serverType == "pdns":
|
|
||||||
+ try:
|
|
||||||
+ schema = ldapObj.getSchema("dNSDomain2")
|
|
||||||
+ if len(schema) <= 0:
|
|
||||||
+ logger.error("DNS zone schema (dnsdomain2.schema) is not included in LDAP directory");
|
|
||||||
+ return False
|
|
||||||
+ except:
|
|
||||||
+ logger.exception("invalid DNS schema")
|
|
||||||
+ return False
|
|
||||||
+ elif serverType == "bind":
|
|
||||||
+ try:
|
|
||||||
+ schema = ldapObj.getSchema("dNSZone")
|
|
||||||
+ if len(schema) <= 0:
|
|
||||||
+ logger.error("DNS zone schema (dnszone.schema) is not included in LDAP directory");
|
|
||||||
+ return False
|
|
||||||
+ except:
|
|
||||||
+ logger.exception("invalid DNS schema")
|
|
||||||
return False
|
|
||||||
- except:
|
|
||||||
- logger.exception("invalid schema")
|
|
||||||
+ else:
|
|
||||||
+ logger.error("%s : Unknown DNS server."%serverType);
|
|
||||||
return False
|
|
||||||
|
|
||||||
# Create required OUs
|
|
||||||
@@ -108,26 +122,27 @@
|
|
||||||
pass
|
|
||||||
|
|
||||||
# Create DNS config base structure
|
|
||||||
- try:
|
|
||||||
- gidNumber = grp.getgrnam(config.bindGroup)
|
|
||||||
- except KeyError:
|
|
||||||
- logger.error('The group "%s" does not exist.' % config.bindGroup)
|
|
||||||
- return False
|
|
||||||
- gidNumber = gidNumber[2]
|
|
||||||
+ if serverType == "bind":
|
|
||||||
+ try:
|
|
||||||
+ gidNumber = grp.getgrnam(config.bindGroup)
|
|
||||||
+ except KeyError:
|
|
||||||
+ logger.error('The group "%s" does not exist.' % config.bindGroup)
|
|
||||||
+ return False
|
|
||||||
+ gidNumber = gidNumber[2]
|
|
||||||
|
|
||||||
- try:
|
|
||||||
- os.mkdir(config.bindLdapDir)
|
|
||||||
- os.chmod(config.bindLdapDir, 02750)
|
|
||||||
- os.chown(config.bindLdapDir, -1, gidNumber)
|
|
||||||
- except OSError, e:
|
|
||||||
- # errno = 17 is "File exists"
|
|
||||||
- if e.errno != 17: raise
|
|
||||||
-
|
|
||||||
- if not os.path.exists(config.bindLdap):
|
|
||||||
- f = open(config.bindLdap, "w")
|
|
||||||
- f.close()
|
|
||||||
- os.chmod(config.bindLdap, 0640)
|
|
||||||
- os.chown(config.bindLdap, -1, gidNumber)
|
|
||||||
+ try:
|
|
||||||
+ os.mkdir(config.bindLdapDir)
|
|
||||||
+ os.chmod(config.bindLdapDir, 02750)
|
|
||||||
+ os.chown(config.bindLdapDir, -1, gidNumber)
|
|
||||||
+ except OSError, e:
|
|
||||||
+ # errno = 17 is "File exists"
|
|
||||||
+ if e.errno != 17: raise
|
|
||||||
+
|
|
||||||
+ if not os.path.exists(config.bindLdap):
|
|
||||||
+ f = open(config.bindLdap, "w")
|
|
||||||
+ f.close()
|
|
||||||
+ os.chmod(config.bindLdap, 0640)
|
|
||||||
+ os.chown(config.bindLdap, -1, gidNumber)
|
|
||||||
|
|
||||||
return True
|
|
||||||
|
|
||||||
@@ -344,6 +359,10 @@
|
|
||||||
self.dhcpLogFile = self.get("dhcp", "logfile")
|
|
||||||
self.dhcpLeases = self.get("dhcp", "leases")
|
|
||||||
# DNS conf
|
|
||||||
+ try:
|
|
||||||
+ self.dnsType = self.get("dns", "type")
|
|
||||||
+ except NoOptionError:
|
|
||||||
+ self.dnsType = "bind"
|
|
||||||
self.dnsDN = self.getdn("dns", "dn")
|
|
||||||
self.dnsPidFile = self.get("dns", "pidfile")
|
|
||||||
self.dnsInit = self.get("dns", "init")
|
|
||||||
diff -Naur mmc-agent-2.3.2.orig/mmc/plugins/network/dns.py mmc-agent-2.3.2/mmc/plugins/network/dns.py
|
|
||||||
--- mmc-agent-2.3.2.orig/mmc/plugins/network/dns.py 2008-12-10 15:18:18.000000000 +0000
|
|
||||||
+++ mmc-agent-2.3.2/mmc/plugins/network/dns.py 2009-03-30 10:09:41.020789343 +0000
|
|
||||||
@@ -41,6 +41,15 @@
|
|
||||||
self.configDns.dnsReader = self.config.get("ldap", "rootName")
|
|
||||||
if not self.configDns.dnsReaderPassword:
|
|
||||||
self.configDns.dnsReaderPassword = self.config.get("ldap", "password")
|
|
||||||
+ if self.configDns.dnsType == "pdns":
|
|
||||||
+ self.pdns = True
|
|
||||||
+ self.zoneNameField = "associatedDomain"
|
|
||||||
+ self.relativeDomainNameField = "associatedDomain"
|
|
||||||
+ else:
|
|
||||||
+ self.pdns = False
|
|
||||||
+ self.zoneNameField = "zoneName"
|
|
||||||
+ self.relativeDomainNameField = "relativeDomainName"
|
|
||||||
+
|
|
||||||
self.reverseMarkup = "Reverse:"
|
|
||||||
self.reversePrefix = ".in-addr.arpa"
|
|
||||||
self.templateZone = """
|
|
||||||
@@ -77,7 +86,7 @@
|
|
||||||
"""
|
|
||||||
ret = []
|
|
||||||
for result in self.getZones(self.reversePrefix, True):
|
|
||||||
- ret.append(self.translateReverse(result[1]["zoneName"][0]))
|
|
||||||
+ ret.append(self.translateReverse(result[1][self.zoneNameField][0]))
|
|
||||||
return ret
|
|
||||||
|
|
||||||
def getReverseZone(self, name):
|
|
||||||
@@ -85,9 +94,17 @@
|
|
||||||
Return the name of the reverse zone of a zone
|
|
||||||
"""
|
|
||||||
ret = []
|
|
||||||
- for result in self.getZones(reverse = True, base = "ou=" + name + "," + self.configDns.dnsDN):
|
|
||||||
- zoneName = result[1]["zoneName"][0]
|
|
||||||
- if zoneName.endswith(self.reversePrefix): ret.append(zoneName)
|
|
||||||
+ if self.pdns:
|
|
||||||
+ tmpZones = self.getZones(reverse = True, base = self.configDns.dnsDN)
|
|
||||||
+ for result in tmpZones:
|
|
||||||
+ zoneName = result[1][self.zoneNameField][0]
|
|
||||||
+ nsRecord = result[1]["nSRecord"][0]
|
|
||||||
+ if zoneName.endswith(self.reversePrefix) and nsRecord.endswith(".%s"%name): ret.append(zoneName)
|
|
||||||
+ else:
|
|
||||||
+ tmpZones = self.getZones(reverse = True, base = "ou=" + name + "," + self.configDns.dnsDN)
|
|
||||||
+ for result in tmpZones:
|
|
||||||
+ zoneName = result[1][self.zoneNameField][0]
|
|
||||||
+ if zoneName.endswith(self.reversePrefix): ret.append(zoneName)
|
|
||||||
return ret
|
|
||||||
|
|
||||||
def getZoneObjects(self, name, filt = None):
|
|
||||||
@@ -98,10 +115,13 @@
|
|
||||||
filt = "*" + filt.strip() + "*"
|
|
||||||
else:
|
|
||||||
filt = "*"
|
|
||||||
- search = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=%s))" % (name, filt), None)
|
|
||||||
+ if self.pdns:
|
|
||||||
+ search = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(associatedDomain=%s.%s))" % (filt, name), None)
|
|
||||||
+ else:
|
|
||||||
+ search = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=%s))" % (name, filt), None)
|
|
||||||
ret = []
|
|
||||||
for result in search:
|
|
||||||
- relative = result[1]["relativeDomainName"][0]
|
|
||||||
+ relative = result[1][self.relativeDomainNameField][0]
|
|
||||||
# Don't count these entries
|
|
||||||
if relative != "@" and relative != name + ".":
|
|
||||||
ret.append(result)
|
|
||||||
@@ -111,17 +131,24 @@
|
|
||||||
"""
|
|
||||||
Return the number of objects defined in a zone
|
|
||||||
"""
|
|
||||||
- search = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s))" % (name), ["relativeDomainName"])
|
|
||||||
count = 0
|
|
||||||
+ if self.pdns:
|
|
||||||
+ search = self.l.search_s("dc=" + name + "," + self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(associatedDomain=*.%s))" % (name), ["associatedDomain"])
|
|
||||||
+ else:
|
|
||||||
+ search = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s))" % (name), ["relativeDomainName"])
|
|
||||||
+
|
|
||||||
for result in search:
|
|
||||||
- relative = result[1]["relativeDomainName"][0]
|
|
||||||
+ relative = result[1][self.relativeDomainNameField][0]
|
|
||||||
# Don't count these entries
|
|
||||||
if relative != "@" and relative != name + ".":
|
|
||||||
count = count + 1
|
|
||||||
return count
|
|
||||||
|
|
||||||
def getZone(self, zoneName):
|
|
||||||
- return self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=%s))" % (zoneName, zoneName + "."), None)
|
|
||||||
+ if self.pdns:
|
|
||||||
+ return self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(associatedDomain=%s))" % (zoneName), None)
|
|
||||||
+ else:
|
|
||||||
+ return self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=%s))" % (zoneName, zoneName + "."), None)
|
|
||||||
|
|
||||||
def getZones(self, filt = "", reverse = False, base = None):
|
|
||||||
"""
|
|
||||||
@@ -131,14 +158,23 @@
|
|
||||||
if not filt: filt = "*"
|
|
||||||
else: filt = "*" + filt + "*"
|
|
||||||
if not base: base = self.configDns.dnsDN
|
|
||||||
- search = self.l.search_s(base, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=%s))" % (filt, filt), None)
|
|
||||||
ret = []
|
|
||||||
- for result in search:
|
|
||||||
- if (result[1]["zoneName"][0] + ".") == result[1]["relativeDomainName"][0]:
|
|
||||||
- if self.reversePrefix in result[1]["zoneName"][0]:
|
|
||||||
+ if self.configDns.dnsType == "pdns":
|
|
||||||
+ search = self.l.search_s(base, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(soarecord=*)(associatedDomain=%s))" %filt, None)
|
|
||||||
+ for result in search:
|
|
||||||
+ if self.reversePrefix in result[1][self.zoneNameField][0]:
|
|
||||||
# Reverse zone
|
|
||||||
if reverse: ret.append(result)
|
|
||||||
else: ret.append(result)
|
|
||||||
+
|
|
||||||
+ else:
|
|
||||||
+ search = self.l.search_s(base, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=%s))" % (filt, filt), None)
|
|
||||||
+ for result in search:
|
|
||||||
+ if (result[1]["zoneName"][0] + ".") == result[1]["relativeDomainName"][0]:
|
|
||||||
+ if self.reversePrefix in result[1][self.zoneNameField][0]:
|
|
||||||
+ # Reverse zone
|
|
||||||
+ if reverse: ret.append(result)
|
|
||||||
+ else: ret.append(result)
|
|
||||||
return ret
|
|
||||||
|
|
||||||
def zoneExists(self, zone):
|
|
||||||
@@ -168,32 +204,34 @@
|
|
||||||
else:
|
|
||||||
raise "Won't create reverse zone as asked, netmask is not 8, 16 or 24"
|
|
||||||
|
|
||||||
- f = open(os.path.join(self.configDns.bindLdapDir, name), "w")
|
|
||||||
- d = {
|
|
||||||
- "zone" : name,
|
|
||||||
- "ldapurl" : self.ldapHost + "/" + self.configDns.dnsDN,
|
|
||||||
- "dnsreader": urllib.quote(self.configDns.dnsReader),
|
|
||||||
- "dnsreaderpasswd" : urllib.quote(self.configDns.dnsReaderPassword)
|
|
||||||
- }
|
|
||||||
- f.write(self.templateZone % d)
|
|
||||||
- if reverse:
|
|
||||||
- d["zone"] = self.reverseZone(network)
|
|
||||||
+ if not self.pdns:
|
|
||||||
+ # Create Bind configuration files
|
|
||||||
+ f = open(os.path.join(self.configDns.bindLdapDir, name), "w")
|
|
||||||
+ d = {
|
|
||||||
+ "zone" : name,
|
|
||||||
+ "ldapurl" : self.ldapHost + "/" + self.configDns.dnsDN,
|
|
||||||
+ "dnsreader": urllib.quote(self.configDns.dnsReader),
|
|
||||||
+ "dnsreaderpasswd" : urllib.quote(self.configDns.dnsReaderPassword)
|
|
||||||
+ }
|
|
||||||
f.write(self.templateZone % d)
|
|
||||||
- f.close()
|
|
||||||
- os.chmod(os.path.join(self.configDns.bindLdapDir, name), 0640)
|
|
||||||
+ if reverse:
|
|
||||||
+ d["zone"] = self.reverseZone(network)
|
|
||||||
+ f.write(self.templateZone % d)
|
|
||||||
+ f.close()
|
|
||||||
+ os.chmod(os.path.join(self.configDns.bindLdapDir, name), 0640)
|
|
||||||
|
|
||||||
- f = open(self.configDns.bindLdap, "r")
|
|
||||||
- found = False
|
|
||||||
- toadd = 'include "' + os.path.join(self.configDns.bindLdapChrootConfPath, name) + '";\n'
|
|
||||||
- for line in f:
|
|
||||||
- if line == toadd:
|
|
||||||
- found = True
|
|
||||||
- break
|
|
||||||
- f.close()
|
|
||||||
- if not found:
|
|
||||||
- f = open(self.configDns.bindLdap, "a")
|
|
||||||
- f.write(toadd)
|
|
||||||
+ f = open(self.configDns.bindLdap, "r")
|
|
||||||
+ found = False
|
|
||||||
+ toadd = 'include "' + os.path.join(self.configDns.bindLdapChrootConfPath, name) + '";\n'
|
|
||||||
+ for line in f:
|
|
||||||
+ if line == toadd:
|
|
||||||
+ found = True
|
|
||||||
+ break
|
|
||||||
f.close()
|
|
||||||
+ if not found:
|
|
||||||
+ f = open(self.configDns.bindLdap, "a")
|
|
||||||
+ f.write(toadd)
|
|
||||||
+ f.close()
|
|
||||||
|
|
||||||
# Create the needed zones object in LDAP
|
|
||||||
if reverse:
|
|
||||||
@@ -205,10 +243,15 @@
|
|
||||||
|
|
||||||
# Fill SOA
|
|
||||||
self.addSOA(name)
|
|
||||||
- ns = nameserver + "." + name + "."
|
|
||||||
+ if self.pdns:
|
|
||||||
+ ns = nameserver + "." + name
|
|
||||||
+ mailaddr = "admin." + name
|
|
||||||
+ else:
|
|
||||||
+ ns = nameserver + "." + name + "."
|
|
||||||
+ mailaddr = "admin." + name + "."
|
|
||||||
rec = {
|
|
||||||
"nameserver" : ns,
|
|
||||||
- "emailaddr" : "admin." + name + ".",
|
|
||||||
+ "emailaddr" : mailaddr,
|
|
||||||
"serial" : self.computeSerial(),
|
|
||||||
"refresh" : "2D",
|
|
||||||
"retry" : "15M",
|
|
||||||
@@ -234,18 +277,26 @@
|
|
||||||
|
|
||||||
@param name: the zone name to delete
|
|
||||||
"""
|
|
||||||
- self.delRecursiveEntry("ou=" + zone + "," + self.configDns.dnsDN)
|
|
||||||
- os.unlink(os.path.join(self.configDns.bindLdapDir, zone))
|
|
||||||
- newcontent = []
|
|
||||||
- f = open(self.configDns.bindLdap, "r")
|
|
||||||
- for line in f:
|
|
||||||
- if not "/" + zone + '";' in line:
|
|
||||||
- newcontent.append(line)
|
|
||||||
- f.close()
|
|
||||||
- f = open(self.configDns.bindLdap, "w+")
|
|
||||||
- for line in newcontent:
|
|
||||||
- f.write(line)
|
|
||||||
- f.close()
|
|
||||||
+ if self.pdns:
|
|
||||||
+ zoneDN = "dc=" + zone + "," + self.configDns.dnsDN
|
|
||||||
+ self.delRecursiveEntry(zoneDN)
|
|
||||||
+ reverseDN = self.getReverseZone(zone)
|
|
||||||
+ if reverseDN[0]:
|
|
||||||
+ self.delRecursiveEntry("dc=" + reverseDN[0] + "," + self.configDns.dnsDN)
|
|
||||||
+ else:
|
|
||||||
+ zoneDN = "ou=" + zone + "," + self.configDns.dnsDN
|
|
||||||
+ self.delRecursiveEntry(zoneDN)
|
|
||||||
+ os.unlink(os.path.join(self.configDns.bindLdapDir, zone))
|
|
||||||
+ newcontent = []
|
|
||||||
+ f = open(self.configDns.bindLdap, "r")
|
|
||||||
+ for line in f:
|
|
||||||
+ if not "/" + zone + '";' in line:
|
|
||||||
+ newcontent.append(line)
|
|
||||||
+ f.close()
|
|
||||||
+ f = open(self.configDns.bindLdap, "w+")
|
|
||||||
+ for line in newcontent:
|
|
||||||
+ f.write(line)
|
|
||||||
+ f.close()
|
|
||||||
|
|
||||||
def addDnsZone(self, zoneName, description = None, container = None):
|
|
||||||
"""
|
|
||||||
@@ -253,40 +304,55 @@
|
|
||||||
"""
|
|
||||||
if not container: container = zoneName
|
|
||||||
# Create the container of this zone and its reverses if it does not exist
|
|
||||||
- try:
|
|
||||||
- self.addOu(container, self.configDns.dnsDN)
|
|
||||||
- except ldap.ALREADY_EXISTS:
|
|
||||||
- pass
|
|
||||||
- # Create the ou defining this zone and that will contain all records
|
|
||||||
- self.addOu(zoneName, "ou=" + container + "," + self.configDns.dnsDN)
|
|
||||||
- dn = "zoneName=" + zoneName + "," + "ou=" + zoneName + "," + "ou=" + container + "," + self.configDns.dnsDN
|
|
||||||
- entry = {
|
|
||||||
- "zoneName" : zoneName,
|
|
||||||
- "objectClass" : ["top", "dNSZone"],
|
|
||||||
- "relativeDomainName" : zoneName + ".",
|
|
||||||
- }
|
|
||||||
- if description: entry["tXTRecord"] = [description]
|
|
||||||
+ if self.pdns:
|
|
||||||
+ dn = "dc=" + zoneName + "," + self.configDns.dnsDN
|
|
||||||
+ entry = {
|
|
||||||
+ "associateddomain" : zoneName,
|
|
||||||
+ "objectClass" : ["top", "domainrelatedobject", "dnsdomain2", "dcobject"],
|
|
||||||
+ "dc" : zoneName,
|
|
||||||
+ }
|
|
||||||
+ if description: entry["tXTRecord"] = [description]
|
|
||||||
+ else:
|
|
||||||
+ try:
|
|
||||||
+ self.addOu(container, self.configDns.dnsDN)
|
|
||||||
+ except ldap.ALREADY_EXISTS:
|
|
||||||
+ pass
|
|
||||||
+ # Create the ou defining this zone and that will contain all records
|
|
||||||
+ self.addOu(zoneName, "ou=" + container + "," + self.configDns.dnsDN)
|
|
||||||
+ dn = "zoneName=" + zoneName + "," + "ou=" + zoneName + "," + "ou=" + container + "," + self.configDns.dnsDN
|
|
||||||
+ entry = {
|
|
||||||
+ "zoneName" : zoneName,
|
|
||||||
+ "objectClass" : ["top", "dNSZone"],
|
|
||||||
+ "relativeDomainName" : zoneName + ".",
|
|
||||||
+ }
|
|
||||||
+ if description: entry["tXTRecord"] = [description]
|
|
||||||
attributes = [ (k,v) for k,v in entry.items() ]
|
|
||||||
self.l.add_s(dn, attributes)
|
|
||||||
|
|
||||||
def addSOA(self, zoneName, container = None, dnsClass = "IN"):
|
|
||||||
if not container: container = zoneName
|
|
||||||
- dn = "relativeDomainName=@," + "ou=" + zoneName + "," + "ou=" + container + "," + self.configDns.dnsDN
|
|
||||||
- entry = {
|
|
||||||
- "zoneName" : zoneName,
|
|
||||||
- "objectClass" : ["top", "dNSZone"],
|
|
||||||
- "relativeDomainName" : "@",
|
|
||||||
- "dnsClass" : dnsClass
|
|
||||||
- }
|
|
||||||
- attributes=[ (k,v) for k,v in entry.items() ]
|
|
||||||
- self.l.add_s(dn, attributes)
|
|
||||||
+ if not self.pdns:
|
|
||||||
+ dn = "relativeDomainName=@," + "ou=" + zoneName + "," + "ou=" + container + "," + self.configDns.dnsDN
|
|
||||||
+ entry = {
|
|
||||||
+ "zoneName" : zoneName,
|
|
||||||
+ "objectClass" : ["top", "dNSZone"],
|
|
||||||
+ "relativeDomainName" : "@",
|
|
||||||
+ "dnsClass" : dnsClass
|
|
||||||
+ }
|
|
||||||
+ attributes=[ (k,v) for k,v in entry.items() ]
|
|
||||||
+ self.l.add_s(dn, attributes)
|
|
||||||
|
|
||||||
def setSOARecord(self, zoneName, record):
|
|
||||||
- soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=@))" % zoneName, None)
|
|
||||||
- if soa:
|
|
||||||
- soaDN = soa[0][0]
|
|
||||||
+ if self.pdns:
|
|
||||||
+ zoneDN = "dc=" + zoneName + "," + self.configDns.dnsDN
|
|
||||||
s = "%(nameserver)s %(emailaddr)s %(serial)s %(refresh)s %(retry)s %(expiry)s %(minimum)s" % record
|
|
||||||
- self.l.modify_s(soaDN, [(ldap.MOD_REPLACE, "sOARecord", [s])])
|
|
||||||
+ self.l.modify_s(zoneDN, [(ldap.MOD_REPLACE, "soarecord", [s])])
|
|
||||||
+ else:
|
|
||||||
+ soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=@))" % zoneName, None)
|
|
||||||
+ if soa:
|
|
||||||
+ soaDN = soa[0][0]
|
|
||||||
+ s = "%(nameserver)s %(emailaddr)s %(serial)s %(refresh)s %(retry)s %(expiry)s %(minimum)s" % record
|
|
||||||
+ self.l.modify_s(soaDN, [(ldap.MOD_REPLACE, "sOARecord", [s])])
|
|
||||||
|
|
||||||
def setSOANSRecord(self, zoneName, nameserver):
|
|
||||||
"""
|
|
||||||
@@ -294,10 +360,14 @@
|
|
||||||
It updates the SOARecord field and nsRecord field of the @ LDAP entry
|
|
||||||
of this given zone.
|
|
||||||
"""
|
|
||||||
- soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=@))" % zoneName, None)
|
|
||||||
- if soa:
|
|
||||||
- soaDN = soa[0][0]
|
|
||||||
- self.l.modify_s(soaDN, [(ldap.MOD_REPLACE, "nSRecord", [nameserver])])
|
|
||||||
+ if self.pdns:
|
|
||||||
+ zoneDN = "dc=" + zoneName + "," + self.configDns.dnsDN
|
|
||||||
+ self.l.modify_s(zoneDN, [(ldap.MOD_REPLACE, "nsrecord", [nameserver])])
|
|
||||||
+ else:
|
|
||||||
+ soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=@))" % zoneName, None)
|
|
||||||
+ if soa:
|
|
||||||
+ soaDN = soa[0][0]
|
|
||||||
+ self.l.modify_s(soaDN, [(ldap.MOD_REPLACE, "nSRecord", [nameserver])])
|
|
||||||
# Also sync SOA record if there is one
|
|
||||||
soaRecord = self.getSOARecord(zoneName)
|
|
||||||
if soaRecord:
|
|
||||||
@@ -311,22 +381,29 @@
|
|
||||||
The nsRecord corresponding to the name server containted into the
|
|
||||||
SOARecord field won't be deleted. Use the setSOANSRecord to update it.
|
|
||||||
"""
|
|
||||||
- soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=@))" % zoneName, None)
|
|
||||||
- if soa:
|
|
||||||
- soaDN = soa[0][0]
|
|
||||||
- soanameserver = soa[0][1]["sOARecord"][0].split()[0]
|
|
||||||
- # Assert that the name server contained into the SOA record won't
|
|
||||||
- # be deleted
|
|
||||||
- if soanameserver not in nameservers:
|
|
||||||
- nameservers.append(soanameserver)
|
|
||||||
- self.l.modify_s(soaDN, [(ldap.MOD_REPLACE, "nSRecord", nameservers)])
|
|
||||||
- self.updateZoneSerial(zoneName)
|
|
||||||
+ if self.pdns:
|
|
||||||
+ zoneDN = "dc=" + zoneName + "," + self.configDns.dnsDN
|
|
||||||
+ self.l.modify_s(zoneDN, [(ldap.MOD_REPLACE, "nsrecord", nameservers)])
|
|
||||||
+ else:
|
|
||||||
+ soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=@))" % zoneName, None)
|
|
||||||
+ if soa:
|
|
||||||
+ soaDN = soa[0][0]
|
|
||||||
+ soanameserver = soa[0][1]["sOARecord"][0].split()[0]
|
|
||||||
+ # Assert that the name server contained into the SOA record won't
|
|
||||||
+ # be deleted
|
|
||||||
+ if soanameserver not in nameservers:
|
|
||||||
+ nameservers.append(soanameserver)
|
|
||||||
+ self.l.modify_s(soaDN, [(ldap.MOD_REPLACE, "nSRecord", nameservers)])
|
|
||||||
+ self.updateZoneSerial(zoneName)
|
|
||||||
|
|
||||||
def setMXRecords(self, zoneName, mxservers):
|
|
||||||
"""
|
|
||||||
Update the mXRecord fields of the @ LDAP entry of the given zone.
|
|
||||||
"""
|
|
||||||
- soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=@))" % zoneName, None)
|
|
||||||
+ if self.pdns:
|
|
||||||
+ soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(associatedDomain=%s)(soarecord=*))" % zoneName, None)
|
|
||||||
+ else:
|
|
||||||
+ soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=@))" % zoneName, None)
|
|
||||||
if soa:
|
|
||||||
soaDN = soa[0][0]
|
|
||||||
self.l.modify_s(soaDN, [(ldap.MOD_REPLACE, "mXRecord", mxservers)])
|
|
||||||
@@ -353,7 +430,10 @@
|
|
||||||
@rtype: dict
|
|
||||||
"""
|
|
||||||
ret = {}
|
|
||||||
- soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=@))" % zoneName, ["soaRecord"])
|
|
||||||
+ if self.pdns:
|
|
||||||
+ soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(associatedDomain=%s))" % zoneName, ["soaRecord"])
|
|
||||||
+ else:
|
|
||||||
+ soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=@))" % zoneName, ["soaRecord"])
|
|
||||||
if soa:
|
|
||||||
try:
|
|
||||||
ret["nameserver"], ret["emailaddr"], ret["serial"], ret["refresh"], ret["retry"], ret["expiry"], ret["minimum"] = soa[0][1]["sOARecord"][0].split()
|
|
||||||
@@ -366,7 +446,10 @@
|
|
||||||
Get the name servers of a zone
|
|
||||||
"""
|
|
||||||
ret = []
|
|
||||||
- soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=@))" % zoneName, None)
|
|
||||||
+ if self.pdns:
|
|
||||||
+ soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(associateddomain=%s))" % zoneName, None)
|
|
||||||
+ else:
|
|
||||||
+ soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=@))" % zoneName, None)
|
|
||||||
if soa:
|
|
||||||
soaDN = soa[0][0]
|
|
||||||
ret = soa[0][1]["nSRecord"]
|
|
||||||
@@ -377,7 +460,10 @@
|
|
||||||
Get the MX servers of a zone
|
|
||||||
"""
|
|
||||||
ret = []
|
|
||||||
- soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=@))" % zoneName, None)
|
|
||||||
+ if self.pdns:
|
|
||||||
+ soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(associateddomain=%s))" % zoneName, None)
|
|
||||||
+ else:
|
|
||||||
+ soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=@))" % zoneName, None)
|
|
||||||
if soa:
|
|
||||||
soaDN = soa[0][0]
|
|
||||||
try:
|
|
||||||
@@ -395,7 +481,11 @@
|
|
||||||
elements.reverse()
|
|
||||||
while elements:
|
|
||||||
rev = ".".join(elements) + self.reversePrefix
|
|
||||||
- ret = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s))" % rev, None)
|
|
||||||
+ if self.pdns:
|
|
||||||
+ ret = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(associateddomain=*.%s)" % rev, None)
|
|
||||||
+ else:
|
|
||||||
+ ret = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s))" % rev, None)
|
|
||||||
+
|
|
||||||
if ret:
|
|
||||||
elements.reverse()
|
|
||||||
# Return the reverse zone name and how the IPs are beginning in this zone
|
|
||||||
@@ -434,7 +524,7 @@
|
|
||||||
ret = []
|
|
||||||
oldaliases = []
|
|
||||||
for record in self.getCNAMEs(zone, host):
|
|
||||||
- oldalias = record[1]["relativeDomainName"][0]
|
|
||||||
+ oldalias = record[1][self.relativeDomainNameField][0]
|
|
||||||
oldaliases.append(oldalias)
|
|
||||||
if oldalias not in aliases:
|
|
||||||
# Delete alias
|
|
||||||
@@ -470,15 +560,25 @@
|
|
||||||
raise "%s in not a A record" % cname
|
|
||||||
except IndexError:
|
|
||||||
raise "'%s' A record does not exist in the DNS zone" % cname
|
|
||||||
- # Add the CNAME record
|
|
||||||
- dn = "relativeDomainName=" + alias + "," + "ou=" + zone + "," + "ou=" + zone + "," + self.configDns.dnsDN
|
|
||||||
- entry = {
|
|
||||||
- "relativeDomainName" : alias,
|
|
||||||
- "objectClass" : ["top", "dNSZone"],
|
|
||||||
- "zoneName" : zone,
|
|
||||||
- "dNSClass" : dnsClass,
|
|
||||||
- "CNAMERecord" : cname,
|
|
||||||
- }
|
|
||||||
+
|
|
||||||
+ if self.pdns:
|
|
||||||
+ dn = "dc=" + alias + "," +"dc=" + zone + "," + self.configDns.dnsDN
|
|
||||||
+ entry = {
|
|
||||||
+ "associateddomain" : alias + "." + zone,
|
|
||||||
+ "objectClass" : ["top", "domainrelatedobject", "dnsdomain2"],
|
|
||||||
+ "dc" : alias,
|
|
||||||
+ "cnamerecord" : cname + "." + zone,
|
|
||||||
+ }
|
|
||||||
+ else:
|
|
||||||
+ # Add the CNAME record
|
|
||||||
+ dn = "relativeDomainName=" + alias + "," + "ou=" + zone + "," + "ou=" + zone + "," + self.configDns.dnsDN
|
|
||||||
+ entry = {
|
|
||||||
+ "relativeDomainName" : alias,
|
|
||||||
+ "objectClass" : ["top", "dNSZone"],
|
|
||||||
+ "zoneName" : zone,
|
|
||||||
+ "dNSClass" : dnsClass,
|
|
||||||
+ "CNAMERecord" : cname,
|
|
||||||
+ }
|
|
||||||
attributes=[ (k,v) for k,v in entry.items() ]
|
|
||||||
self.l.add_s(dn, attributes)
|
|
||||||
self.updateZoneSerial(zone)
|
|
||||||
@@ -491,15 +591,24 @@
|
|
||||||
@rtype: int
|
|
||||||
"""
|
|
||||||
ret = 1
|
|
||||||
- if not container: container = zone
|
|
||||||
- dn = "relativeDomainName=" + hostname + "," + "ou=" + zone + "," + "ou=" + container + "," + self.configDns.dnsDN
|
|
||||||
- entry = {
|
|
||||||
- "relativeDomainName" : hostname,
|
|
||||||
- "objectClass" : ["top", "dNSZone"],
|
|
||||||
- "zoneName" : zone,
|
|
||||||
- "dNSClass" : dnsClass,
|
|
||||||
- "aRecord" : ip,
|
|
||||||
- }
|
|
||||||
+ if self.pdns:
|
|
||||||
+ dn = "dc=" + hostname + "," +"dc=" + zone + "," + self.configDns.dnsDN
|
|
||||||
+ entry = {
|
|
||||||
+ "associateddomain" : hostname + "." + zone,
|
|
||||||
+ "objectClass" : ["top", "domainrelatedobject", "dnsdomain2"],
|
|
||||||
+ "dc" : hostname,
|
|
||||||
+ "aRecord" : ip,
|
|
||||||
+ }
|
|
||||||
+ else:
|
|
||||||
+ if not container: container = zone
|
|
||||||
+ dn = "relativeDomainName=" + hostname + "," + "ou=" + zone + "," + "ou=" + container + "," + self.configDns.dnsDN
|
|
||||||
+ entry = {
|
|
||||||
+ "relativeDomainName" : hostname,
|
|
||||||
+ "objectClass" : ["top", "dNSZone"],
|
|
||||||
+ "zoneName" : zone,
|
|
||||||
+ "dNSClass" : dnsClass,
|
|
||||||
+ "aRecord" : ip,
|
|
||||||
+ }
|
|
||||||
attributes=[ (k,v) for k,v in entry.items() ]
|
|
||||||
self.l.add_s(dn, attributes)
|
|
||||||
self.updateZoneSerial(zone)
|
|
||||||
@@ -518,14 +627,23 @@
|
|
||||||
elements.reverse()
|
|
||||||
elements.pop() # Remove the last "."
|
|
||||||
relative = ".".join(elements)
|
|
||||||
- dn = "relativeDomainName=" + relative + "," + "ou=" + revZone + "," + "ou=" + container + "," + self.configDns.dnsDN
|
|
||||||
- entry = {
|
|
||||||
- "relativeDomainName" : relative,
|
|
||||||
- "objectClass" : ["top", "dNSZone"],
|
|
||||||
- "zoneName" : revZone,
|
|
||||||
- "dNSClass" : dnsClass,
|
|
||||||
- "pTRRecord" : hostname + "." + zone + ".",
|
|
||||||
- }
|
|
||||||
+ if self.pdns:
|
|
||||||
+ dn = "dc=" + relative + "," + "dc=" + revZone + "," + self.configDns.dnsDN
|
|
||||||
+ entry = {
|
|
||||||
+ "dc" : relative,
|
|
||||||
+ "objectClass" : ["top", "domainrelatedobject", "dnsdomain2"],
|
|
||||||
+ "associatedDomain" : relative + "." + revZone,
|
|
||||||
+ "pTRRecord" : hostname + "." + zone,
|
|
||||||
+ }
|
|
||||||
+ else:
|
|
||||||
+ dn = "relativeDomainName=" + relative + "," + "ou=" + revZone + "," + "ou=" + container + "," + self.configDns.dnsDN
|
|
||||||
+ entry = {
|
|
||||||
+ "relativeDomainName" : relative,
|
|
||||||
+ "objectClass" : ["top", "dNSZone"],
|
|
||||||
+ "zoneName" : revZone,
|
|
||||||
+ "dNSClass" : dnsClass,
|
|
||||||
+ "pTRRecord" : hostname + "." + zone + ".",
|
|
||||||
+ }
|
|
||||||
attributes=[ (k,v) for k,v in entry.items() ]
|
|
||||||
self.l.add_s(dn, attributes)
|
|
||||||
self.updateZoneSerial(revZone)
|
|
||||||
@@ -536,7 +654,12 @@
|
|
||||||
"""
|
|
||||||
Get all CNAME records that points to the given hostname
|
|
||||||
"""
|
|
||||||
- return self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(cNAMERecord=%s))" % (zone, hostname), None)
|
|
||||||
+ if hostname.endswith("."+zone): fqdn = hostname
|
|
||||||
+ else: fqdn = hostname + "." + zone
|
|
||||||
+ if self.pdns:
|
|
||||||
+ return self.l.search_s("dc=" + zone + "," + self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(cNAMERecord=%s))" % (fqdn), None)
|
|
||||||
+ else:
|
|
||||||
+ return self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(cNAMERecord=%s))" % (zone, hostname), None)
|
|
||||||
|
|
||||||
def delCNAMEs(self, zone, hostname):
|
|
||||||
"""
|
|
||||||
@@ -553,7 +676,12 @@
|
|
||||||
If the RR is a A record where CNAME are linked in, the CNAME records
|
|
||||||
are also removed.
|
|
||||||
"""
|
|
||||||
- host = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=%s))" % (zone, hostname), None)
|
|
||||||
+ if hostname.endswith("."+zone): fqdn = hostname
|
|
||||||
+ else: fqdn = hostname + "." + zone
|
|
||||||
+ if self.pdns:
|
|
||||||
+ host = self.l.search_s("dc=" + zone + "," + self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(associatedDomain=%s))" %fqdn, None)
|
|
||||||
+ else:
|
|
||||||
+ host = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=%s))" % (zone, hostname), None)
|
|
||||||
if host:
|
|
||||||
# If the deleted resource is a type A record, the aliases must be
|
|
||||||
# removed if they exist
|
|
||||||
@@ -564,7 +692,10 @@
|
|
||||||
# Also remove reverse entry
|
|
||||||
revzones = self.getReverseZone(zone)
|
|
||||||
for revzone in revzones:
|
|
||||||
- revhost = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(pTRRecord=%s))" % (revzone, hostname + "." + zone + "."), None)
|
|
||||||
+ if self.pdns:
|
|
||||||
+ revhost = self.l.search_s("dc=" + revzone + "," +self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(pTRRecord=%s))" %fqdn, None)
|
|
||||||
+ else:
|
|
||||||
+ revhost = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(pTRRecord=%s))" % (revzone, hostname + "." + zone + "."), None)
|
|
||||||
if revhost:
|
|
||||||
self.l.delete_s(revhost[0][0])
|
|
||||||
self.updateZoneSerial(revzone)
|
|
||||||
@@ -608,14 +739,22 @@
|
|
||||||
This method is useful to know if we can record a machine in a zone
|
|
||||||
without duplicate.
|
|
||||||
"""
|
|
||||||
- search = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=%s))" % (zone, hostname), None)
|
|
||||||
+ if hostname.endswith("."+zone): fqdn = hostname
|
|
||||||
+ else: fqdn = hostname + "." + zone
|
|
||||||
+ if self.pdns:
|
|
||||||
+ search = self.l.search_s("dc=" + zone + "," + self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(associatedDomain=%s))" % (fqdn), None)
|
|
||||||
+ else:
|
|
||||||
+ search = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=%s))" % (zone, hostname), None)
|
|
||||||
if search: return True
|
|
||||||
revZone = self.getReverseZone(zone)
|
|
||||||
if revZone:
|
|
||||||
# Search host in the reverse zone
|
|
||||||
revZone = revZone[0]
|
|
||||||
- fqdn = hostname + "." + zone + "."
|
|
||||||
- search = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(pTRRecord=%s))" % (revZone, fqdn), None)
|
|
||||||
+ if self.pdns:
|
|
||||||
+ search = self.l.search_s("dc=" + revZone + "," + self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(dc=%s))" % (fqdn), None)
|
|
||||||
+ else:
|
|
||||||
+ fqdn = fqdn + "."
|
|
||||||
+ search = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(pTRRecord=%s))" % (revZone, fqdn), None)
|
|
||||||
return len(search) > 0
|
|
||||||
return False
|
|
||||||
|
|
||||||
@@ -628,7 +767,10 @@
|
|
||||||
This method is useful to know if we can record a machine in a zone
|
|
||||||
without duplicate.
|
|
||||||
"""
|
|
||||||
- search = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(aRecord=%s))" % (zone, ip), None)
|
|
||||||
+ if self.pdns:
|
|
||||||
+ search = self.l.search_s("dc=" + zone + "," + self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(aRecord=%s))" %ip, None)
|
|
||||||
+ else:
|
|
||||||
+ search = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(aRecord=%s))" % (zone, ip), None)
|
|
||||||
if search: return True
|
|
||||||
revZone = self.getReverseZone(zone)
|
|
||||||
if revZone:
|
|
||||||
@@ -640,7 +782,10 @@
|
|
||||||
elements.reverse()
|
|
||||||
elements.pop() # Remove the last "."
|
|
||||||
relative = ".".join(elements)
|
|
||||||
- search = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=%s))" % (revZone, relative), None)
|
|
||||||
+ if self.pdns:
|
|
||||||
+ search = self.l.search_s("dc=" + revZone + "," + self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(associatedDomain=%s))" %relative, None)
|
|
||||||
+ else:
|
|
||||||
+ search = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=%s))" % (revZone, relative), None)
|
|
||||||
return len(search) > 0
|
|
||||||
return False
|
|
||||||
|
|
||||||
@@ -652,7 +797,12 @@
|
|
||||||
@rtype: str
|
|
||||||
"""
|
|
||||||
ret = ""
|
|
||||||
- search = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=%s))" % (zone, hostname), None)
|
|
||||||
+ if hostname.endswith("."+zone): fqdn = hostname
|
|
||||||
+ else: fqdn = hostname + "." + zone
|
|
||||||
+ if self.pdns:
|
|
||||||
+ search = self.l.search_s("dc=" + zone + "," + self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(associatedDomain=%s))" %fqdn, None)
|
|
||||||
+ else:
|
|
||||||
+ search = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=%s))" % (zone, hostname), None)
|
|
||||||
if search:
|
|
||||||
try:
|
|
||||||
ret = search[0][1]["aRecord"][0]
|
|
||||||
@@ -697,7 +847,12 @@
|
|
||||||
@return: a domain name resource record (RR)
|
|
||||||
@rtype: dict
|
|
||||||
"""
|
|
||||||
- return self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=%s))" % (zone, rr), None)
|
|
||||||
+ if self.pdns:
|
|
||||||
+ if rr.endswith(zone):
|
|
||||||
+ rr, tmp = rr.split(".")
|
|
||||||
+ return self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(associatedDomain=%s.%s))" % (rr, zone), None)
|
|
||||||
+ else:
|
|
||||||
+ return self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=%s))" % (zone, rr), None)
|
|
||||||
|
|
||||||
|
|
||||||
class DnsService(ServiceManager):
|
|
@ -1,787 +0,0 @@
|
|||||||
Submitted By: Mario Fetka (mario dot fetka at gmail dot com)
|
|
||||||
Date: 2009-07-04
|
|
||||||
Initial Package Version: 2.3.2
|
|
||||||
Origin: http://mds.mandriva.org/ticket/244
|
|
||||||
Upstream Status: accepted
|
|
||||||
Description: add PowerDNS support to mmc (patch update to version 2)
|
|
||||||
|
|
||||||
diff -Naur mmc-agent-2.3.2.orig/conf/plugins/network.ini mmc-agent-2.3.2/conf/plugins/network.ini
|
|
||||||
--- mmc-agent-2.3.2.orig/conf/plugins/network.ini 2008-05-16 07:39:44.000000000 +0000
|
|
||||||
+++ mmc-agent-2.3.2/conf/plugins/network.ini 2009-07-04 05:27:02.904709479 +0000
|
|
||||||
@@ -9,6 +9,10 @@
|
|
||||||
leases = /var/lib/dhcp3/dhcpd.leases
|
|
||||||
|
|
||||||
[dns]
|
|
||||||
+# DNS Server Type : (default: bind)
|
|
||||||
+# - bind (ISC Bind)
|
|
||||||
+# - pdns (PowerDNS)
|
|
||||||
+# type = bind
|
|
||||||
dn = ou=DNS,dc=mandriva,dc=com
|
|
||||||
pidfile = /var/run/bind/run/named.pid
|
|
||||||
init = /etc/init.d/bind9
|
|
||||||
diff -Naur mmc-agent-2.3.2.orig/mmc/plugins/network/__init__.py mmc-agent-2.3.2/mmc/plugins/network/__init__.py
|
|
||||||
--- mmc-agent-2.3.2.orig/mmc/plugins/network/__init__.py 2008-12-15 14:20:35.000000000 +0000
|
|
||||||
+++ mmc-agent-2.3.2/mmc/plugins/network/__init__.py 2009-07-04 05:26:28.518150676 +0000
|
|
||||||
@@ -71,13 +71,27 @@
|
|
||||||
return False
|
|
||||||
|
|
||||||
# Test if the DNS/LDAP schema is available in the directory
|
|
||||||
- try:
|
|
||||||
- schema = ldapObj.getSchema("dNSZone")
|
|
||||||
- if len(schema) <= 0:
|
|
||||||
- logger.error("DNS zone schema is not included in LDAP directory");
|
|
||||||
+ serverType = config.dnsType
|
|
||||||
+ if serverType == "pdns":
|
|
||||||
+ try:
|
|
||||||
+ schema = ldapObj.getSchema("dNSDomain2")
|
|
||||||
+ if len(schema) <= 0:
|
|
||||||
+ logger.error("DNS zone schema (dnsdomain2.schema) is not included in LDAP directory");
|
|
||||||
+ return False
|
|
||||||
+ except:
|
|
||||||
+ logger.exception("invalid DNS schema")
|
|
||||||
+ return False
|
|
||||||
+ elif serverType == "bind":
|
|
||||||
+ try:
|
|
||||||
+ schema = ldapObj.getSchema("dNSZone")
|
|
||||||
+ if len(schema) <= 0:
|
|
||||||
+ logger.error("DNS zone schema (dnszone.schema) is not included in LDAP directory");
|
|
||||||
+ return False
|
|
||||||
+ except:
|
|
||||||
+ logger.exception("invalid DNS schema")
|
|
||||||
return False
|
|
||||||
- except:
|
|
||||||
- logger.exception("invalid schema")
|
|
||||||
+ else:
|
|
||||||
+ logger.error("%s : Unknown DNS server."%serverType);
|
|
||||||
return False
|
|
||||||
|
|
||||||
# Create required OUs
|
|
||||||
@@ -108,26 +122,27 @@
|
|
||||||
pass
|
|
||||||
|
|
||||||
# Create DNS config base structure
|
|
||||||
- try:
|
|
||||||
- gidNumber = grp.getgrnam(config.bindGroup)
|
|
||||||
- except KeyError:
|
|
||||||
- logger.error('The group "%s" does not exist.' % config.bindGroup)
|
|
||||||
- return False
|
|
||||||
- gidNumber = gidNumber[2]
|
|
||||||
+ if serverType == "bind":
|
|
||||||
+ try:
|
|
||||||
+ gidNumber = grp.getgrnam(config.bindGroup)
|
|
||||||
+ except KeyError:
|
|
||||||
+ logger.error('The group "%s" does not exist.' % config.bindGroup)
|
|
||||||
+ return False
|
|
||||||
+ gidNumber = gidNumber[2]
|
|
||||||
|
|
||||||
- try:
|
|
||||||
- os.mkdir(config.bindLdapDir)
|
|
||||||
- os.chmod(config.bindLdapDir, 02750)
|
|
||||||
- os.chown(config.bindLdapDir, -1, gidNumber)
|
|
||||||
- except OSError, e:
|
|
||||||
- # errno = 17 is "File exists"
|
|
||||||
- if e.errno != 17: raise
|
|
||||||
-
|
|
||||||
- if not os.path.exists(config.bindLdap):
|
|
||||||
- f = open(config.bindLdap, "w")
|
|
||||||
- f.close()
|
|
||||||
- os.chmod(config.bindLdap, 0640)
|
|
||||||
- os.chown(config.bindLdap, -1, gidNumber)
|
|
||||||
+ try:
|
|
||||||
+ os.mkdir(config.bindLdapDir)
|
|
||||||
+ os.chmod(config.bindLdapDir, 02750)
|
|
||||||
+ os.chown(config.bindLdapDir, -1, gidNumber)
|
|
||||||
+ except OSError, e:
|
|
||||||
+ # errno = 17 is "File exists"
|
|
||||||
+ if e.errno != 17: raise
|
|
||||||
+
|
|
||||||
+ if not os.path.exists(config.bindLdap):
|
|
||||||
+ f = open(config.bindLdap, "w")
|
|
||||||
+ f.close()
|
|
||||||
+ os.chmod(config.bindLdap, 0640)
|
|
||||||
+ os.chown(config.bindLdap, -1, gidNumber)
|
|
||||||
|
|
||||||
return True
|
|
||||||
|
|
||||||
@@ -344,6 +359,10 @@
|
|
||||||
self.dhcpLogFile = self.get("dhcp", "logfile")
|
|
||||||
self.dhcpLeases = self.get("dhcp", "leases")
|
|
||||||
# DNS conf
|
|
||||||
+ try:
|
|
||||||
+ self.dnsType = self.get("dns", "type")
|
|
||||||
+ except NoOptionError:
|
|
||||||
+ self.dnsType = "bind"
|
|
||||||
self.dnsDN = self.getdn("dns", "dn")
|
|
||||||
self.dnsPidFile = self.get("dns", "pidfile")
|
|
||||||
self.dnsInit = self.get("dns", "init")
|
|
||||||
diff -Naur mmc-agent-2.3.2.orig/mmc/plugins/network/dns.py mmc-agent-2.3.2/mmc/plugins/network/dns.py
|
|
||||||
--- mmc-agent-2.3.2.orig/mmc/plugins/network/dns.py 2008-12-10 15:18:18.000000000 +0000
|
|
||||||
+++ mmc-agent-2.3.2/mmc/plugins/network/dns.py 2009-07-04 05:26:28.518150676 +0000
|
|
||||||
@@ -41,6 +41,15 @@
|
|
||||||
self.configDns.dnsReader = self.config.get("ldap", "rootName")
|
|
||||||
if not self.configDns.dnsReaderPassword:
|
|
||||||
self.configDns.dnsReaderPassword = self.config.get("ldap", "password")
|
|
||||||
+ if self.configDns.dnsType == "pdns":
|
|
||||||
+ self.pdns = True
|
|
||||||
+ self.zoneNameField = "associatedDomain"
|
|
||||||
+ self.relativeDomainNameField = "associatedDomain"
|
|
||||||
+ else:
|
|
||||||
+ self.pdns = False
|
|
||||||
+ self.zoneNameField = "zoneName"
|
|
||||||
+ self.relativeDomainNameField = "relativeDomainName"
|
|
||||||
+
|
|
||||||
self.reverseMarkup = "Reverse:"
|
|
||||||
self.reversePrefix = ".in-addr.arpa"
|
|
||||||
self.templateZone = """
|
|
||||||
@@ -77,7 +86,7 @@
|
|
||||||
"""
|
|
||||||
ret = []
|
|
||||||
for result in self.getZones(self.reversePrefix, True):
|
|
||||||
- ret.append(self.translateReverse(result[1]["zoneName"][0]))
|
|
||||||
+ ret.append(self.translateReverse(result[1][self.zoneNameField][0]))
|
|
||||||
return ret
|
|
||||||
|
|
||||||
def getReverseZone(self, name):
|
|
||||||
@@ -85,9 +94,17 @@
|
|
||||||
Return the name of the reverse zone of a zone
|
|
||||||
"""
|
|
||||||
ret = []
|
|
||||||
- for result in self.getZones(reverse = True, base = "ou=" + name + "," + self.configDns.dnsDN):
|
|
||||||
- zoneName = result[1]["zoneName"][0]
|
|
||||||
- if zoneName.endswith(self.reversePrefix): ret.append(zoneName)
|
|
||||||
+ if self.pdns:
|
|
||||||
+ tmpZones = self.getZones(reverse = True, base = self.configDns.dnsDN)
|
|
||||||
+ for result in tmpZones:
|
|
||||||
+ zoneName = result[1][self.zoneNameField][0]
|
|
||||||
+ nsRecord = result[1]["nSRecord"][0]
|
|
||||||
+ if zoneName.endswith(self.reversePrefix) and nsRecord.endswith(".%s"%name): ret.append(zoneName)
|
|
||||||
+ else:
|
|
||||||
+ tmpZones = self.getZones(reverse = True, base = "ou=" + name + "," + self.configDns.dnsDN)
|
|
||||||
+ for result in tmpZones:
|
|
||||||
+ zoneName = result[1][self.zoneNameField][0]
|
|
||||||
+ if zoneName.endswith(self.reversePrefix): ret.append(zoneName)
|
|
||||||
return ret
|
|
||||||
|
|
||||||
def getZoneObjects(self, name, filt = None):
|
|
||||||
@@ -98,10 +115,13 @@
|
|
||||||
filt = "*" + filt.strip() + "*"
|
|
||||||
else:
|
|
||||||
filt = "*"
|
|
||||||
- search = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=%s))" % (name, filt), None)
|
|
||||||
+ if self.pdns:
|
|
||||||
+ search = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(associatedDomain=%s.%s))" % (filt, name), None)
|
|
||||||
+ else:
|
|
||||||
+ search = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=%s))" % (name, filt), None)
|
|
||||||
ret = []
|
|
||||||
for result in search:
|
|
||||||
- relative = result[1]["relativeDomainName"][0]
|
|
||||||
+ relative = result[1][self.relativeDomainNameField][0]
|
|
||||||
# Don't count these entries
|
|
||||||
if relative != "@" and relative != name + ".":
|
|
||||||
ret.append(result)
|
|
||||||
@@ -111,17 +131,24 @@
|
|
||||||
"""
|
|
||||||
Return the number of objects defined in a zone
|
|
||||||
"""
|
|
||||||
- search = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s))" % (name), ["relativeDomainName"])
|
|
||||||
count = 0
|
|
||||||
+ if self.pdns:
|
|
||||||
+ search = self.l.search_s("dc=" + name + "," + self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(associatedDomain=*.%s))" % (name), ["associatedDomain"])
|
|
||||||
+ else:
|
|
||||||
+ search = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s))" % (name), ["relativeDomainName"])
|
|
||||||
+
|
|
||||||
for result in search:
|
|
||||||
- relative = result[1]["relativeDomainName"][0]
|
|
||||||
+ relative = result[1][self.relativeDomainNameField][0]
|
|
||||||
# Don't count these entries
|
|
||||||
if relative != "@" and relative != name + ".":
|
|
||||||
count = count + 1
|
|
||||||
return count
|
|
||||||
|
|
||||||
def getZone(self, zoneName):
|
|
||||||
- return self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=%s))" % (zoneName, zoneName + "."), None)
|
|
||||||
+ if self.pdns:
|
|
||||||
+ return self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(associatedDomain=%s))" % (zoneName), None)
|
|
||||||
+ else:
|
|
||||||
+ return self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=%s))" % (zoneName, zoneName + "."), None)
|
|
||||||
|
|
||||||
def getZones(self, filt = "", reverse = False, base = None):
|
|
||||||
"""
|
|
||||||
@@ -131,14 +158,23 @@
|
|
||||||
if not filt: filt = "*"
|
|
||||||
else: filt = "*" + filt + "*"
|
|
||||||
if not base: base = self.configDns.dnsDN
|
|
||||||
- search = self.l.search_s(base, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=%s))" % (filt, filt), None)
|
|
||||||
ret = []
|
|
||||||
- for result in search:
|
|
||||||
- if (result[1]["zoneName"][0] + ".") == result[1]["relativeDomainName"][0]:
|
|
||||||
- if self.reversePrefix in result[1]["zoneName"][0]:
|
|
||||||
+ if self.configDns.dnsType == "pdns":
|
|
||||||
+ search = self.l.search_s(base, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(soarecord=*)(associatedDomain=%s))" %filt, None)
|
|
||||||
+ for result in search:
|
|
||||||
+ if self.reversePrefix in result[1][self.zoneNameField][0]:
|
|
||||||
# Reverse zone
|
|
||||||
if reverse: ret.append(result)
|
|
||||||
else: ret.append(result)
|
|
||||||
+
|
|
||||||
+ else:
|
|
||||||
+ search = self.l.search_s(base, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=%s))" % (filt, filt), None)
|
|
||||||
+ for result in search:
|
|
||||||
+ if (result[1]["zoneName"][0] + ".") == result[1]["relativeDomainName"][0]:
|
|
||||||
+ if self.reversePrefix in result[1][self.zoneNameField][0]:
|
|
||||||
+ # Reverse zone
|
|
||||||
+ if reverse: ret.append(result)
|
|
||||||
+ else: ret.append(result)
|
|
||||||
return ret
|
|
||||||
|
|
||||||
def zoneExists(self, zone):
|
|
||||||
@@ -168,32 +204,34 @@
|
|
||||||
else:
|
|
||||||
raise "Won't create reverse zone as asked, netmask is not 8, 16 or 24"
|
|
||||||
|
|
||||||
- f = open(os.path.join(self.configDns.bindLdapDir, name), "w")
|
|
||||||
- d = {
|
|
||||||
- "zone" : name,
|
|
||||||
- "ldapurl" : self.ldapHost + "/" + self.configDns.dnsDN,
|
|
||||||
- "dnsreader": urllib.quote(self.configDns.dnsReader),
|
|
||||||
- "dnsreaderpasswd" : urllib.quote(self.configDns.dnsReaderPassword)
|
|
||||||
- }
|
|
||||||
- f.write(self.templateZone % d)
|
|
||||||
- if reverse:
|
|
||||||
- d["zone"] = self.reverseZone(network)
|
|
||||||
+ if not self.pdns:
|
|
||||||
+ # Create Bind configuration files
|
|
||||||
+ f = open(os.path.join(self.configDns.bindLdapDir, name), "w")
|
|
||||||
+ d = {
|
|
||||||
+ "zone" : name,
|
|
||||||
+ "ldapurl" : self.ldapHost + "/" + self.configDns.dnsDN,
|
|
||||||
+ "dnsreader": urllib.quote(self.configDns.dnsReader),
|
|
||||||
+ "dnsreaderpasswd" : urllib.quote(self.configDns.dnsReaderPassword)
|
|
||||||
+ }
|
|
||||||
f.write(self.templateZone % d)
|
|
||||||
- f.close()
|
|
||||||
- os.chmod(os.path.join(self.configDns.bindLdapDir, name), 0640)
|
|
||||||
+ if reverse:
|
|
||||||
+ d["zone"] = self.reverseZone(network)
|
|
||||||
+ f.write(self.templateZone % d)
|
|
||||||
+ f.close()
|
|
||||||
+ os.chmod(os.path.join(self.configDns.bindLdapDir, name), 0640)
|
|
||||||
|
|
||||||
- f = open(self.configDns.bindLdap, "r")
|
|
||||||
- found = False
|
|
||||||
- toadd = 'include "' + os.path.join(self.configDns.bindLdapChrootConfPath, name) + '";\n'
|
|
||||||
- for line in f:
|
|
||||||
- if line == toadd:
|
|
||||||
- found = True
|
|
||||||
- break
|
|
||||||
- f.close()
|
|
||||||
- if not found:
|
|
||||||
- f = open(self.configDns.bindLdap, "a")
|
|
||||||
- f.write(toadd)
|
|
||||||
+ f = open(self.configDns.bindLdap, "r")
|
|
||||||
+ found = False
|
|
||||||
+ toadd = 'include "' + os.path.join(self.configDns.bindLdapChrootConfPath, name) + '";\n'
|
|
||||||
+ for line in f:
|
|
||||||
+ if line == toadd:
|
|
||||||
+ found = True
|
|
||||||
+ break
|
|
||||||
f.close()
|
|
||||||
+ if not found:
|
|
||||||
+ f = open(self.configDns.bindLdap, "a")
|
|
||||||
+ f.write(toadd)
|
|
||||||
+ f.close()
|
|
||||||
|
|
||||||
# Create the needed zones object in LDAP
|
|
||||||
if reverse:
|
|
||||||
@@ -205,10 +243,15 @@
|
|
||||||
|
|
||||||
# Fill SOA
|
|
||||||
self.addSOA(name)
|
|
||||||
- ns = nameserver + "." + name + "."
|
|
||||||
+ if self.pdns:
|
|
||||||
+ ns = nameserver + "." + name
|
|
||||||
+ mailaddr = "admin." + name
|
|
||||||
+ else:
|
|
||||||
+ ns = nameserver + "." + name + "."
|
|
||||||
+ mailaddr = "admin." + name + "."
|
|
||||||
rec = {
|
|
||||||
"nameserver" : ns,
|
|
||||||
- "emailaddr" : "admin." + name + ".",
|
|
||||||
+ "emailaddr" : mailaddr,
|
|
||||||
"serial" : self.computeSerial(),
|
|
||||||
"refresh" : "2D",
|
|
||||||
"retry" : "15M",
|
|
||||||
@@ -234,18 +277,26 @@
|
|
||||||
|
|
||||||
@param name: the zone name to delete
|
|
||||||
"""
|
|
||||||
- self.delRecursiveEntry("ou=" + zone + "," + self.configDns.dnsDN)
|
|
||||||
- os.unlink(os.path.join(self.configDns.bindLdapDir, zone))
|
|
||||||
- newcontent = []
|
|
||||||
- f = open(self.configDns.bindLdap, "r")
|
|
||||||
- for line in f:
|
|
||||||
- if not "/" + zone + '";' in line:
|
|
||||||
- newcontent.append(line)
|
|
||||||
- f.close()
|
|
||||||
- f = open(self.configDns.bindLdap, "w+")
|
|
||||||
- for line in newcontent:
|
|
||||||
- f.write(line)
|
|
||||||
- f.close()
|
|
||||||
+ if self.pdns:
|
|
||||||
+ zoneDN = "dc=" + zone + "," + self.configDns.dnsDN
|
|
||||||
+ self.delRecursiveEntry(zoneDN)
|
|
||||||
+ reverseDN = self.getReverseZone(zone)
|
|
||||||
+ if reverseDN[0]:
|
|
||||||
+ self.delRecursiveEntry("dc=" + reverseDN[0] + "," + self.configDns.dnsDN)
|
|
||||||
+ else:
|
|
||||||
+ zoneDN = "ou=" + zone + "," + self.configDns.dnsDN
|
|
||||||
+ self.delRecursiveEntry(zoneDN)
|
|
||||||
+ os.unlink(os.path.join(self.configDns.bindLdapDir, zone))
|
|
||||||
+ newcontent = []
|
|
||||||
+ f = open(self.configDns.bindLdap, "r")
|
|
||||||
+ for line in f:
|
|
||||||
+ if not "/" + zone + '";' in line:
|
|
||||||
+ newcontent.append(line)
|
|
||||||
+ f.close()
|
|
||||||
+ f = open(self.configDns.bindLdap, "w+")
|
|
||||||
+ for line in newcontent:
|
|
||||||
+ f.write(line)
|
|
||||||
+ f.close()
|
|
||||||
|
|
||||||
def addDnsZone(self, zoneName, description = None, container = None):
|
|
||||||
"""
|
|
||||||
@@ -253,40 +304,55 @@
|
|
||||||
"""
|
|
||||||
if not container: container = zoneName
|
|
||||||
# Create the container of this zone and its reverses if it does not exist
|
|
||||||
- try:
|
|
||||||
- self.addOu(container, self.configDns.dnsDN)
|
|
||||||
- except ldap.ALREADY_EXISTS:
|
|
||||||
- pass
|
|
||||||
- # Create the ou defining this zone and that will contain all records
|
|
||||||
- self.addOu(zoneName, "ou=" + container + "," + self.configDns.dnsDN)
|
|
||||||
- dn = "zoneName=" + zoneName + "," + "ou=" + zoneName + "," + "ou=" + container + "," + self.configDns.dnsDN
|
|
||||||
- entry = {
|
|
||||||
- "zoneName" : zoneName,
|
|
||||||
- "objectClass" : ["top", "dNSZone"],
|
|
||||||
- "relativeDomainName" : zoneName + ".",
|
|
||||||
- }
|
|
||||||
- if description: entry["tXTRecord"] = [description]
|
|
||||||
+ if self.pdns:
|
|
||||||
+ dn = "dc=" + zoneName + "," + self.configDns.dnsDN
|
|
||||||
+ entry = {
|
|
||||||
+ "associateddomain" : zoneName,
|
|
||||||
+ "objectClass" : ["top", "domainrelatedobject", "dnsdomain2", "dcobject"],
|
|
||||||
+ "dc" : zoneName,
|
|
||||||
+ }
|
|
||||||
+ if description: entry["tXTRecord"] = [description]
|
|
||||||
+ else:
|
|
||||||
+ try:
|
|
||||||
+ self.addOu(container, self.configDns.dnsDN)
|
|
||||||
+ except ldap.ALREADY_EXISTS:
|
|
||||||
+ pass
|
|
||||||
+ # Create the ou defining this zone and that will contain all records
|
|
||||||
+ self.addOu(zoneName, "ou=" + container + "," + self.configDns.dnsDN)
|
|
||||||
+ dn = "zoneName=" + zoneName + "," + "ou=" + zoneName + "," + "ou=" + container + "," + self.configDns.dnsDN
|
|
||||||
+ entry = {
|
|
||||||
+ "zoneName" : zoneName,
|
|
||||||
+ "objectClass" : ["top", "dNSZone"],
|
|
||||||
+ "relativeDomainName" : zoneName + ".",
|
|
||||||
+ }
|
|
||||||
+ if description: entry["tXTRecord"] = [description]
|
|
||||||
attributes = [ (k,v) for k,v in entry.items() ]
|
|
||||||
self.l.add_s(dn, attributes)
|
|
||||||
|
|
||||||
def addSOA(self, zoneName, container = None, dnsClass = "IN"):
|
|
||||||
if not container: container = zoneName
|
|
||||||
- dn = "relativeDomainName=@," + "ou=" + zoneName + "," + "ou=" + container + "," + self.configDns.dnsDN
|
|
||||||
- entry = {
|
|
||||||
- "zoneName" : zoneName,
|
|
||||||
- "objectClass" : ["top", "dNSZone"],
|
|
||||||
- "relativeDomainName" : "@",
|
|
||||||
- "dnsClass" : dnsClass
|
|
||||||
- }
|
|
||||||
- attributes=[ (k,v) for k,v in entry.items() ]
|
|
||||||
- self.l.add_s(dn, attributes)
|
|
||||||
+ if not self.pdns:
|
|
||||||
+ dn = "relativeDomainName=@," + "ou=" + zoneName + "," + "ou=" + container + "," + self.configDns.dnsDN
|
|
||||||
+ entry = {
|
|
||||||
+ "zoneName" : zoneName,
|
|
||||||
+ "objectClass" : ["top", "dNSZone"],
|
|
||||||
+ "relativeDomainName" : "@",
|
|
||||||
+ "dnsClass" : dnsClass
|
|
||||||
+ }
|
|
||||||
+ attributes=[ (k,v) for k,v in entry.items() ]
|
|
||||||
+ self.l.add_s(dn, attributes)
|
|
||||||
|
|
||||||
def setSOARecord(self, zoneName, record):
|
|
||||||
- soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=@))" % zoneName, None)
|
|
||||||
- if soa:
|
|
||||||
- soaDN = soa[0][0]
|
|
||||||
+ if self.pdns:
|
|
||||||
+ zoneDN = "dc=" + zoneName + "," + self.configDns.dnsDN
|
|
||||||
s = "%(nameserver)s %(emailaddr)s %(serial)s %(refresh)s %(retry)s %(expiry)s %(minimum)s" % record
|
|
||||||
- self.l.modify_s(soaDN, [(ldap.MOD_REPLACE, "sOARecord", [s])])
|
|
||||||
+ self.l.modify_s(zoneDN, [(ldap.MOD_REPLACE, "soarecord", [s])])
|
|
||||||
+ else:
|
|
||||||
+ soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=@))" % zoneName, None)
|
|
||||||
+ if soa:
|
|
||||||
+ soaDN = soa[0][0]
|
|
||||||
+ s = "%(nameserver)s %(emailaddr)s %(serial)s %(refresh)s %(retry)s %(expiry)s %(minimum)s" % record
|
|
||||||
+ self.l.modify_s(soaDN, [(ldap.MOD_REPLACE, "sOARecord", [s])])
|
|
||||||
|
|
||||||
def setSOANSRecord(self, zoneName, nameserver):
|
|
||||||
"""
|
|
||||||
@@ -294,10 +360,14 @@
|
|
||||||
It updates the SOARecord field and nsRecord field of the @ LDAP entry
|
|
||||||
of this given zone.
|
|
||||||
"""
|
|
||||||
- soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=@))" % zoneName, None)
|
|
||||||
- if soa:
|
|
||||||
- soaDN = soa[0][0]
|
|
||||||
- self.l.modify_s(soaDN, [(ldap.MOD_REPLACE, "nSRecord", [nameserver])])
|
|
||||||
+ if self.pdns:
|
|
||||||
+ zoneDN = "dc=" + zoneName + "," + self.configDns.dnsDN
|
|
||||||
+ self.l.modify_s(zoneDN, [(ldap.MOD_REPLACE, "nsrecord", [nameserver])])
|
|
||||||
+ else:
|
|
||||||
+ soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=@))" % zoneName, None)
|
|
||||||
+ if soa:
|
|
||||||
+ soaDN = soa[0][0]
|
|
||||||
+ self.l.modify_s(soaDN, [(ldap.MOD_REPLACE, "nSRecord", [nameserver])])
|
|
||||||
# Also sync SOA record if there is one
|
|
||||||
soaRecord = self.getSOARecord(zoneName)
|
|
||||||
if soaRecord:
|
|
||||||
@@ -311,22 +381,29 @@
|
|
||||||
The nsRecord corresponding to the name server containted into the
|
|
||||||
SOARecord field won't be deleted. Use the setSOANSRecord to update it.
|
|
||||||
"""
|
|
||||||
- soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=@))" % zoneName, None)
|
|
||||||
- if soa:
|
|
||||||
- soaDN = soa[0][0]
|
|
||||||
- soanameserver = soa[0][1]["sOARecord"][0].split()[0]
|
|
||||||
- # Assert that the name server contained into the SOA record won't
|
|
||||||
- # be deleted
|
|
||||||
- if soanameserver not in nameservers:
|
|
||||||
- nameservers.append(soanameserver)
|
|
||||||
- self.l.modify_s(soaDN, [(ldap.MOD_REPLACE, "nSRecord", nameservers)])
|
|
||||||
- self.updateZoneSerial(zoneName)
|
|
||||||
+ if self.pdns:
|
|
||||||
+ zoneDN = "dc=" + zoneName + "," + self.configDns.dnsDN
|
|
||||||
+ self.l.modify_s(zoneDN, [(ldap.MOD_REPLACE, "nsrecord", nameservers)])
|
|
||||||
+ else:
|
|
||||||
+ soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=@))" % zoneName, None)
|
|
||||||
+ if soa:
|
|
||||||
+ soaDN = soa[0][0]
|
|
||||||
+ soanameserver = soa[0][1]["sOARecord"][0].split()[0]
|
|
||||||
+ # Assert that the name server contained into the SOA record won't
|
|
||||||
+ # be deleted
|
|
||||||
+ if soanameserver not in nameservers:
|
|
||||||
+ nameservers.append(soanameserver)
|
|
||||||
+ self.l.modify_s(soaDN, [(ldap.MOD_REPLACE, "nSRecord", nameservers)])
|
|
||||||
+ self.updateZoneSerial(zoneName)
|
|
||||||
|
|
||||||
def setMXRecords(self, zoneName, mxservers):
|
|
||||||
"""
|
|
||||||
Update the mXRecord fields of the @ LDAP entry of the given zone.
|
|
||||||
"""
|
|
||||||
- soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=@))" % zoneName, None)
|
|
||||||
+ if self.pdns:
|
|
||||||
+ soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(associatedDomain=%s)(soarecord=*))" % zoneName, None)
|
|
||||||
+ else:
|
|
||||||
+ soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=@))" % zoneName, None)
|
|
||||||
if soa:
|
|
||||||
soaDN = soa[0][0]
|
|
||||||
self.l.modify_s(soaDN, [(ldap.MOD_REPLACE, "mXRecord", mxservers)])
|
|
||||||
@@ -353,7 +430,10 @@
|
|
||||||
@rtype: dict
|
|
||||||
"""
|
|
||||||
ret = {}
|
|
||||||
- soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=@))" % zoneName, ["soaRecord"])
|
|
||||||
+ if self.pdns:
|
|
||||||
+ soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(associatedDomain=%s))" % zoneName, ["soaRecord"])
|
|
||||||
+ else:
|
|
||||||
+ soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=@))" % zoneName, ["soaRecord"])
|
|
||||||
if soa:
|
|
||||||
try:
|
|
||||||
ret["nameserver"], ret["emailaddr"], ret["serial"], ret["refresh"], ret["retry"], ret["expiry"], ret["minimum"] = soa[0][1]["sOARecord"][0].split()
|
|
||||||
@@ -366,7 +446,10 @@
|
|
||||||
Get the name servers of a zone
|
|
||||||
"""
|
|
||||||
ret = []
|
|
||||||
- soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=@))" % zoneName, None)
|
|
||||||
+ if self.pdns:
|
|
||||||
+ soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(associateddomain=%s))" % zoneName, None)
|
|
||||||
+ else:
|
|
||||||
+ soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=@))" % zoneName, None)
|
|
||||||
if soa:
|
|
||||||
soaDN = soa[0][0]
|
|
||||||
ret = soa[0][1]["nSRecord"]
|
|
||||||
@@ -377,7 +460,10 @@
|
|
||||||
Get the MX servers of a zone
|
|
||||||
"""
|
|
||||||
ret = []
|
|
||||||
- soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=@))" % zoneName, None)
|
|
||||||
+ if self.pdns:
|
|
||||||
+ soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(associateddomain=%s))" % zoneName, None)
|
|
||||||
+ else:
|
|
||||||
+ soa = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=@))" % zoneName, None)
|
|
||||||
if soa:
|
|
||||||
soaDN = soa[0][0]
|
|
||||||
try:
|
|
||||||
@@ -395,7 +481,11 @@
|
|
||||||
elements.reverse()
|
|
||||||
while elements:
|
|
||||||
rev = ".".join(elements) + self.reversePrefix
|
|
||||||
- ret = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s))" % rev, None)
|
|
||||||
+ if self.pdns:
|
|
||||||
+ ret = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(associateddomain=*.%s)" % rev, None)
|
|
||||||
+ else:
|
|
||||||
+ ret = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s))" % rev, None)
|
|
||||||
+
|
|
||||||
if ret:
|
|
||||||
elements.reverse()
|
|
||||||
# Return the reverse zone name and how the IPs are beginning in this zone
|
|
||||||
@@ -434,7 +524,7 @@
|
|
||||||
ret = []
|
|
||||||
oldaliases = []
|
|
||||||
for record in self.getCNAMEs(zone, host):
|
|
||||||
- oldalias = record[1]["relativeDomainName"][0]
|
|
||||||
+ oldalias = record[1][self.relativeDomainNameField][0]
|
|
||||||
oldaliases.append(oldalias)
|
|
||||||
if oldalias not in aliases:
|
|
||||||
# Delete alias
|
|
||||||
@@ -470,15 +560,25 @@
|
|
||||||
raise "%s in not a A record" % cname
|
|
||||||
except IndexError:
|
|
||||||
raise "'%s' A record does not exist in the DNS zone" % cname
|
|
||||||
- # Add the CNAME record
|
|
||||||
- dn = "relativeDomainName=" + alias + "," + "ou=" + zone + "," + "ou=" + zone + "," + self.configDns.dnsDN
|
|
||||||
- entry = {
|
|
||||||
- "relativeDomainName" : alias,
|
|
||||||
- "objectClass" : ["top", "dNSZone"],
|
|
||||||
- "zoneName" : zone,
|
|
||||||
- "dNSClass" : dnsClass,
|
|
||||||
- "CNAMERecord" : cname,
|
|
||||||
- }
|
|
||||||
+
|
|
||||||
+ if self.pdns:
|
|
||||||
+ dn = "dc=" + alias + "," +"dc=" + zone + "," + self.configDns.dnsDN
|
|
||||||
+ entry = {
|
|
||||||
+ "associateddomain" : alias + "." + zone,
|
|
||||||
+ "objectClass" : ["top", "domainrelatedobject", "dnsdomain2"],
|
|
||||||
+ "dc" : alias,
|
|
||||||
+ "cnamerecord" : cname + "." + zone,
|
|
||||||
+ }
|
|
||||||
+ else:
|
|
||||||
+ # Add the CNAME record
|
|
||||||
+ dn = "relativeDomainName=" + alias + "," + "ou=" + zone + "," + "ou=" + zone + "," + self.configDns.dnsDN
|
|
||||||
+ entry = {
|
|
||||||
+ "relativeDomainName" : alias,
|
|
||||||
+ "objectClass" : ["top", "dNSZone"],
|
|
||||||
+ "zoneName" : zone,
|
|
||||||
+ "dNSClass" : dnsClass,
|
|
||||||
+ "CNAMERecord" : cname,
|
|
||||||
+ }
|
|
||||||
attributes=[ (k,v) for k,v in entry.items() ]
|
|
||||||
self.l.add_s(dn, attributes)
|
|
||||||
self.updateZoneSerial(zone)
|
|
||||||
@@ -491,15 +591,24 @@
|
|
||||||
@rtype: int
|
|
||||||
"""
|
|
||||||
ret = 1
|
|
||||||
- if not container: container = zone
|
|
||||||
- dn = "relativeDomainName=" + hostname + "," + "ou=" + zone + "," + "ou=" + container + "," + self.configDns.dnsDN
|
|
||||||
- entry = {
|
|
||||||
- "relativeDomainName" : hostname,
|
|
||||||
- "objectClass" : ["top", "dNSZone"],
|
|
||||||
- "zoneName" : zone,
|
|
||||||
- "dNSClass" : dnsClass,
|
|
||||||
- "aRecord" : ip,
|
|
||||||
- }
|
|
||||||
+ if self.pdns:
|
|
||||||
+ dn = "dc=" + hostname + "," +"dc=" + zone + "," + self.configDns.dnsDN
|
|
||||||
+ entry = {
|
|
||||||
+ "associateddomain" : hostname + "." + zone,
|
|
||||||
+ "objectClass" : ["top", "domainrelatedobject", "dnsdomain2"],
|
|
||||||
+ "dc" : hostname,
|
|
||||||
+ "aRecord" : ip,
|
|
||||||
+ }
|
|
||||||
+ else:
|
|
||||||
+ if not container: container = zone
|
|
||||||
+ dn = "relativeDomainName=" + hostname + "," + "ou=" + zone + "," + "ou=" + container + "," + self.configDns.dnsDN
|
|
||||||
+ entry = {
|
|
||||||
+ "relativeDomainName" : hostname,
|
|
||||||
+ "objectClass" : ["top", "dNSZone"],
|
|
||||||
+ "zoneName" : zone,
|
|
||||||
+ "dNSClass" : dnsClass,
|
|
||||||
+ "aRecord" : ip,
|
|
||||||
+ }
|
|
||||||
attributes=[ (k,v) for k,v in entry.items() ]
|
|
||||||
self.l.add_s(dn, attributes)
|
|
||||||
self.updateZoneSerial(zone)
|
|
||||||
@@ -518,14 +627,23 @@
|
|
||||||
elements.reverse()
|
|
||||||
elements.pop() # Remove the last "."
|
|
||||||
relative = ".".join(elements)
|
|
||||||
- dn = "relativeDomainName=" + relative + "," + "ou=" + revZone + "," + "ou=" + container + "," + self.configDns.dnsDN
|
|
||||||
- entry = {
|
|
||||||
- "relativeDomainName" : relative,
|
|
||||||
- "objectClass" : ["top", "dNSZone"],
|
|
||||||
- "zoneName" : revZone,
|
|
||||||
- "dNSClass" : dnsClass,
|
|
||||||
- "pTRRecord" : hostname + "." + zone + ".",
|
|
||||||
- }
|
|
||||||
+ if self.pdns:
|
|
||||||
+ dn = "dc=" + relative + "," + "dc=" + revZone + "," + self.configDns.dnsDN
|
|
||||||
+ entry = {
|
|
||||||
+ "dc" : relative,
|
|
||||||
+ "objectClass" : ["top", "domainrelatedobject", "dnsdomain2"],
|
|
||||||
+ "associatedDomain" : relative + "." + revZone,
|
|
||||||
+ "pTRRecord" : hostname + "." + zone,
|
|
||||||
+ }
|
|
||||||
+ else:
|
|
||||||
+ dn = "relativeDomainName=" + relative + "," + "ou=" + revZone + "," + "ou=" + container + "," + self.configDns.dnsDN
|
|
||||||
+ entry = {
|
|
||||||
+ "relativeDomainName" : relative,
|
|
||||||
+ "objectClass" : ["top", "dNSZone"],
|
|
||||||
+ "zoneName" : revZone,
|
|
||||||
+ "dNSClass" : dnsClass,
|
|
||||||
+ "pTRRecord" : hostname + "." + zone + ".",
|
|
||||||
+ }
|
|
||||||
attributes=[ (k,v) for k,v in entry.items() ]
|
|
||||||
self.l.add_s(dn, attributes)
|
|
||||||
self.updateZoneSerial(revZone)
|
|
||||||
@@ -536,7 +654,12 @@
|
|
||||||
"""
|
|
||||||
Get all CNAME records that points to the given hostname
|
|
||||||
"""
|
|
||||||
- return self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(cNAMERecord=%s))" % (zone, hostname), None)
|
|
||||||
+ if hostname.endswith("."+zone): fqdn = hostname
|
|
||||||
+ else: fqdn = hostname + "." + zone
|
|
||||||
+ if self.pdns:
|
|
||||||
+ return self.l.search_s("dc=" + zone + "," + self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(cNAMERecord=%s))" % (fqdn), None)
|
|
||||||
+ else:
|
|
||||||
+ return self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(cNAMERecord=%s))" % (zone, hostname), None)
|
|
||||||
|
|
||||||
def delCNAMEs(self, zone, hostname):
|
|
||||||
"""
|
|
||||||
@@ -553,7 +676,12 @@
|
|
||||||
If the RR is a A record where CNAME are linked in, the CNAME records
|
|
||||||
are also removed.
|
|
||||||
"""
|
|
||||||
- host = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=%s))" % (zone, hostname), None)
|
|
||||||
+ if hostname.endswith("."+zone): fqdn = hostname
|
|
||||||
+ else: fqdn = hostname + "." + zone
|
|
||||||
+ if self.pdns:
|
|
||||||
+ host = self.l.search_s("dc=" + zone + "," + self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(associatedDomain=%s))" %fqdn, None)
|
|
||||||
+ else:
|
|
||||||
+ host = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=%s))" % (zone, hostname), None)
|
|
||||||
if host:
|
|
||||||
# If the deleted resource is a type A record, the aliases must be
|
|
||||||
# removed if they exist
|
|
||||||
@@ -564,7 +692,10 @@
|
|
||||||
# Also remove reverse entry
|
|
||||||
revzones = self.getReverseZone(zone)
|
|
||||||
for revzone in revzones:
|
|
||||||
- revhost = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(pTRRecord=%s))" % (revzone, hostname + "." + zone + "."), None)
|
|
||||||
+ if self.pdns:
|
|
||||||
+ revhost = self.l.search_s("dc=" + revzone + "," +self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(pTRRecord=%s))" %fqdn, None)
|
|
||||||
+ else:
|
|
||||||
+ revhost = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(pTRRecord=%s))" % (revzone, hostname + "." + zone + "."), None)
|
|
||||||
if revhost:
|
|
||||||
self.l.delete_s(revhost[0][0])
|
|
||||||
self.updateZoneSerial(revzone)
|
|
||||||
@@ -608,14 +739,22 @@
|
|
||||||
This method is useful to know if we can record a machine in a zone
|
|
||||||
without duplicate.
|
|
||||||
"""
|
|
||||||
- search = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=%s))" % (zone, hostname), None)
|
|
||||||
+ if hostname.endswith("."+zone): fqdn = hostname
|
|
||||||
+ else: fqdn = hostname + "." + zone
|
|
||||||
+ if self.pdns:
|
|
||||||
+ search = self.l.search_s("dc=" + zone + "," + self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(associatedDomain=%s))" % (fqdn), None)
|
|
||||||
+ else:
|
|
||||||
+ search = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=%s))" % (zone, hostname), None)
|
|
||||||
if search: return True
|
|
||||||
revZone = self.getReverseZone(zone)
|
|
||||||
if revZone:
|
|
||||||
# Search host in the reverse zone
|
|
||||||
revZone = revZone[0]
|
|
||||||
- fqdn = hostname + "." + zone + "."
|
|
||||||
- search = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(pTRRecord=%s))" % (revZone, fqdn), None)
|
|
||||||
+ if self.pdns:
|
|
||||||
+ search = self.l.search_s("dc=" + revZone + "," + self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(dc=%s))" % (fqdn), None)
|
|
||||||
+ else:
|
|
||||||
+ fqdn = fqdn + "."
|
|
||||||
+ search = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(pTRRecord=%s))" % (revZone, fqdn), None)
|
|
||||||
return len(search) > 0
|
|
||||||
return False
|
|
||||||
|
|
||||||
@@ -628,7 +767,10 @@
|
|
||||||
This method is useful to know if we can record a machine in a zone
|
|
||||||
without duplicate.
|
|
||||||
"""
|
|
||||||
- search = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(aRecord=%s))" % (zone, ip), None)
|
|
||||||
+ if self.pdns:
|
|
||||||
+ search = self.l.search_s("dc=" + zone + "," + self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(aRecord=%s))" %ip, None)
|
|
||||||
+ else:
|
|
||||||
+ search = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(aRecord=%s))" % (zone, ip), None)
|
|
||||||
if search: return True
|
|
||||||
revZone = self.getReverseZone(zone)
|
|
||||||
if revZone:
|
|
||||||
@@ -640,7 +782,10 @@
|
|
||||||
elements.reverse()
|
|
||||||
elements.pop() # Remove the last "."
|
|
||||||
relative = ".".join(elements)
|
|
||||||
- search = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=%s))" % (revZone, relative), None)
|
|
||||||
+ if self.pdns:
|
|
||||||
+ search = self.l.search_s("dc=" + revZone + "," + self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(associatedDomain=%s))" %relative, None)
|
|
||||||
+ else:
|
|
||||||
+ search = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=%s))" % (revZone, relative), None)
|
|
||||||
return len(search) > 0
|
|
||||||
return False
|
|
||||||
|
|
||||||
@@ -652,7 +797,12 @@
|
|
||||||
@rtype: str
|
|
||||||
"""
|
|
||||||
ret = ""
|
|
||||||
- search = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=%s))" % (zone, hostname), None)
|
|
||||||
+ if hostname.endswith("."+zone): fqdn = hostname
|
|
||||||
+ else: fqdn = hostname + "." + zone
|
|
||||||
+ if self.pdns:
|
|
||||||
+ search = self.l.search_s("dc=" + zone + "," + self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(associatedDomain=%s))" %fqdn, None)
|
|
||||||
+ else:
|
|
||||||
+ search = self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=%s))" % (zone, hostname), None)
|
|
||||||
if search:
|
|
||||||
try:
|
|
||||||
ret = search[0][1]["aRecord"][0]
|
|
||||||
@@ -697,7 +847,12 @@
|
|
||||||
@return: a domain name resource record (RR)
|
|
||||||
@rtype: dict
|
|
||||||
"""
|
|
||||||
- return self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=%s))" % (zone, rr), None)
|
|
||||||
+ if self.pdns:
|
|
||||||
+ if rr.endswith(zone):
|
|
||||||
+ rr, tmp = rr.split(".")
|
|
||||||
+ return self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dnsdomain2)(associatedDomain=%s.%s))" % (rr, zone), None)
|
|
||||||
+ else:
|
|
||||||
+ return self.l.search_s(self.configDns.dnsDN, ldap.SCOPE_SUBTREE, "(&(objectClass=dNSZone)(zoneName=%s)(relativeDomainName=%s))" % (zone, rr), None)
|
|
||||||
|
|
||||||
|
|
||||||
class DnsService(ServiceManager):
|
|
||||||
@@ -717,7 +872,12 @@
|
|
||||||
self.logfile = config.dnsLogFile
|
|
||||||
self.maxElt= 200
|
|
||||||
self.file = open(self.logfile, 'r')
|
|
||||||
- self.pattern = {
|
|
||||||
- "named-syslog" : "^(?P<b>[A-z]{3}) *(?P<d>[0-9]+) (?P<H>[0-9]{2}):(?P<M>[0-9]{2}):(?P<S>[0-9]{2}) .* named\[[0-9]+\]: (?P<extra>.*)$",
|
|
||||||
- "named-syslog1" : "^(?P<b>[A-z]{3}) *(?P<d>[0-9]+) (?P<H>[0-9]{2}):(?P<M>[0-9]{2}):(?P<S>[0-9]{2}) .* named-sdb\[[0-9]+\]: (?P<extra>.*)$",
|
|
||||||
+ if config.dnsType == "pdns":
|
|
||||||
+ self.pattern = {
|
|
||||||
+ "named-syslog" : "^(?P<b>[A-z]{3}) *(?P<d>[0-9]+) (?P<H>[0-9]{2}):(?P<M>[0-9]{2}):(?P<S>[0-9]{2}) .* pdns\[[0-9]+\]: (?P<extra>.*)$",
|
|
||||||
+ }
|
|
||||||
+ else:
|
|
||||||
+ self.pattern = {
|
|
||||||
+ "named-syslog" : "^(?P<b>[A-z]{3}) *(?P<d>[0-9]+) (?P<H>[0-9]{2}):(?P<M>[0-9]{2}):(?P<S>[0-9]{2}) .* named\[[0-9]+\]: (?P<extra>.*)$",
|
|
||||||
+ "named-syslog1" : "^(?P<b>[A-z]{3}) *(?P<d>[0-9]+) (?P<H>[0-9]{2}):(?P<M>[0-9]{2}):(?P<S>[0-9]{2}) .* named-sdb\[[0-9]+\]: (?P<extra>.*)$",
|
|
||||||
}
|
|
@ -1,827 +0,0 @@
|
|||||||
Submitted By: Mario Fetka (mario dot fetka at gmail dot com)
|
|
||||||
Date: 2009-01-15
|
|
||||||
Initial Package Version: 2.3.1
|
|
||||||
Origin: http://mds.mandriva.org/svn/mmc-agent/branches/printing/
|
|
||||||
Upstream Status: upstream
|
|
||||||
Description: patch in printing support to the mmc-agent package
|
|
||||||
|
|
||||||
diff -Naur mmc-agent-2.3.2.orig/conf/plugins/printing.ini mmc-agent-2.3.2/conf/plugins/printing.ini
|
|
||||||
--- mmc-agent-2.3.2.orig/conf/plugins/printing.ini 1970-01-01 00:00:00.000000000 +0000
|
|
||||||
+++ mmc-agent-2.3.2/conf/plugins/printing.ini 2009-01-15 16:32:36.801050135 +0000
|
|
||||||
@@ -0,0 +1,5 @@
|
|
||||||
+[main]
|
|
||||||
+# Is this plugin disabled ?
|
|
||||||
+disable = 0
|
|
||||||
+# Where are located the printers
|
|
||||||
+basePrintersDN = ou=Printers, dc=linbox, dc=com
|
|
||||||
diff -Naur mmc-agent-2.3.2.orig/conf/plugins/printstats.ini mmc-agent-2.3.2/conf/plugins/printstats.ini
|
|
||||||
--- mmc-agent-2.3.2.orig/conf/plugins/printstats.ini 1970-01-01 00:00:00.000000000 +0000
|
|
||||||
+++ mmc-agent-2.3.2/conf/plugins/printstats.ini 2009-01-15 16:32:36.802049976 +0000
|
|
||||||
@@ -0,0 +1,26 @@
|
|
||||||
+[main]
|
|
||||||
+disable = 0
|
|
||||||
+dbhost = localhost
|
|
||||||
+dbport = 5432
|
|
||||||
+dbname = lpstats
|
|
||||||
+dbuser = lpstats
|
|
||||||
+dbpasswd = lpstats
|
|
||||||
+
|
|
||||||
+[sql]
|
|
||||||
+history = SELECT sum(pages * copies), (SELECT EXTRACT(day FROM date)) AS day, (SELECT EXTRACT(month from date)) AS month, (SELECT EXTRACT(year from date)) AS year FROM linboxprintstats WHERE (now()::date - date::date <= %(days)d and printserver like '%(printserver)s') GROUP by day, month, year;
|
|
||||||
+
|
|
||||||
+historybymonth = SELECT sum(pages * copies), (SELECT EXTRACT(month from date)) AS month, (SELECT EXTRACT(year from date)) AS year FROM linboxprintstats WHERE (now()::date - date::date <= %(days)d and printserver like '%(printserver)s') GROUP by month, year;
|
|
||||||
+
|
|
||||||
+printers = select lps.printer as impr, coalesce(sum(lps.copies * lps.pages), 0) as total , (select coalesce(sum(lps2.copies * lps2.pages), 0) from linboxprintstats lps2 where (lps.printer = lps2.printer and lps2.color = 2 and lps2.date >= '%(begin)s' and lps2.date<='%(end)s' and lps2.printserver like '%(printserver)s')) as color, (select coalesce(sum(lps3.copies * lps3.pages), 0) from linboxprintstats lps3 where (lps3.printer = lps.printer and lps3.color <= 1 and lps3.date >= '%(begin)s' and lps3.date <= '%(end)s' and lps3.printserver like '%(printserver)s')) as bw from linboxprintstats lps where (lps.date >= '%(begin)s' and lps.date <= '%(end)s' and lps.printserver like '%(printserver)s') group by lps.printer order by %(orderby)s %(sort)s limit %(limit)s;
|
|
||||||
+
|
|
||||||
+users = select lps.username, coalesce(sum(lps.copies * lps.pages), 0) as total , (select coalesce(sum(lps2.copies * lps2.pages), 0) from linboxprintstats lps2 where (lps2.username = lps.username and lps2.color = 2 and lps2.date >= '%(begin)s' and lps2.date <= '%(end)s' and lps2.printserver like '%(printserver)s')) as color, (select coalesce(sum(lps3.copies * lps3.pages), 0) from linboxprintstats lps3 where (lps3.username = lps.username and lps3.color<=1 and lps3.date >= '%(begin)s' and lps3.date <= '%(end)s' and lps3.printserver like '%(printserver)s')) as bw from linboxprintstats lps where (lps.date >= '%(begin)s' and lps.date <= '%(end)s' and lps.printserver like '%(printserver)s') group by lps.username order by %(orderby)s %(sort)s limit %(limit)s;
|
|
||||||
+
|
|
||||||
+printer = select (select sum(lps2.copies) from linboxprintstats lps2 where (lps2.pages >= '%(lim1)d' and lps2.pages <= '%(lim2)d' and lps2.printer='%(printer)s' and lps2.date >= '%(begin)s' and date <= '%(end)s' and lps2.printserver like '%(printserver)s')), (select sum(lps3.copies) from linboxprintstats lps3 where (lps3.pages > '%(lim2)d' and lps3.pages <= '%(lim3)d' and lps3.printer='%(printer)s' and lps3.date >= '%(begin)s' and lps3.date <= '%(end)s') and lps3.printserver like '%(printserver)s'), (select sum(lps4.copies) from linboxprintstats lps4 where (lps4.pages > '%(lim3)s' and lps4.pages <= '%(lim4)s' and lps4.printer = '%(printer)s' and lps4.date >= '%(begin)s' and lps4.date <= '%(end)s' and lps4.printserver like '%(printserver)s')), (select sum(lps5.copies) from linboxprintstats lps5 where (lps5.pages > '%(lim4)s' and lps5.pages <= '%(lim5)s' and lps5.printer = '%(printer)s' and lps5.date >= '%(begin)s' and lps5.date <= '%(end)s' and lps5.printserver like '%(printserver)s')), (select sum(lps6.copies) from linboxprintstats lps6 where (lps6.pages > '%(lim5)s' and lps6.printer = '%(printer)s' and lps6.date >= '%(begin)s' and date <= '%(end)s' and lps6.printserver like '%(printserver)s')) from linboxprintstats limit 1;
|
|
||||||
+
|
|
||||||
+user4printer = select lps.username, coalesce(sum(lps.copies * lps.pages), 0) as total , (select coalesce(sum(lps2.copies * lps2.pages), 0) from linboxprintstats lps2 where (lps2.printer = '%(printer)s' and lps2.username = lps.username and lps2.color = 2 and lps2.date >= '%(begin)s' and lps2.date <= '%(end)s' and lps2.printserver like '%(printserver)s')) as color, (select coalesce(sum(lps3.copies * lps3.pages), 0) from linboxprintstats lps3 where (lps3.printer = '%(printer)s' and lps3.username = lps.username and lps3.color <= 1 and lps3.date >= '%(begin)s' and lps3.date <= '%(end)s' and lps3.printserver like '%(printserver)s')) as bw from linboxprintstats lps where (lps.printer = '%(printer)s' and lps.date >= '%(begin)s' and lps.date <= '%(end)s' and lps.printserver like '%(printserver)s') group by username order by %(orderby)s %(sort)s limit %(limit)s;
|
|
||||||
+
|
|
||||||
+printservers = select distinct(printserver) from linboxprintstats;
|
|
||||||
+
|
|
||||||
+printerlist = select distinct(printer) from linboxprintstats;
|
|
||||||
+
|
|
||||||
+colors = SELECT color,sum(copies*pages) from linboxprintstats WHERE (date >= '%(begin)s' and date <= '%(end)s' and printserver like '%(printserver)s') GROUP by color;
|
|
||||||
diff -Naur mmc-agent-2.3.2.orig/debian/control mmc-agent-2.3.2/debian/control
|
|
||||||
--- mmc-agent-2.3.2.orig/debian/control 2008-04-30 21:07:26.000000000 +0000
|
|
||||||
+++ mmc-agent-2.3.2/debian/control 2009-01-15 16:32:36.803050306 +0000
|
|
||||||
@@ -69,6 +69,22 @@
|
|
||||||
.
|
|
||||||
Homepage: http://mds.mandriva.org
|
|
||||||
|
|
||||||
+Package: python-mmc-printing
|
|
||||||
+Architecture: all
|
|
||||||
+Depends: ${python:Depends}, python-mmc-base (= 2.3.0-1)
|
|
||||||
+Description: Mandriva Management Console printing plugin
|
|
||||||
+ Printing management plugin for the MMC.
|
|
||||||
+ .
|
|
||||||
+ Homepage: http://mds.mandriva.org
|
|
||||||
+
|
|
||||||
+Package: python-mmc-printstats
|
|
||||||
+Architecture: all
|
|
||||||
+Depends: ${python:Depends}, python-mmc-base (= 2.3.0-1)
|
|
||||||
+Description: Mandriva Management Console printstats plugin
|
|
||||||
+ Printstats plugin for the MMC.
|
|
||||||
+ .
|
|
||||||
+ Homepage: http://mds.mandriva.org
|
|
||||||
+
|
|
||||||
Package: python-mmc-plugins-tools
|
|
||||||
Architecture: all
|
|
||||||
Replaces: python-lmc-plugins-tools
|
|
||||||
diff -Naur mmc-agent-2.3.2.orig/debian/control.in mmc-agent-2.3.2/debian/control.in
|
|
||||||
--- mmc-agent-2.3.2.orig/debian/control.in 2008-12-18 13:09:06.000000000 +0000
|
|
||||||
+++ mmc-agent-2.3.2/debian/control.in 2009-01-15 16:32:36.804050147 +0000
|
|
||||||
@@ -69,6 +69,22 @@
|
|
||||||
.
|
|
||||||
Homepage: http://mds.mandriva.org
|
|
||||||
|
|
||||||
+Package: python-mmc-printing
|
|
||||||
+Architecture: all
|
|
||||||
+Depends: ${python:Depends}, python-mmc-base (= 2.3.1-1mdv)
|
|
||||||
+Description: Mandriva Management Console printing plugin
|
|
||||||
+ Printing management plugin for the MMC.
|
|
||||||
+ .
|
|
||||||
+ Homepage: http://mds.mandriva.org
|
|
||||||
+
|
|
||||||
+Package: python-mmc-printstats
|
|
||||||
+Architecture: all
|
|
||||||
+Depends: ${python:Depends}, python-mmc-base (= 2.3.1-1mdv)
|
|
||||||
+Description: Mandriva Management Console printstats plugin
|
|
||||||
+ Printstats plugin for the MMC.
|
|
||||||
+ .
|
|
||||||
+ Homepage: http://mds.mandriva.org
|
|
||||||
+
|
|
||||||
Package: python-mmc-plugins-tools
|
|
||||||
Architecture: all
|
|
||||||
Replaces: python-lmc-plugins-tools
|
|
||||||
diff -Naur mmc-agent-2.3.2.orig/debian/python-mmc-printing.install mmc-agent-2.3.2/debian/python-mmc-printing.install
|
|
||||||
--- mmc-agent-2.3.2.orig/debian/python-mmc-printing.install 1970-01-01 00:00:00.000000000 +0000
|
|
||||||
+++ mmc-agent-2.3.2/debian/python-mmc-printing.install 2009-01-15 16:32:36.805045099 +0000
|
|
||||||
@@ -0,0 +1,2 @@
|
|
||||||
+usr/lib/python2.?/site-packages/mmc/plugins/printing
|
|
||||||
+etc/mmc/plugins/printing.ini
|
|
||||||
diff -Naur mmc-agent-2.3.2.orig/debian/python-mmc-printstats.install mmc-agent-2.3.2/debian/python-mmc-printstats.install
|
|
||||||
--- mmc-agent-2.3.2.orig/debian/python-mmc-printstats.install 1970-01-01 00:00:00.000000000 +0000
|
|
||||||
+++ mmc-agent-2.3.2/debian/python-mmc-printstats.install 2009-01-15 16:32:36.805045099 +0000
|
|
||||||
@@ -0,0 +1,2 @@
|
|
||||||
+usr/lib/python2.?/site-packages/mmc/plugins/printstats
|
|
||||||
+etc/mmc/plugins/printstats.ini
|
|
||||||
diff -Naur mmc-agent-2.3.2.orig/mmc/plugins/printing/__init__.py mmc-agent-2.3.2/mmc/plugins/printing/__init__.py
|
|
||||||
--- mmc-agent-2.3.2.orig/mmc/plugins/printing/__init__.py 1970-01-01 00:00:00.000000000 +0000
|
|
||||||
+++ mmc-agent-2.3.2/mmc/plugins/printing/__init__.py 2009-01-15 16:32:36.808050000 +0000
|
|
||||||
@@ -0,0 +1,480 @@
|
|
||||||
+# -*- coding: utf-8; -*-
|
|
||||||
+#
|
|
||||||
+# (c) 2004-2007 Linbox / Free&ALter Soft, http://linbox.com
|
|
||||||
+# (c) 2007-2008 Mandriva, http://www.mandriva.com
|
|
||||||
+#
|
|
||||||
+# $Id: __init__.py 642 2008-05-19 16:16:55Z cdelfosse $
|
|
||||||
+#
|
|
||||||
+# This file is part of Mandriva Management Console (MMC).
|
|
||||||
+#
|
|
||||||
+# MMC is free software; you can redistribute it and/or modify
|
|
||||||
+# it under the terms of the GNU General Public License as published by
|
|
||||||
+# the Free Software Foundation; either version 2 of the License, or
|
|
||||||
+# (at your option) any later version.
|
|
||||||
+#
|
|
||||||
+# MMC is distributed 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 General Public License for more details.
|
|
||||||
+#
|
|
||||||
+# You should have received a copy of the GNU General Public License
|
|
||||||
+# along with MMC; if not, write to the Free Software
|
|
||||||
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
+
|
|
||||||
+import ConfigParser
|
|
||||||
+import logging
|
|
||||||
+
|
|
||||||
+import ldap
|
|
||||||
+from ldap.modlist import addModlist
|
|
||||||
+
|
|
||||||
+from mmc.plugins.base import ldapUserGroupControl, GpoManager
|
|
||||||
+from mmc.support import mmctools
|
|
||||||
+
|
|
||||||
+VERSION = "2.3.1"
|
|
||||||
+APIVERSION = "1:0:0"
|
|
||||||
+REVISION = int("$Rev: 642 $".split(':')[1].strip(' $'))
|
|
||||||
+
|
|
||||||
+def getVersion(): return VERSION
|
|
||||||
+def getApiVersion(): return APIVERSION
|
|
||||||
+def getRevision(): return REVISION
|
|
||||||
+
|
|
||||||
+def activate():
|
|
||||||
+ """
|
|
||||||
+ This function defines if this module can be activated
|
|
||||||
+ @return: return True if this module can be activated
|
|
||||||
+ @rtype: boolean
|
|
||||||
+ """
|
|
||||||
+ configParser = mmctools.getConfigParser("printing")
|
|
||||||
+ logger = logging.getLogger()
|
|
||||||
+ ret = False
|
|
||||||
+ if configParser.get("main", "disable") == "1":
|
|
||||||
+ logger.info("printing plugin disabled by configuration.")
|
|
||||||
+ else:
|
|
||||||
+ # Create Printers Ou
|
|
||||||
+ p = ldapPrinters()
|
|
||||||
+ head, path = p.basePrintersDN.split(",", 1)
|
|
||||||
+ ouName = head.split("=")[1]
|
|
||||||
+ try:
|
|
||||||
+ p.addOu(ouName, path)
|
|
||||||
+ logger.info("Created OU " + p.basePrintersDN)
|
|
||||||
+ except ldap.ALREADY_EXISTS:
|
|
||||||
+ pass
|
|
||||||
+ gpomanager = GpoManager("Printers")
|
|
||||||
+ try:
|
|
||||||
+ gpomanager.add("GPOPrintServiceAccessAllowed", { "ACLPrintServiceAccess" : "True" })
|
|
||||||
+ except ldap.ALREADY_EXISTS:
|
|
||||||
+ pass
|
|
||||||
+ try:
|
|
||||||
+ gpomanager.add("GPOPrintServiceAllRights", { "ACLPrintServiceAllRights" : "True" })
|
|
||||||
+ except ldap.ALREADY_EXISTS:
|
|
||||||
+ pass
|
|
||||||
+ ret = True
|
|
||||||
+ return ret
|
|
||||||
+
|
|
||||||
+# Printers management
|
|
||||||
+
|
|
||||||
+def get(pattern = "*"):
|
|
||||||
+ return ldapPrinters().get(pattern)
|
|
||||||
+
|
|
||||||
+def add(name, location = "", info = ""):
|
|
||||||
+ d = {}
|
|
||||||
+ d["printer-name"] = name
|
|
||||||
+ d["printer-location"] = location
|
|
||||||
+ d["printer-info"] = info
|
|
||||||
+ return ldapPrinters().add(d)
|
|
||||||
+
|
|
||||||
+def delete(name):
|
|
||||||
+ return ldapPrinters().delete(name)
|
|
||||||
+
|
|
||||||
+def exists(printer):
|
|
||||||
+ return ldapPrinters().exists(printer)
|
|
||||||
+
|
|
||||||
+# User rights management
|
|
||||||
+
|
|
||||||
+def addUserServiceAccessAllowed(uid):
|
|
||||||
+ ldapPrinters().addUserServiceAccessAllowed(uid)
|
|
||||||
+
|
|
||||||
+def delUserServiceAccessAllowed(uid):
|
|
||||||
+ ldapPrinters().delUserServiceAccessAllowed(uid)
|
|
||||||
+
|
|
||||||
+def isUserServiceAccessAllowed(uid):
|
|
||||||
+ return ldapPrinters().isUserServiceAccessAllowed(uid)
|
|
||||||
+
|
|
||||||
+def addUserServiceAllRights(uid):
|
|
||||||
+ ldapPrinters().addUserServiceAllRights(uid)
|
|
||||||
+
|
|
||||||
+def delUserServiceAllRights(uid):
|
|
||||||
+ ldapPrinters().delUserServiceAllRights(uid)
|
|
||||||
+
|
|
||||||
+def isUserServiceAllRights(uid):
|
|
||||||
+ return ldapPrinters().isUserServiceAllRights(uid)
|
|
||||||
+
|
|
||||||
+def addUserPrinterAccessAllowed(uid, printer):
|
|
||||||
+ ldapPrinters().addUserPrinterAccessAllowed(uid, printer)
|
|
||||||
+
|
|
||||||
+def delUserPrinterAccessAllowed(uid, printer):
|
|
||||||
+ ldapPrinters().delUserPrinterAccessAllowed(uid, printer)
|
|
||||||
+
|
|
||||||
+def getUserPrintersAccessAllowed(uid):
|
|
||||||
+ return ldapPrinters().getUserPrintersAccessAllowed(uid)
|
|
||||||
+
|
|
||||||
+# Group rights management
|
|
||||||
+
|
|
||||||
+def addGroupServiceAccessAllowed(group):
|
|
||||||
+ ldapPrinters().addGroupServiceAccessAllowed(group)
|
|
||||||
+
|
|
||||||
+def delGroupServiceAccessAllowed(group):
|
|
||||||
+ ldapPrinters().delGroupServiceAccessAllowed(group)
|
|
||||||
+
|
|
||||||
+def isGroupServiceAccessAllowed(group):
|
|
||||||
+ return ldapPrinters().isGroupServiceAccessAllowed(group)
|
|
||||||
+
|
|
||||||
+def addGroupServiceAllRights(group):
|
|
||||||
+ ldapPrinters().addGroupServiceAllRights(group)
|
|
||||||
+
|
|
||||||
+def delGroupServiceAllRights(group):
|
|
||||||
+ ldapPrinters().delGroupServiceAllRights(group)
|
|
||||||
+
|
|
||||||
+def isGroupServiceAllRights(group):
|
|
||||||
+ return ldapPrinters().isGroupServiceAllRights(group)
|
|
||||||
+
|
|
||||||
+def addGroupPrinterAccessAllowed(group, printer):
|
|
||||||
+ ldapPrinters().addGroupPrinterAccessAllowed(group, printer)
|
|
||||||
+
|
|
||||||
+def delGroupPrinterAccessAllowed(group, printer):
|
|
||||||
+ ldapPrinters().delGroupPrinterAccessAllowed(group, printer)
|
|
||||||
+
|
|
||||||
+def getGroupPrintersAccessAllowed(group):
|
|
||||||
+ return ldapPrinters().getGroupPrintersAccessAllowed(group)
|
|
||||||
+
|
|
||||||
+#
|
|
||||||
+
|
|
||||||
+def getUsersAccessAllowedForPrinter(printer):
|
|
||||||
+ return ldapPrinters().getUsersAccessAllowedForPrinter(printer)
|
|
||||||
+
|
|
||||||
+def getGroupsAccessAllowedForPrinter(printer):
|
|
||||||
+ return ldapPrinters().getGroupsAccessAllowedForPrinter(printer)
|
|
||||||
+
|
|
||||||
+#
|
|
||||||
+
|
|
||||||
+def getUsersPrintServiceGPO(gpo):
|
|
||||||
+ return ldapPrinters().getUsersPrintServiceGPO(gpo)
|
|
||||||
+
|
|
||||||
+def getGroupsPrintServiceGPO(gpo):
|
|
||||||
+ return ldapPrinters().getGroupsPrintServiceGPO(gpo)
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+class ldapPrinters(ldapUserGroupControl):
|
|
||||||
+
|
|
||||||
+ # Printers management methods
|
|
||||||
+ def __init__(self, conffile = None, conffilebase = None, gpoCreate = True):
|
|
||||||
+ """
|
|
||||||
+ @param gpoCreate: If True, base GPO for printer rights management will be created.
|
|
||||||
+ @type gpoCreate: bool
|
|
||||||
+ """
|
|
||||||
+ ldapUserGroupControl.__init__(self, conffilebase)
|
|
||||||
+ cp = ConfigParser.ConfigParser()
|
|
||||||
+ if not conffile:
|
|
||||||
+ cp = mmctools.getConfigParser("printing")
|
|
||||||
+ else:
|
|
||||||
+ cp = ConfigParser.ConfigParser()
|
|
||||||
+ cp.read(conffile)
|
|
||||||
+ self.basePrintersDN = cp.get("main", "basePrintersDN").replace(" ", "")
|
|
||||||
+ self.gpomanager = GpoManager("Printers", conffilebase, gpoCreate)
|
|
||||||
+
|
|
||||||
+ def get(self, pattern="*"):
|
|
||||||
+ """
|
|
||||||
+ Return the printers list found in the LDAP.
|
|
||||||
+ """
|
|
||||||
+ entries = self.search("printer-name="+pattern, self.basePrintersDN)
|
|
||||||
+ result = []
|
|
||||||
+ for entry in entries:
|
|
||||||
+ dn, attrs = entry[0]
|
|
||||||
+ result.append(attrs["printer-name"][0])
|
|
||||||
+ result.sort()
|
|
||||||
+ return result
|
|
||||||
+
|
|
||||||
+ def add(self, printerDesc):
|
|
||||||
+ """
|
|
||||||
+ Add a printer into the LDAP.
|
|
||||||
+
|
|
||||||
+ The GPOs corresponding to the printer are created too.
|
|
||||||
+ """
|
|
||||||
+ printerDesc["objectClass"] = ("printerService")
|
|
||||||
+ modlist = addModlist(printerDesc)
|
|
||||||
+ entry = "printer-name=" + printerDesc["printer-name"] + "," + self.basePrintersDN
|
|
||||||
+ self.l.add_s(entry, modlist)
|
|
||||||
+ self.gpomanager.add("GPOPrinterAccessAllowed_" + printerDesc["printer-name"], { "PrinterServiceAccess" : "True" })
|
|
||||||
+
|
|
||||||
+ def delete(self, name):
|
|
||||||
+ """
|
|
||||||
+ Delete a printer from the LDAP.
|
|
||||||
+
|
|
||||||
+ The GPOs corresponding to the printer are deleted too.
|
|
||||||
+ """
|
|
||||||
+ entry = "printer-name=" + name + ", " + self.basePrintersDN
|
|
||||||
+ self.delRecursiveEntry(entry)
|
|
||||||
+ self.gpomanager.delete("GPOPrinterAccessAllowed_" + name)
|
|
||||||
+
|
|
||||||
+ def exists(self, printer):
|
|
||||||
+ """
|
|
||||||
+ Return True if a printer with this name exists.
|
|
||||||
+ """
|
|
||||||
+ entry = self.search("printer-name=" + printer, self.basePrintersDN)
|
|
||||||
+ return (len(entry) == 1)
|
|
||||||
+
|
|
||||||
+ # Users rights management
|
|
||||||
+
|
|
||||||
+ def addUserServiceAccessAllowed(self, uid):
|
|
||||||
+ """
|
|
||||||
+ Give an user the right to access the print service
|
|
||||||
+
|
|
||||||
+ @param uid: user to give access
|
|
||||||
+ """
|
|
||||||
+ self.gpomanager.addUserToGPO(uid, "GPOPrintServiceAccessAllowed")
|
|
||||||
+
|
|
||||||
+ def delUserServiceAccessAllowed(self, uid):
|
|
||||||
+ """
|
|
||||||
+ Remove an user the right to access the print service
|
|
||||||
+
|
|
||||||
+ @param uid: user to give access
|
|
||||||
+ """
|
|
||||||
+ self.gpomanager.delUserFromGPO(uid, "GPOPrintServiceAccessAllowed")
|
|
||||||
+
|
|
||||||
+ def isUserServiceAccessAllowed(self, uid):
|
|
||||||
+ """
|
|
||||||
+ Return true if the user has print service access
|
|
||||||
+
|
|
||||||
+ @param uid: user to get access
|
|
||||||
+ @rtype: Boolean
|
|
||||||
+ """
|
|
||||||
+ dn = "uid=" + uid + "," + self.baseUsersDN
|
|
||||||
+ members = self.gpomanager.getUsersFromGPO("GPOPrintServiceAccessAllowed")
|
|
||||||
+ return dn in members
|
|
||||||
+
|
|
||||||
+ def addUserServiceAllRights(self, uid):
|
|
||||||
+ """
|
|
||||||
+ Give an user the right to access the print service without restriction
|
|
||||||
+
|
|
||||||
+ @param uid: user to give access
|
|
||||||
+ """
|
|
||||||
+ self.gpomanager.addUserToGPO(uid, "GPOPrintServiceAllRights")
|
|
||||||
+
|
|
||||||
+ def delUserServiceAllRights(self, uid):
|
|
||||||
+ """
|
|
||||||
+ Remove an user the right to access the print service without restriction
|
|
||||||
+
|
|
||||||
+ @param uid: user to give access
|
|
||||||
+ """
|
|
||||||
+ self.gpomanager.delUserFromGPO(uid, "GPOPrintServiceAllRights")
|
|
||||||
+
|
|
||||||
+ def isUserServiceAllRights(self, uid):
|
|
||||||
+ """
|
|
||||||
+ Return true if the user has print service access without restriction
|
|
||||||
+
|
|
||||||
+ @param uid: user to get access
|
|
||||||
+ @rtype: Boolean
|
|
||||||
+ """
|
|
||||||
+ dn = "uid=" + uid + "," + self.baseUsersDN
|
|
||||||
+ members = self.gpomanager.getUsersFromGPO("GPOPrintServiceAllRights")
|
|
||||||
+ return dn in members
|
|
||||||
+
|
|
||||||
+ def addUserPrinterAccessAllowed(self, uid, printer):
|
|
||||||
+ """
|
|
||||||
+ Give an user the right to use a printer
|
|
||||||
+
|
|
||||||
+ @param uid: user to give access
|
|
||||||
+ @param printer: printer name
|
|
||||||
+ """
|
|
||||||
+ self.gpomanager.addUserToGPO(uid, "GPOPrinterAccessAllowed_" + printer)
|
|
||||||
+
|
|
||||||
+ def delUserPrinterAccessAllowed(self, uid, printer):
|
|
||||||
+ """
|
|
||||||
+ Remove an user the right to access the print service
|
|
||||||
+
|
|
||||||
+ @param uid: user to give access
|
|
||||||
+ @param printer: printer name
|
|
||||||
+ """
|
|
||||||
+ self.gpomanager.delUserFromGPO(uid, "GPOPrinterAccessAllowed_" + printer)
|
|
||||||
+
|
|
||||||
+ def getUserPrintersAccessAllowed(self, uid):
|
|
||||||
+ """
|
|
||||||
+ Return the list of printers the user has right access
|
|
||||||
+
|
|
||||||
+ @param uid: user name
|
|
||||||
+ """
|
|
||||||
+ dn = "uid=" + uid + "," + self.baseUsersDN
|
|
||||||
+ return self.gpomanager.getResourceGpo(dn, "GPOPrinterAccessAllowed")
|
|
||||||
+
|
|
||||||
+ # Groups rights management
|
|
||||||
+
|
|
||||||
+ def addGroupServiceAccessAllowed(self, group):
|
|
||||||
+ """
|
|
||||||
+ Give a group the right to access the print service
|
|
||||||
+
|
|
||||||
+ @param group: group to give access to
|
|
||||||
+ """
|
|
||||||
+ self.gpomanager.addGroupToGPO(group, "GPOPrintServiceAccessAllowed")
|
|
||||||
+
|
|
||||||
+ def delGroupServiceAccessAllowed(self, group):
|
|
||||||
+ """
|
|
||||||
+ Remove a group the right to access the print service
|
|
||||||
+
|
|
||||||
+ @param group: group to give access to
|
|
||||||
+ """
|
|
||||||
+ self.gpomanager.delGroupFromGPO(group, "GPOPrintServiceAccessAllowed")
|
|
||||||
+
|
|
||||||
+ def isGroupServiceAccessAllowed(self, group):
|
|
||||||
+ """
|
|
||||||
+ Return true if the group has print service access
|
|
||||||
+
|
|
||||||
+ @param group: group to get access
|
|
||||||
+ @rtype: Boolean
|
|
||||||
+ """
|
|
||||||
+ dn = "cn=" + group + "," + self.baseGroupsDN
|
|
||||||
+ members = self.gpomanager.getGroupsFromGPO("GPOPrintServiceAccessAllowed")
|
|
||||||
+ return dn in members
|
|
||||||
+
|
|
||||||
+ def addGroupServiceAllRights(self, group):
|
|
||||||
+ """
|
|
||||||
+ Give a group the right to access to the print service without restriction
|
|
||||||
+
|
|
||||||
+ @param group: group to give access to
|
|
||||||
+ """
|
|
||||||
+ self.gpomanager.addGroupToGPO(group, "GPOPrintServiceAllRights")
|
|
||||||
+
|
|
||||||
+ def delGroupServiceAllRights(self, group):
|
|
||||||
+ """
|
|
||||||
+ Remove a group the right to access to the print service without restriction
|
|
||||||
+
|
|
||||||
+ @param group: group to give access to
|
|
||||||
+ """
|
|
||||||
+ self.gpomanager.delGroupFromGPO(group, "GPOPrintServiceAllRights")
|
|
||||||
+
|
|
||||||
+ def isGroupServiceAllRights(self, group):
|
|
||||||
+ """
|
|
||||||
+ Return true if the group has print service access without restriction
|
|
||||||
+
|
|
||||||
+ @param group: group to get access
|
|
||||||
+ @rtype: Boolean
|
|
||||||
+ """
|
|
||||||
+ dn = "cn=" + group + "," + self.baseGroupsDN
|
|
||||||
+ members = self.gpomanager.getGroupsFromGPO("GPOPrintServiceAllRights")
|
|
||||||
+ return dn in members
|
|
||||||
+
|
|
||||||
+ def addGroupPrinterAccessAllowed(self, group, printer):
|
|
||||||
+ """
|
|
||||||
+ Give a group the right to use a printer
|
|
||||||
+
|
|
||||||
+ @param group: group to give access
|
|
||||||
+ @param printer: printer name
|
|
||||||
+ """
|
|
||||||
+ self.gpomanager.addGroupToGPO(group, "GPOPrinterAccessAllowed_" + printer)
|
|
||||||
+
|
|
||||||
+ def delGroupPrinterAccessAllowed(self, group, printer):
|
|
||||||
+ """
|
|
||||||
+ Remove a group the right to access the print service
|
|
||||||
+
|
|
||||||
+ @param group: group to give access
|
|
||||||
+ @param printer: printer name
|
|
||||||
+ """
|
|
||||||
+ self.gpomanager.delGroupFromGPO(group, "GPOPrinterAccessAllowed_" + printer)
|
|
||||||
+
|
|
||||||
+ def getGroupPrintersAccessAllowed(self, group):
|
|
||||||
+ """
|
|
||||||
+ Return the list of printers the group has right access
|
|
||||||
+
|
|
||||||
+ @param group: group name
|
|
||||||
+ """
|
|
||||||
+ dn = "cn=" + group + "," + self.baseGroupsDN
|
|
||||||
+ return self.gpomanager.getResourceGpo(dn, "GPOPrinterAccessAllowed")
|
|
||||||
+
|
|
||||||
+ # Methods to know who can print on a specific printer
|
|
||||||
+
|
|
||||||
+ def getUsersAccessAllowedForPrinter(self, printer):
|
|
||||||
+ """
|
|
||||||
+ Return the list of users who can use this printer
|
|
||||||
+
|
|
||||||
+ @param printer: the printer name
|
|
||||||
+ """
|
|
||||||
+ ret = []
|
|
||||||
+ for dn in self.gpomanager.getUsersFromGPO("GPOPrinterAccessAllowed_" + printer):
|
|
||||||
+ # Process dn to only return the uid value
|
|
||||||
+ ret.append(dn.split(",")[0].split("=")[1])
|
|
||||||
+ return ret
|
|
||||||
+
|
|
||||||
+ def getGroupsAccessAllowedForPrinter(self, printer):
|
|
||||||
+ """
|
|
||||||
+ Return the list of groups who can use this printer
|
|
||||||
+
|
|
||||||
+ @param printer: the printer name
|
|
||||||
+ """
|
|
||||||
+ ret = []
|
|
||||||
+ for dn in self.gpomanager.getGroupsFromGPO("GPOPrinterAccessAllowed_" + printer):
|
|
||||||
+ # Process dn to only return the cn value
|
|
||||||
+ ret.append(dn.split(",")[0].split("=")[1])
|
|
||||||
+ return ret
|
|
||||||
+
|
|
||||||
+ # To get print service GPO members
|
|
||||||
+
|
|
||||||
+ def getUsersPrintServiceGPO(self, gpo):
|
|
||||||
+ """
|
|
||||||
+ Return the list of users member of the GPO.
|
|
||||||
+
|
|
||||||
+ @param gpo: Name of the GPO
|
|
||||||
+ """
|
|
||||||
+ ret = []
|
|
||||||
+ for dn in self.gpomanager.getUsersFromGPO(gpo):
|
|
||||||
+ # Process dn to only return the uid value
|
|
||||||
+ ret.append(dn.split(",")[0].split("=")[1])
|
|
||||||
+ return ret
|
|
||||||
+
|
|
||||||
+ def getGroupsPrintServiceGPO(self, gpo):
|
|
||||||
+ """
|
|
||||||
+ Return the list of groups member of this GPO
|
|
||||||
+
|
|
||||||
+ @param gpo: Name of the GPO
|
|
||||||
+ """
|
|
||||||
+ ret = []
|
|
||||||
+ for dn in self.gpomanager.getGroupsFromGPO(gpo):
|
|
||||||
+ # Process dn to only return the cn value
|
|
||||||
+ ret.append(dn.split(",")[0].split("=")[1])
|
|
||||||
+ return ret
|
|
||||||
+
|
|
||||||
+ def userCanPrintOn(self, uid, printer):
|
|
||||||
+ """
|
|
||||||
+ This method is used by the MMC CUPS backend to check if an user can print on a printer.
|
|
||||||
+ For the moment, only access right is checked according to group membership.
|
|
||||||
+
|
|
||||||
+ @return: True if the user uid can print on the printer
|
|
||||||
+ @rtype: boolean
|
|
||||||
+ """
|
|
||||||
+ result = False
|
|
||||||
+
|
|
||||||
+ groups = self.getUserGroups(uid)
|
|
||||||
+ # Get groups which has print service access
|
|
||||||
+ groupAccess = []
|
|
||||||
+ for group in groups:
|
|
||||||
+ if self.isGroupServiceAccessAllowed(group):
|
|
||||||
+ groupAccess.append(group)
|
|
||||||
+
|
|
||||||
+ # Get remaining group which has all rights on print service
|
|
||||||
+ groupAllrights = []
|
|
||||||
+ for group in groupAccess:
|
|
||||||
+ if self.isGroupServiceAllRights(group):
|
|
||||||
+ groupAllrights.append(group)
|
|
||||||
+
|
|
||||||
+ if len(groupAllrights):
|
|
||||||
+ # User is in a group which has all rights on print service.
|
|
||||||
+ # So this user can print
|
|
||||||
+ result = True
|
|
||||||
+ else:
|
|
||||||
+ # Does one of these groups has the right to use this printer ?
|
|
||||||
+ for group in groupAccess:
|
|
||||||
+ printers = self.getGroupPrintersAccessAllowed(group)
|
|
||||||
+ if printer in printers:
|
|
||||||
+ # We have a winner
|
|
||||||
+ result = True
|
|
||||||
+ break
|
|
||||||
+
|
|
||||||
+ return result
|
|
||||||
diff -Naur mmc-agent-2.3.2.orig/mmc/plugins/printstats/__init__.py mmc-agent-2.3.2/mmc/plugins/printstats/__init__.py
|
|
||||||
--- mmc-agent-2.3.2.orig/mmc/plugins/printstats/__init__.py 1970-01-01 00:00:00.000000000 +0000
|
|
||||||
+++ mmc-agent-2.3.2/mmc/plugins/printstats/__init__.py 2009-01-15 16:32:36.810050171 +0000
|
|
||||||
@@ -0,0 +1,219 @@
|
|
||||||
+# -*- coding: utf-8; -*-
|
|
||||||
+#
|
|
||||||
+# (c) 2004-2007 Linbox / Free&ALter Soft, http://linbox.com
|
|
||||||
+# (c) 2007 Mandriva, http://www.mandriva.com/
|
|
||||||
+#
|
|
||||||
+# $Id: __init__.py 454 2008-01-18 14:09:42Z cedric $
|
|
||||||
+#
|
|
||||||
+# This file is part of Mandriva Management Console (MMC).
|
|
||||||
+#
|
|
||||||
+# MMC is free software; you can redistribute it and/or modify
|
|
||||||
+# it under the terms of the GNU General Public License as published by
|
|
||||||
+# the Free Software Foundation; either version 2 of the License, or
|
|
||||||
+# (at your option) any later version.
|
|
||||||
+#
|
|
||||||
+# MMC is distributed 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 General Public License for more details.
|
|
||||||
+#
|
|
||||||
+# You should have received a copy of the GNU General Public License
|
|
||||||
+# along with MMC; if not, write to the Free Software
|
|
||||||
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
+
|
|
||||||
+import psycopg
|
|
||||||
+import ConfigParser
|
|
||||||
+import logging
|
|
||||||
+from mmc.support import mmctools
|
|
||||||
+
|
|
||||||
+VERSION = "2.3.1"
|
|
||||||
+APIVERSION = "1:0:0"
|
|
||||||
+REVISION = int("$Rev: 557 $".split(':')[1].strip(' $'))
|
|
||||||
+
|
|
||||||
+def getVersion(): return VERSION
|
|
||||||
+def getApiVersion(): return APIVERSION
|
|
||||||
+def getRevision(): return REVISION
|
|
||||||
+
|
|
||||||
+def activate():
|
|
||||||
+ """
|
|
||||||
+ This function defines if this module can be activated
|
|
||||||
+ @return: return True if this module can be activated
|
|
||||||
+ @rtype: boolean
|
|
||||||
+ """
|
|
||||||
+ configParser = mmctools.getConfigParser("printstats")
|
|
||||||
+ logger = logging.getLogger()
|
|
||||||
+ ret = False
|
|
||||||
+ if configParser.get("main", "disable") == "1":
|
|
||||||
+ logger.info("printstats plugin disabled by configuration.")
|
|
||||||
+ else: ret = True
|
|
||||||
+ return ret
|
|
||||||
+
|
|
||||||
+def getHistory(printserver, days):
|
|
||||||
+ return Printstats().getHistory(printserver, days)
|
|
||||||
+
|
|
||||||
+def getHistoryByMonths(printserver, days):
|
|
||||||
+ return Printstats().getHistoryByMonths(printserver, days)
|
|
||||||
+
|
|
||||||
+def getPrintersStats(printserver, begin, end, orderby, sort, limit):
|
|
||||||
+ return Printstats().getPrintersStats(printserver, begin, end, orderby, sort, limit)
|
|
||||||
+
|
|
||||||
+def getPrinterStats(printserver, printer, begin, end, lim1, lim2, lim3, lim4, lim5):
|
|
||||||
+ return Printstats().getPrinterStats(printserver, printer, begin, end, lim1, lim2, lim3, lim4, lim5)
|
|
||||||
+
|
|
||||||
+def getUsersStatsForPrinter(printserver, printer, begin, end, orderby, sort, limit):
|
|
||||||
+ return Printstats().getUsersStatsForPrinter(printserver, printer, begin, end, orderby, sort, limit)
|
|
||||||
+
|
|
||||||
+def getUsersStats(printserver, begin, end, orderby, sort, limit):
|
|
||||||
+ return Printstats().getUsersStats(printserver, begin, end, orderby, sort, limit)
|
|
||||||
+
|
|
||||||
+def getPrintServers():
|
|
||||||
+ return Printstats().getPrintServers()
|
|
||||||
+
|
|
||||||
+def getPrinterList():
|
|
||||||
+ return Printstats().getPrinterList()
|
|
||||||
+
|
|
||||||
+def getColors(printserver, begin, end):
|
|
||||||
+ return Printstats().getColors(printserver, begin, end)
|
|
||||||
+
|
|
||||||
+class Printstats:
|
|
||||||
+
|
|
||||||
+ def __init__(self, conffile = "/etc/mmc/plugins/printstats.ini"):
|
|
||||||
+ cp = ConfigParser.RawConfigParser()
|
|
||||||
+ cp.read(conffile)
|
|
||||||
+ self.dbhost = cp.get("main", "dbhost")
|
|
||||||
+ self.dbport = cp.get("main", "dbport")
|
|
||||||
+ self.dbname = cp.get("main", "dbname")
|
|
||||||
+ self.dbuser = cp.get("main", "dbuser")
|
|
||||||
+ self.dbpasswd = cp.get("main", "dbpasswd")
|
|
||||||
+ self.sql = {}
|
|
||||||
+ for option in cp.options("sql"):
|
|
||||||
+ self.sql[option] = cp.get("sql", option)
|
|
||||||
+
|
|
||||||
+ def _getCursor(self):
|
|
||||||
+ l = logging.getLogger()
|
|
||||||
+ l.debug("Connecting to dbname=%s user=%s password=%s host=%s port=%s" % (self.dbname, self.dbuser, self.dbpasswd, self.dbhost, self.dbport))
|
|
||||||
+ self.db = psycopg.connect("dbname=%s user=%s password=%s host=%s port=%s" % (self.dbname, self.dbuser, self.dbpasswd, self.dbhost, self.dbport))
|
|
||||||
+ return self.db.cursor()
|
|
||||||
+
|
|
||||||
+ def _prepareData(self, data):
|
|
||||||
+ ret = []
|
|
||||||
+ for item in data:
|
|
||||||
+ if not None in item: ret.append(item)
|
|
||||||
+ else:
|
|
||||||
+ new = ()
|
|
||||||
+ for i in item:
|
|
||||||
+ if i == None: new = new + (0,)
|
|
||||||
+ else: new = new + (i,)
|
|
||||||
+ ret.append(new)
|
|
||||||
+ return ret
|
|
||||||
+
|
|
||||||
+ def _printServerQuery(self, printserver, where = False):
|
|
||||||
+ if printserver == "ALL": ret = "%"
|
|
||||||
+ else: ret = printserver
|
|
||||||
+ return ret
|
|
||||||
+
|
|
||||||
+ def getHistory(self, printserver, days):
|
|
||||||
+ c = self._getCursor()
|
|
||||||
+ d = {}
|
|
||||||
+ d["days"] = days
|
|
||||||
+ d["printserver"] = self._printServerQuery(printserver)
|
|
||||||
+ c.execute(self.sql["history"] % d)
|
|
||||||
+ ret = c.fetchall()
|
|
||||||
+ self.db.close()
|
|
||||||
+ return ret
|
|
||||||
+
|
|
||||||
+ def getHistoryByMonths(self, printserver, days):
|
|
||||||
+ c = self._getCursor()
|
|
||||||
+ d = {}
|
|
||||||
+ d["days"] = days
|
|
||||||
+ d["printserver"] = self._printServerQuery(printserver)
|
|
||||||
+ c.execute(self.sql["historybymonth"] % d)
|
|
||||||
+ ret = c.fetchall()
|
|
||||||
+ self.db.close()
|
|
||||||
+ return ret
|
|
||||||
+
|
|
||||||
+ def getPrintersStats(self, printserver, begin, end, orderby, sort, limit):
|
|
||||||
+ c = self._getCursor()
|
|
||||||
+ d = {}
|
|
||||||
+ d["begin"] = begin
|
|
||||||
+ d["end"] = end
|
|
||||||
+ d["printserver"] = self._printServerQuery(printserver)
|
|
||||||
+ d["orderby"] = orderby
|
|
||||||
+ d["sort"] = sort
|
|
||||||
+ d["limit"] = limit
|
|
||||||
+ c.execute(self.sql["printers"] % d)
|
|
||||||
+ result = c.fetchall()
|
|
||||||
+ self.db.close()
|
|
||||||
+ return self._prepareData(result)
|
|
||||||
+
|
|
||||||
+ def getUsersStats(self, printserver, begin, end, orderby, sort, limit):
|
|
||||||
+ c = self._getCursor()
|
|
||||||
+ d = {}
|
|
||||||
+ d["begin"] = begin
|
|
||||||
+ d["end"] = end
|
|
||||||
+ d["printserver"] = self._printServerQuery(printserver)
|
|
||||||
+ d["orderby"] = orderby
|
|
||||||
+ d["sort"] = sort
|
|
||||||
+ d["limit"] = limit
|
|
||||||
+ c.execute(self.sql["users"] % d)
|
|
||||||
+ ret = c.fetchall()
|
|
||||||
+ self.db.close()
|
|
||||||
+ return self._prepareData(ret)
|
|
||||||
+
|
|
||||||
+ def getPrinterStats(self, printserver, printer, begin, end, lim1, lim2, lim3, lim4, lim5):
|
|
||||||
+ c = self._getCursor()
|
|
||||||
+ d = {}
|
|
||||||
+ d["printserver"] = self._printServerQuery(printserver, True)
|
|
||||||
+ d["printer"] = printer
|
|
||||||
+ d["begin"] = begin
|
|
||||||
+ d["end"] = end
|
|
||||||
+ d["lim1"] = lim1
|
|
||||||
+ d["lim2"] = lim2
|
|
||||||
+ d["lim3"] = lim3
|
|
||||||
+ d["lim4"] = lim4
|
|
||||||
+ d["lim5"] = lim5
|
|
||||||
+ c.execute(self.sql["printer"] % d)
|
|
||||||
+ ret = c.fetchall()
|
|
||||||
+ self.db.close()
|
|
||||||
+ return self._prepareData(ret)
|
|
||||||
+
|
|
||||||
+ def getUsersStatsForPrinter(self, printserver, printer, begin, end, orderby, sort, limit):
|
|
||||||
+ d = {}
|
|
||||||
+ d["printserver"] = self._printServerQuery(printserver)
|
|
||||||
+ d["printer"] = printer
|
|
||||||
+ d["begin"] = begin
|
|
||||||
+ d["end"] = end
|
|
||||||
+ d["orderby"] = orderby
|
|
||||||
+ d["sort"] = sort
|
|
||||||
+ d["limit"] = limit
|
|
||||||
+ c = self._getCursor()
|
|
||||||
+ c.execute(self.sql["user4printer"] % d)
|
|
||||||
+ ret = c.fetchall()
|
|
||||||
+ self.db.close()
|
|
||||||
+ return self._prepareData(ret)
|
|
||||||
+
|
|
||||||
+ def getPrintServers(self):
|
|
||||||
+ c = self._getCursor()
|
|
||||||
+ c.execute(self.sql["printservers"])
|
|
||||||
+ ret = c.fetchall()
|
|
||||||
+ self.db.close()
|
|
||||||
+ return self._prepareData(ret)
|
|
||||||
+
|
|
||||||
+ def getPrinterList(self):
|
|
||||||
+ c = self._getCursor()
|
|
||||||
+ c.execute(self.sql["printerlist"])
|
|
||||||
+ ret = c.fetchall()
|
|
||||||
+ self.db.close()
|
|
||||||
+ return self._prepareData(ret)
|
|
||||||
+
|
|
||||||
+ def getColors(self, printserver, begin, end):
|
|
||||||
+ d = {}
|
|
||||||
+ d["printserver"] = self._printServerQuery(printserver)
|
|
||||||
+ d["begin"] = begin
|
|
||||||
+ d["end"] = end
|
|
||||||
+ c = self._getCursor()
|
|
||||||
+ c.execute(self.sql["colors"] % d)
|
|
||||||
+ ret = c.fetchall()
|
|
||||||
+ self.db.close()
|
|
||||||
+ return self._prepareData(ret)
|
|
||||||
+
|
|
||||||
diff -Naur mmc-agent-2.3.2.orig/setup.py mmc-agent-2.3.2/setup.py
|
|
||||||
--- mmc-agent-2.3.2.orig/setup.py 2007-09-10 08:20:59.000000000 +0000
|
|
||||||
+++ mmc-agent-2.3.2/setup.py 2009-01-15 16:32:36.811050501 +0000
|
|
||||||
@@ -8,5 +8,5 @@
|
|
||||||
author_email = "cdelfosse@mandriva.com",
|
|
||||||
maintainer = "Cedric Delfosse",
|
|
||||||
maintainer_email = "cdelfosse@mandriva.com",
|
|
||||||
- packages = ["mmc", "mmc.support", "mmc.plugins", "mmc.plugins.base", "mmc.plugins.samba", "mmc.plugins.proxy", "mmc.plugins.mail", "mmc.plugins.network", "mmc.plugins.kerberos"],
|
|
||||||
+ packages = ["mmc", "mmc.support", "mmc.plugins", "mmc.plugins.base", "mmc.plugins.samba", "mmc.plugins.proxy", "mmc.plugins.mail", "mmc.plugins.network", "mmc.plugins.kerberos", "mmc.plugins.printstats", "mmc.plugins.printing"],
|
|
||||||
)
|
|
@ -1,676 +0,0 @@
|
|||||||
Submitted By: Mario Fetka (geos_one) (mario dot fetka at gmail dot com)
|
|
||||||
Date: 2010-01-29
|
|
||||||
Initial Package Version: 2.3.2
|
|
||||||
Origin: https://ml.mandriva.net/wws/arc/mds-devel/2010-01/msg00007.html
|
|
||||||
Upstream Status: unknown
|
|
||||||
Description: Add the userquota plugin
|
|
||||||
|
|
||||||
diff -Naur mmc-agent-2.3.2.orig/conf/plugins/userquota.ini mmc-agent-2.3.2/conf/plugins/userquota.ini
|
|
||||||
--- mmc-agent-2.3.2.orig/conf/plugins/userquota.ini 1970-01-01 00:00:00.000000000 +0000
|
|
||||||
+++ mmc-agent-2.3.2/conf/plugins/userquota.ini 2010-01-15 06:19:24.000000000 +0000
|
|
||||||
@@ -0,0 +1,19 @@
|
|
||||||
+[main]
|
|
||||||
+disable = 0
|
|
||||||
+
|
|
||||||
+[diskquota]
|
|
||||||
+enable = 1
|
|
||||||
+# block size found using dumpe2fs -h /dev/vda1 | awk '/Block size:/ { print $3 }'
|
|
||||||
+
|
|
||||||
+# devicemap format: device:blocksize:displayname, ...
|
|
||||||
+devicemap = /dev/vda1:4096:Test Root,/dev/mapper/home:4096:Home dir
|
|
||||||
+softquotablocks = 0.95
|
|
||||||
+softquotainodes = 0.95
|
|
||||||
+inodesperblock = 1.60
|
|
||||||
+
|
|
||||||
+setquotascript = echo /usr/sbin/setquota $uid $softblocks $blocks $softinodes $inodes $devicepath
|
|
||||||
+delquotascript = echo /usr/sbin/setquota $uid 0 0 0 0 $devicepath
|
|
||||||
+
|
|
||||||
+[networkquota]
|
|
||||||
+enable = 1
|
|
||||||
+networkmap = Internet:0.0.0.0/0:any
|
|
||||||
diff -Naur mmc-agent-2.3.2.orig/contrib/ldap/quota.schema mmc-agent-2.3.2/contrib/ldap/quota.schema
|
|
||||||
--- mmc-agent-2.3.2.orig/contrib/ldap/quota.schema 1970-01-01 00:00:00.000000000 +0000
|
|
||||||
+++ mmc-agent-2.3.2/contrib/ldap/quota.schema 2010-01-25 02:16:23.000000000 +0000
|
|
||||||
@@ -0,0 +1,30 @@
|
|
||||||
+##
|
|
||||||
+## schema file for Unix Quotas
|
|
||||||
+## Schema for storing Unix Quotas in LDAP
|
|
||||||
+## OIDs are owned by Cogent Innovators, LLC
|
|
||||||
+##
|
|
||||||
+## 1.3.6.1.4.1.19937.1.1.x - attributetypes
|
|
||||||
+## 1.3.6.1.4.1.19937.1.2.x - objectclasses
|
|
||||||
+##
|
|
||||||
+
|
|
||||||
+attributetype ( 1.3.6.1.4.1.19937.1.1.1 NAME 'quota'
|
|
||||||
+ DESC 'Quotas (FileSystem:BlocksSoft,BlocksHard,InodesSoft,InodesHard)'
|
|
||||||
+ EQUALITY caseIgnoreIA5Match
|
|
||||||
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{255} )
|
|
||||||
+
|
|
||||||
+attributetype ( 1.3.6.1.4.1.19937.1.1.2 NAME 'networkquota'
|
|
||||||
+ DESC 'Network Quotas (network,protocol,bytes)'
|
|
||||||
+ EQUALITY caseIgnoreIA5Match
|
|
||||||
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{255} )
|
|
||||||
+
|
|
||||||
+objectclass ( 1.3.6.1.4.1.19937.1.2.1 NAME 'systemQuotas' SUP posixAccount AUXILIARY
|
|
||||||
+ DESC 'System Quotas'
|
|
||||||
+ MUST ( uid )
|
|
||||||
+ MAY ( quota $ networkquota ))
|
|
||||||
+
|
|
||||||
+objectclass ( 1.3.6.1.4.1.19937.1.2.2 NAME 'defaultQuotas'
|
|
||||||
+ DESC 'Quota defaults to apply to members of a group'
|
|
||||||
+ SUP top AUXILIARY
|
|
||||||
+ MUST ( cn )
|
|
||||||
+ MAY ( quota $ networkquota ))
|
|
||||||
+
|
|
||||||
diff -Naur mmc-agent-2.3.2.orig/contrib/userquota/README mmc-agent-2.3.2/contrib/userquota/README
|
|
||||||
--- mmc-agent-2.3.2.orig/contrib/userquota/README 1970-01-01 00:00:00.000000000 +0000
|
|
||||||
+++ mmc-agent-2.3.2/contrib/userquota/README 2010-01-26 00:41:24.000000000 +0000
|
|
||||||
@@ -0,0 +1,51 @@
|
|
||||||
+# (c) 2009 OSS - Glen Ogilvie
|
|
||||||
+# License: GPLv2 or above
|
|
||||||
+
|
|
||||||
+Description: Mandriva Directory Server plugin to store disk and network quotas in OpenLDAP and manage them
|
|
||||||
+using MDS. It provides multiple quotas for both, mapped from the configuration file. It also supports turning
|
|
||||||
+off either disk or network quotas if you only wish to quota one of them.
|
|
||||||
+
|
|
||||||
+This plugin also supports setting quotas for all the members of a group. This can be done by browsing to the
|
|
||||||
+group list in MDS and using the edit group action. It also allows you to set quotas per individual, although these
|
|
||||||
+are reset when you perform a group action.
|
|
||||||
+
|
|
||||||
+When quotas are set for a member of the group, the object classes of that member will be updated to include the systemQuotas schema.
|
|
||||||
+The group will also have an additional object class added to store the defaults for that group.
|
|
||||||
+
|
|
||||||
+New members of the group do not currently get the group default quotas assigned but may do in the future.
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+Installation:
|
|
||||||
+cp ./etc/mmc/plugins/userquota.ini /etc/mmc/plugins/
|
|
||||||
+cp -r ./mmc-python/plugins/userquota /usr/lib64/python2.6/site-packages/mmc/plugins/
|
|
||||||
+cp -r ./mmc-web/modules/userquota /usr/share/mmc/modules/
|
|
||||||
+cp ./etc/openldap/schema/quota.schema /etc/openldap/schema
|
|
||||||
+
|
|
||||||
+Edit: /etc/openldap/schema/local.schema
|
|
||||||
+insert line: include /etc/openldap/schema/quota.schema
|
|
||||||
+restart slapd.
|
|
||||||
+
|
|
||||||
+Configuration:
|
|
||||||
+Edit: /etc/mmc/plugins/userquota.ini
|
|
||||||
+
|
|
||||||
+Configuration options: diskquota
|
|
||||||
+devicemap
|
|
||||||
+ - This maps your physical device that will have the quota applied to a nice human readable name and also includes the block size of the disk
|
|
||||||
+ used for calculation of megabytes.
|
|
||||||
+
|
|
||||||
+softquotablocks, softquotainodes, inodesperblock
|
|
||||||
+ - multipliers for the values passed to the quota command.
|
|
||||||
+
|
|
||||||
+setquotascript, delquotascript
|
|
||||||
+ - system command to run.. Note that in example, these are echo statements so they do nothing
|
|
||||||
+
|
|
||||||
+Configuration options: networkquota
|
|
||||||
+networkmap
|
|
||||||
+ - this maps the name of a network to a subnet and protocol. How the subnet and protocol are processed is up to whatever is reading the network
|
|
||||||
+ - quota values from each user. In my case, a custom script will read these and use them with TC for rate limiting.
|
|
||||||
+
|
|
||||||
+Documentation:
|
|
||||||
+@todo
|
|
||||||
+
|
|
||||||
+Bugs:
|
|
||||||
+Currently, when network operations on large groups are done, an ldap error is presented part way thru the operation. I have not yet discovered why.
|
|
||||||
diff -Naur mmc-agent-2.3.2.orig/mmc/plugins/userquota/__init__.py mmc-agent-2.3.2/mmc/plugins/userquota/__init__.py
|
|
||||||
--- mmc-agent-2.3.2.orig/mmc/plugins/userquota/__init__.py 1970-01-01 00:00:00.000000000 +0000
|
|
||||||
+++ mmc-agent-2.3.2/mmc/plugins/userquota/__init__.py 2010-01-28 20:52:43.000000000 +0000
|
|
||||||
@@ -0,0 +1,543 @@
|
|
||||||
+# -*- coding: utf-8; -*-
|
|
||||||
+# (c) 2009 Open Systems Specilists - Glen Ogilvie
|
|
||||||
+#
|
|
||||||
+# $Id: __init__.py $
|
|
||||||
+#
|
|
||||||
+# This file is a plugin for Mandriva Management Console (MMC).
|
|
||||||
+#
|
|
||||||
+# MMC is free software; you can redistribute it and/or modify
|
|
||||||
+# it under the terms of the GNU General Public License as published by
|
|
||||||
+# the Free Software Foundation; either version 2 of the License, or
|
|
||||||
+# (at your option) any later version.
|
|
||||||
+#
|
|
||||||
+# MMC is distributed 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 General Public License for more details.
|
|
||||||
+#
|
|
||||||
+# You should have received a copy of the GNU General Public License
|
|
||||||
+# along with MMC; if not, write to the Free Software
|
|
||||||
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
+
|
|
||||||
+import socket
|
|
||||||
+import ldap
|
|
||||||
+import logging
|
|
||||||
+import os
|
|
||||||
+import os.path
|
|
||||||
+import grp
|
|
||||||
+
|
|
||||||
+from mmc.plugins.base import ldapUserGroupControl
|
|
||||||
+from mmc.support.config import *
|
|
||||||
+from mmc.support import mmctools
|
|
||||||
+from string import Template
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+import mmc
|
|
||||||
+
|
|
||||||
+INI = "/etc/mmc/plugins/userquota.ini"
|
|
||||||
+
|
|
||||||
+VERSION = "0.0.2"
|
|
||||||
+APIVERSION = "1:0:0"
|
|
||||||
+REVISION = int("$Rev: 1 $".split(':')[1].strip(' $'))
|
|
||||||
+
|
|
||||||
+def getVersion(): return VERSION
|
|
||||||
+def getApiVersion(): return APIVERSION
|
|
||||||
+def getRevision(): return REVISION
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+def activate():
|
|
||||||
+ return True
|
|
||||||
+
|
|
||||||
+def getActiveComponents():
|
|
||||||
+ return UserQuotaControl().getActiveComponents()
|
|
||||||
+
|
|
||||||
+def getDevicemap():
|
|
||||||
+ return UserQuotaControl().getDevicemap()
|
|
||||||
+
|
|
||||||
+def getNetworkmap():
|
|
||||||
+ return UserQuotaControl().getNetworkmap()
|
|
||||||
+
|
|
||||||
+def setDiskQuota(uid, device, quota):
|
|
||||||
+ return UserQuotaControl().setDiskQuota(uid, device, quota)
|
|
||||||
+
|
|
||||||
+def setNetworkQuota(uid, network, quota):
|
|
||||||
+ return UserQuotaControl().setNetworkQuota(uid, network, quota)
|
|
||||||
+
|
|
||||||
+def setGroupDiskQuota(group, device, quota, overwrite):
|
|
||||||
+ return UserQuotaControl().setGroupDiskQuota(group, device, quota, overwrite)
|
|
||||||
+
|
|
||||||
+def deleteGroupDiskQuota(cn, device):
|
|
||||||
+ return UserQuotaControl().deleteGroupDiskQuotas(cn, device)
|
|
||||||
+
|
|
||||||
+def setGroupNetworkQuota(group, network, quota, overwrite):
|
|
||||||
+ return UserQuotaControl().setGroupNetworkQuota(group, network, quota, overwrite)
|
|
||||||
+
|
|
||||||
+def deleteGroupNetworkQuota(cn, device):
|
|
||||||
+ return UserQuotaControl().deleteGroupNetworkQuotas(cn, device)
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+def deleteDiskQuota(uid, device):
|
|
||||||
+ return UserQuotaControl().deleteDiskQuota(uid, device)
|
|
||||||
+
|
|
||||||
+def deleteNetworkQuota(uid, network):
|
|
||||||
+ return UserQuotaControl().deleteNetworkQuota(uid, network)
|
|
||||||
+
|
|
||||||
+def setUserQuotaDefaults(user, group):
|
|
||||||
+ return UserQuotaControl().setUserQuotaDefaults(user, group)
|
|
||||||
+
|
|
||||||
+class UserQuotaConfig(PluginConfig):
|
|
||||||
+
|
|
||||||
+ def readConf(self):
|
|
||||||
+ PluginConfig.readConf(self)
|
|
||||||
+ try: self.diskquotaenable = self.getboolean("diskquota", "enable")
|
|
||||||
+ except: pass
|
|
||||||
+ try: self.networkquotaenable = self.getboolean("networkquota", "enable")
|
|
||||||
+ except: pass
|
|
||||||
+ self.devicemap = self.get("diskquota", "devicemap").split(',')
|
|
||||||
+ self.inodesperblock = self.getfloat("diskquota", "inodesperblock")
|
|
||||||
+ self.softquotablocks = self.getfloat("diskquota", "softquotablocks")
|
|
||||||
+ self.softquotainodes = self.getfloat("diskquota", "softquotainodes")
|
|
||||||
+ self.setquotascript = self.get("diskquota", "setquotascript")
|
|
||||||
+ self.delquotascript = self.get("diskquota", "delquotascript")
|
|
||||||
+ self.networkmap = self.get("networkquota", "networkmap").split(',')
|
|
||||||
+
|
|
||||||
+ def setDefault(self):
|
|
||||||
+ PluginConfig.setDefault(self)
|
|
||||||
+ self.diskquotaenable = True
|
|
||||||
+ self.networkquotaenable = False
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+class UserQuotaControl(ldapUserGroupControl):
|
|
||||||
+ def __init__(self, conffile=None, conffilebase=None):
|
|
||||||
+ mmc.plugins.base.ldapUserGroupControl.__init__(self, conffilebase)
|
|
||||||
+ self.configuserquota = UserQuotaConfig("userquota", conffile)
|
|
||||||
+ def getDevicemap(self):
|
|
||||||
+ return self.configuserquota.devicemap
|
|
||||||
+ def getNetworkmap(self):
|
|
||||||
+ return self.configuserquota.networkmap
|
|
||||||
+ def getActiveComponents(self):
|
|
||||||
+ return ({"disk":self.configuserquota.diskquotaenable, "network":self.configuserquota.networkquotaenable})
|
|
||||||
+
|
|
||||||
+ def deleteNetworkQuota(self, uid, network):
|
|
||||||
+ logger = logging.getLogger()
|
|
||||||
+ try:
|
|
||||||
+ currentquotas = self.getDetailedUser(uid)["networkquota"]
|
|
||||||
+ newquotas = []
|
|
||||||
+ for x in currentquotas:
|
|
||||||
+ if not x.split(',')[0] == network:
|
|
||||||
+ newquotas.append(x)
|
|
||||||
+
|
|
||||||
+ if len(newquotas) == 0:
|
|
||||||
+ self.changeUserAttributes(uid, 'networkquota', None)
|
|
||||||
+ self.delQuotaObjectClass(uid)
|
|
||||||
+
|
|
||||||
+ else:
|
|
||||||
+ self.changeUserAttributes(uid, 'networkquota', newquotas)
|
|
||||||
+
|
|
||||||
+ except KeyError:
|
|
||||||
+ pass
|
|
||||||
+ return True
|
|
||||||
+
|
|
||||||
+ def deleteDiskQuota(self, uid, device):
|
|
||||||
+ logger = logging.getLogger()
|
|
||||||
+# logger.info("Deleting quota for: "+ uid)
|
|
||||||
+ devicepath = device.split(':')[0]
|
|
||||||
+ try:
|
|
||||||
+ currentquotas = self.getDetailedUser(uid)["quota"]
|
|
||||||
+ newquotas = []
|
|
||||||
+ for x in currentquotas:
|
|
||||||
+ if not x.split('=')[0] == devicepath:
|
|
||||||
+ newquotas.append(x)
|
|
||||||
+
|
|
||||||
+ if len(newquotas) == 0:
|
|
||||||
+ self.changeUserAttributes(uid, 'quota', None)
|
|
||||||
+ self.delQuotaObjectClass(uid)
|
|
||||||
+
|
|
||||||
+ else:
|
|
||||||
+ self.changeUserAttributes(uid, 'quota', newquotas)
|
|
||||||
+
|
|
||||||
+ self.deleteQuotaOnFS(uid, devicepath)
|
|
||||||
+
|
|
||||||
+ except KeyError:
|
|
||||||
+ pass
|
|
||||||
+
|
|
||||||
+ return True
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+ def setNetworkQuota(self, uid, network, quota, overwrite = "all"):
|
|
||||||
+ logger = logging.getLogger()
|
|
||||||
+ ldapquota = '%s,%s' % (network, str(int(quota) * 1048576))
|
|
||||||
+ logger.info("Network Quota:" + ldapquota)
|
|
||||||
+
|
|
||||||
+ if not self.hasDiskQuotaObjectClass(uid):
|
|
||||||
+ self.addDiskQuotaObjectClass(uid)
|
|
||||||
+ # @todo, fix copy from disk quotas.
|
|
||||||
+ try:
|
|
||||||
+ userdetails = self.getDetailedUser(uid)
|
|
||||||
+ currentquotas = userdetails["networkquota"]
|
|
||||||
+ newquotas = []
|
|
||||||
+ quotachanged = False
|
|
||||||
+ for x in currentquotas:
|
|
||||||
+ if x.split(',')[0] == network:
|
|
||||||
+ logger.info("Current network quota sizes: " + str(self.convertNetworkQuotaToMB(x)))
|
|
||||||
+ logger.info("Requested quota size: " + quota)
|
|
||||||
+ logger.info("Overwrite mode: " + overwrite)
|
|
||||||
+ if (overwrite == "none"):
|
|
||||||
+ return False
|
|
||||||
+ if overwrite == "smaller" and self.convertNetworkQuotaToMB(x) > int(quota):
|
|
||||||
+ logger.info('Current network quota is bigger than new quota, so not overwriting')
|
|
||||||
+ return False
|
|
||||||
+ if overwrite == "larger" and int(quota) > self.convertNetworkQuotaToMB(x):
|
|
||||||
+ logger.info('Current network quota is smaller than new quota, so not overwriting')
|
|
||||||
+ return False
|
|
||||||
+ newquotas.append(ldapquota)
|
|
||||||
+ quotachanged = True
|
|
||||||
+ else:
|
|
||||||
+ newquotas.append(x)
|
|
||||||
+
|
|
||||||
+ if not quotachanged:
|
|
||||||
+ newquotas.append(ldapquota)
|
|
||||||
+
|
|
||||||
+ self.changeUserAttributes(uid, 'networkquota', newquotas)
|
|
||||||
+ except KeyError:
|
|
||||||
+ self.changeUserAttributes(uid, 'networkquota', ldapquota)
|
|
||||||
+ pass
|
|
||||||
+
|
|
||||||
+ return True
|
|
||||||
+
|
|
||||||
+ def setDiskQuota(self, uid, device, quota, overwrite = "all"):
|
|
||||||
+ logger = logging.getLogger()
|
|
||||||
+ logger.info("received quota for " + uid + ", device: " + device + ", size: " + quota)
|
|
||||||
+ blocks = self.convertMBtoBlocks(quota, device);
|
|
||||||
+ softblocks = int (blocks * self.configuserquota.softquotablocks)
|
|
||||||
+ inodes = int(blocks * self.configuserquota.inodesperblock)
|
|
||||||
+ softinodes = int(inodes * self.configuserquota.softquotainodes)
|
|
||||||
+ devicepath = device.split(':')[0]
|
|
||||||
+# logger.info("Devicepath: " + devicepath)
|
|
||||||
+# logger.info("Blocks: " + str(blocks))
|
|
||||||
+# logger.info("Soft Blocks: " + str(softblocks))
|
|
||||||
+# logger.info("Inodes: " + str(inodes))
|
|
||||||
+# logger.info("Soft Inodes: " + str(softinodes))
|
|
||||||
+ self.applyQuotaToFS(uid, blocks, softblocks, inodes, softinodes, devicepath)
|
|
||||||
+ ldapquota = '%s=%s:%s:%s:%s' % (devicepath, str(blocks), str(softblocks), str(inodes), str(softinodes))
|
|
||||||
+ logger.info("Quota for: " + uid + " - " + ldapquota)
|
|
||||||
+
|
|
||||||
+ if not self.hasDiskQuotaObjectClass(uid):
|
|
||||||
+ self.addDiskQuotaObjectClass(uid)
|
|
||||||
+
|
|
||||||
+ try:
|
|
||||||
+ userdetails = self.getDetailedUser(uid)
|
|
||||||
+ currentquotas = userdetails["quota"]
|
|
||||||
+ newquotas = []
|
|
||||||
+ quotachanged = False
|
|
||||||
+ for x in currentquotas:
|
|
||||||
+ if x.split('=')[0] == devicepath:
|
|
||||||
+ logger.info("Current network quota sizes: " + str(self.convertDiskQuotaToMB(x)))
|
|
||||||
+ logger.info("Requested quota size: " + quota)
|
|
||||||
+ logger.info("Overwrite mode: " + overwrite)
|
|
||||||
+ if overwrite == "none":
|
|
||||||
+ return False
|
|
||||||
+ if overwrite == "smaller" and self.convertDiskQuotaToMB(x) > int(quota):
|
|
||||||
+ logger.info('Current quota is bigger than new quota, so not overwriting')
|
|
||||||
+ return False
|
|
||||||
+ if overwrite == "larger" and int(quota) > self.convertDiskQuotaToMB(x):
|
|
||||||
+ logger.info('Current quota is smaller than new quota, so not overwriting')
|
|
||||||
+ return False
|
|
||||||
+
|
|
||||||
+ newquotas.append(ldapquota)
|
|
||||||
+ quotachanged = True
|
|
||||||
+ else:
|
|
||||||
+ newquotas.append(x)
|
|
||||||
+
|
|
||||||
+ if not quotachanged:
|
|
||||||
+ newquotas.append(ldapquota)
|
|
||||||
+
|
|
||||||
+ self.changeUserAttributes(uid, 'quota', newquotas)
|
|
||||||
+ except KeyError:
|
|
||||||
+ self.changeUserAttributes(uid, 'quota', ldapquota)
|
|
||||||
+ pass
|
|
||||||
+
|
|
||||||
+ return True
|
|
||||||
+
|
|
||||||
+ def applyQuotaToFS(self, uid, blocks, softblocks, inodes, softinodes, devicepath):
|
|
||||||
+ logger = logging.getLogger()
|
|
||||||
+ s = Template(self.configuserquota.setquotascript)
|
|
||||||
+ shellscript = s.substitute(uid=uid, blocks=blocks, softblocks=softblocks, inodes=inodes, softinodes=softinodes, devicepath=devicepath)
|
|
||||||
+ logger.info("SetQuotaScript: " + shellscript);
|
|
||||||
+ def cb(shprocess):
|
|
||||||
+ # The callback just return the process outputs
|
|
||||||
+ logger.info("shell result:" + shprocess.out)
|
|
||||||
+ return shprocess.exitCode, shprocess.out, shprocess.err
|
|
||||||
+ d = mmctools.shLaunchDeferred(shellscript)
|
|
||||||
+ # shLaunchDeferred returns a Deferred() object
|
|
||||||
+ # We add the cb function as a callback
|
|
||||||
+ d.addCallback(cb)
|
|
||||||
+ # We return the Deferred() object
|
|
||||||
+ return d
|
|
||||||
+
|
|
||||||
+ def deleteQuotaOnFS(self, uid, devicepath):
|
|
||||||
+ logger = logging.getLogger()
|
|
||||||
+ s = Template(self.configuserquota.delquotascript)
|
|
||||||
+ shellscript = s.substitute(uid=uid, devicepath=devicepath)
|
|
||||||
+ logger.info("DelQuotaScript: " + shellscript);
|
|
||||||
+ def cb(shprocess):
|
|
||||||
+ # The callback just return the process outputs
|
|
||||||
+ logger.info("shell result:" + shprocess.out)
|
|
||||||
+ return shprocess.exitCode, shprocess.out, shprocess.err
|
|
||||||
+ d = mmctools.shLaunchDeferred(shellscript)
|
|
||||||
+ # shLaunchDeferred returns a Deferred() object
|
|
||||||
+ # We add the cb function as a callback
|
|
||||||
+ d.addCallback(cb)
|
|
||||||
+ # We return the Deferred() object
|
|
||||||
+ return d
|
|
||||||
+
|
|
||||||
+ def convertMBtoBlocks(self, quota, device):
|
|
||||||
+ parts = device.split(':')
|
|
||||||
+ blocks = int(parts[1])
|
|
||||||
+ bytes = int(quota) * 1048576
|
|
||||||
+ return int(bytes / blocks)
|
|
||||||
+
|
|
||||||
+ def convertNetworkQuotaToMB(self, quota):
|
|
||||||
+ return int(quota.split(',')[1])/1048576
|
|
||||||
+
|
|
||||||
+ def convertDiskQuotaToMB(self,quota):
|
|
||||||
+ devicemap = self.getDevicemap()
|
|
||||||
+ devicepath = quota.split('=')[0]
|
|
||||||
+ for x in devicemap:
|
|
||||||
+ if x.split(':')[0] == devicepath:
|
|
||||||
+ return int(quota.split('=')[1].split(":")[0]) * int(x.split(':')[1]) / 1048576
|
|
||||||
+ return False
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+ def hasDiskQuotaObjectClass(self, uid):
|
|
||||||
+ """
|
|
||||||
+ Return true if the user owns the systemQuotas objectClass.
|
|
||||||
+
|
|
||||||
+ @param uid: user name
|
|
||||||
+ @type uid: str
|
|
||||||
+
|
|
||||||
+ @return: return True if the user owns the mailAccount objectClass.
|
|
||||||
+ @rtype: boolean
|
|
||||||
+ """
|
|
||||||
+ return "systemQuotas" in self.getDetailedUser(uid)["objectClass"]
|
|
||||||
+
|
|
||||||
+ def delQuotaObjectClass(self, uid):
|
|
||||||
+ """
|
|
||||||
+ Return true if the objectClass is removed.
|
|
||||||
+
|
|
||||||
+ @return: return True if the object class is able to be removed
|
|
||||||
+ @rtype: boolean
|
|
||||||
+ """
|
|
||||||
+ logger = logging.getLogger()
|
|
||||||
+ user = self.getDetailedUser(uid)
|
|
||||||
+ logger.info("Del object class")
|
|
||||||
+
|
|
||||||
+ if "quota" in user.keys() or "networkquota" in user.keys():
|
|
||||||
+ return False
|
|
||||||
+
|
|
||||||
+ logger.info("Del object class removal")
|
|
||||||
+ if "systemQuotas" in user["objectClass"]:
|
|
||||||
+ user["objectClass"].remove("systemQuotas")
|
|
||||||
+ self.changeUserAttributes(uid, 'objectClass', user["objectClass"])
|
|
||||||
+ return True
|
|
||||||
+ return False
|
|
||||||
+
|
|
||||||
+ def delGroupQuotaObjectClass(self, cn):
|
|
||||||
+ """
|
|
||||||
+ Return true if the objectClass is removed.
|
|
||||||
+
|
|
||||||
+ @return: return True if the object class is able to be removed
|
|
||||||
+ @rtype: boolean
|
|
||||||
+ """
|
|
||||||
+ logger = logging.getLogger()
|
|
||||||
+ group = self.getDetailedGroup(cn)
|
|
||||||
+ logger.info("Del Group object class")
|
|
||||||
+ logger.info("group keys" + str(group.keys()))
|
|
||||||
+ if "quota" in group.keys() or "networkquota" in group.keys():
|
|
||||||
+ return False
|
|
||||||
+
|
|
||||||
+ logger.info("Del object class removal")
|
|
||||||
+ if "defaultQuotas" in group["objectClass"]:
|
|
||||||
+ group["objectClass"].remove("defaultQuotas")
|
|
||||||
+ logger.info("ObjectClass to save:" + str( group["objectClass"]) )
|
|
||||||
+ self.changeGroupAttribute(cn, 'objectClass', group["objectClass"])
|
|
||||||
+ return True
|
|
||||||
+ return False
|
|
||||||
+
|
|
||||||
+ def addDiskQuotaObjectClass(self, uid):
|
|
||||||
+ user = self.getDetailedUser(uid)['objectClass']
|
|
||||||
+ if not "systemQuotas" in user:
|
|
||||||
+ user.append("systemQuotas")
|
|
||||||
+ self.l.modify_s('uid=' + uid + ',' + self.baseUsersDN, [(ldap.MOD_REPLACE, 'objectClass', user)])
|
|
||||||
+ return True
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+ def setGroupDiskQuota(self, group, device, quota, overwrite):
|
|
||||||
+ logger = logging.getLogger()
|
|
||||||
+ logger.info("SetGroupDiskQuota: Overwrite mode: " + overwrite)
|
|
||||||
+ logger.info("ldap timeout:" + str(self.l.timeout))
|
|
||||||
+ self.l.set_option(ldap.OPT_NETWORK_TIMEOUT, 100)
|
|
||||||
+ logger.info("ldap network timeout:" + str(self.l.get_option(ldap.OPT_NETWORK_TIMEOUT)))
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+ self.addGroupDefaultDiskQuotaObjectClass(group)
|
|
||||||
+
|
|
||||||
+ blocks = self.convertMBtoBlocks(quota, device);
|
|
||||||
+ softblocks = int (blocks * self.configuserquota.softquotablocks)
|
|
||||||
+ inodes = int(blocks * self.configuserquota.inodesperblock)
|
|
||||||
+ softinodes = int(inodes * self.configuserquota.softquotainodes)
|
|
||||||
+ devicepath = device.split(':')[0]
|
|
||||||
+ ldapquota = '%s=%s:%s:%s:%s' % (devicepath, str(blocks), str(softblocks), str(inodes), str(softinodes))
|
|
||||||
+ # @todo improve this, it's a copy of set disk quota.
|
|
||||||
+ try:
|
|
||||||
+ currentquotas = self.getDetailedGroup(group)["quota"]
|
|
||||||
+ newquotas = []
|
|
||||||
+ quotachanged = False
|
|
||||||
+ for x in currentquotas:
|
|
||||||
+ if x.split('=')[0] == devicepath:
|
|
||||||
+ newquotas.append(ldapquota)
|
|
||||||
+ quotachanged = True
|
|
||||||
+ else:
|
|
||||||
+ newquotas.append(x)
|
|
||||||
+
|
|
||||||
+ if not quotachanged:
|
|
||||||
+ newquotas.append(ldapquota)
|
|
||||||
+
|
|
||||||
+ self.changeGroupAttribute(group, "quota", newquotas)
|
|
||||||
+
|
|
||||||
+ except KeyError:
|
|
||||||
+ self.changeGroupAttribute(group, "quota", ldapquota)
|
|
||||||
+ pass
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+ for uid in self.getMembers(group):
|
|
||||||
+ self.setDiskQuota(uid, device, quota, overwrite)
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+ return True
|
|
||||||
+
|
|
||||||
+ def setGroupNetworkQuota(self, group, network, quota, overwrite):
|
|
||||||
+ logger = logging.getLogger()
|
|
||||||
+ logger.info("SetGroupNetworkQuota Overwrite mode: " + overwrite)
|
|
||||||
+ self.addGroupDefaultDiskQuotaObjectClass(group)
|
|
||||||
+ ldapquota = '%s,%s' % (network, str(int(quota) * 1048576))
|
|
||||||
+ # @todo improve this, it's a copy of set disk quota.
|
|
||||||
+ try:
|
|
||||||
+ currentquotas = self.getDetailedGroup(group)["networkquota"]
|
|
||||||
+ newquotas = []
|
|
||||||
+ quotachanged = False
|
|
||||||
+ for x in currentquotas:
|
|
||||||
+ if x.split(',')[0] == network:
|
|
||||||
+ newquotas.append(ldapquota)
|
|
||||||
+ quotachanged = True
|
|
||||||
+ else:
|
|
||||||
+ newquotas.append(x)
|
|
||||||
+
|
|
||||||
+ if not quotachanged:
|
|
||||||
+ newquotas.append(ldapquota)
|
|
||||||
+
|
|
||||||
+ self.changeGroupAttribute(group, "networkquota", newquotas)
|
|
||||||
+
|
|
||||||
+ except KeyError:
|
|
||||||
+ self.changeGroupAttribute(group, "networkquota", ldapquota)
|
|
||||||
+ pass
|
|
||||||
+
|
|
||||||
+ for uid in self.getMembers(group):
|
|
||||||
+ self.setNetworkQuota(uid, network, quota, overwrite)
|
|
||||||
+ return True
|
|
||||||
+
|
|
||||||
+ def setUserQuotaDefaults(self, uid, group):
|
|
||||||
+ # @todo: unfinished, does nothing yet.
|
|
||||||
+ logger = logging.getLogger()
|
|
||||||
+ logger.info("Set user quota defaults: user: " + uid + " group: " + group)
|
|
||||||
+ keys = []
|
|
||||||
+ # don't set the quota if one has been set before.
|
|
||||||
+ logger.info(self.getDetailedUser(uid)["objectClass"])
|
|
||||||
+ logger.info("Value of: self.hasDiskQuotaObjectClass(uid)" + str(self.hasDiskQuotaObjectClass(uid)))
|
|
||||||
+ if self.hasDiskQuotaObjectClass(uid):
|
|
||||||
+ logger.info("User already has quota Object class")
|
|
||||||
+ return keys
|
|
||||||
+
|
|
||||||
+ groupdefaults = self.getDetailedGroup(group)
|
|
||||||
+
|
|
||||||
+ # @todo, check components before action
|
|
||||||
+ if "quota" in groupdefaults.keys():
|
|
||||||
+ # copy quota values to user
|
|
||||||
+ logger.info("copy quota values to user:" + uid)
|
|
||||||
+ self.addDiskQuotaObjectClass(uid)
|
|
||||||
+ self.changeUserAttributes(uid, "quota", groupdefaults["quota"])
|
|
||||||
+ keys.append('quota')
|
|
||||||
+
|
|
||||||
+ if "networkquota" in groupdefaults.keys():
|
|
||||||
+ # copy networkquota values to user
|
|
||||||
+ logger.info("copy network quota values to user:" + uid)
|
|
||||||
+ self.addDiskQuotaObjectClass(uid)
|
|
||||||
+ self.changeUserAttributes(uid, "networkquota", groupdefaults["networkquota"])
|
|
||||||
+ keys.append('networkquota')
|
|
||||||
+
|
|
||||||
+ return keys
|
|
||||||
+
|
|
||||||
+ def addGroupDefaultDiskQuotaObjectClass(self, cn):
|
|
||||||
+ group = self.getDetailedGroup(cn)['objectClass']
|
|
||||||
+ if not "defaultQuotas" in group:
|
|
||||||
+ group.append("defaultQuotas")
|
|
||||||
+ self.changeGroupAttribute(cn, 'objectClass', group)
|
|
||||||
+ return True
|
|
||||||
+
|
|
||||||
+ def changeGroupAttribute(self, cn, attr, attrval):
|
|
||||||
+ self.l.modify_s('cn=' + cn + ',' + self.baseGroupsDN, [(ldap.MOD_REPLACE, attr, attrval)])
|
|
||||||
+
|
|
||||||
+ def deleteGroupDiskQuotas(self, cn, device):
|
|
||||||
+ logger = logging.getLogger()
|
|
||||||
+ devicepath = device.split(':')[0]
|
|
||||||
+ logger.info("Delete quotas for members of:" + cn)
|
|
||||||
+ logger.info("ldap timeout:" + str(self.l.timeout))
|
|
||||||
+ self.l.set_option(ldap.OPT_NETWORK_TIMEOUT, 100)
|
|
||||||
+ logger.info("ldap network timeout:" + str(self.l.get_option(ldap.OPT_NETWORK_TIMEOUT)))
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+ for uid in self.getMembers(cn):
|
|
||||||
+ self.deleteDiskQuota(uid, device)
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+ try:
|
|
||||||
+ currentquotas = self.getDetailedGroup(cn)["quota"]
|
|
||||||
+ newquotas = []
|
|
||||||
+ for x in currentquotas:
|
|
||||||
+ if not x.split('=')[0] == devicepath:
|
|
||||||
+ newquotas.append(x)
|
|
||||||
+
|
|
||||||
+ if len(newquotas) == 0:
|
|
||||||
+ self.changeGroupAttribute(cn, 'quota', None)
|
|
||||||
+ self.delGroupQuotaObjectClass(cn)
|
|
||||||
+ else:
|
|
||||||
+ self.changeGroupAttribute(cn, 'quota', newquotas)
|
|
||||||
+
|
|
||||||
+ except KeyError:
|
|
||||||
+ pass
|
|
||||||
+
|
|
||||||
+ return True
|
|
||||||
+
|
|
||||||
+ def deleteGroupNetworkQuotas(self, cn, network):
|
|
||||||
+ logger = logging.getLogger()
|
|
||||||
+ logger.info("Delete networkquotas for members of: " + cn)
|
|
||||||
+ for uid in self.getMembers(cn):
|
|
||||||
+ self.deleteNetworkQuota(uid, network)
|
|
||||||
+ try:
|
|
||||||
+ currentquotas = self.getDetailedGroup(cn)["networkquota"]
|
|
||||||
+ newquotas = []
|
|
||||||
+
|
|
||||||
+ for x in currentquotas:
|
|
||||||
+ if not x.split(',')[0] == network:
|
|
||||||
+ newquotas.append(x)
|
|
||||||
+
|
|
||||||
+ if len(newquotas) == 0:
|
|
||||||
+ self.changeGroupAttribute(cn, 'networkquota', None)
|
|
||||||
+ self.delGroupQuotaObjectClass(cn)
|
|
||||||
+ else:
|
|
||||||
+ self.changeGroupAttribute(cn, 'networkquota', newquotas)
|
|
||||||
+
|
|
||||||
+ except KeyError:
|
|
||||||
+ pass
|
|
||||||
+ return True
|
|
||||||
+
|
|
||||||
diff -Naur mmc-agent-2.3.2.orig/setup.py mmc-agent-2.3.2/setup.py
|
|
||||||
--- mmc-agent-2.3.2.orig/setup.py 2010-01-29 15:50:40.866173716 +0000
|
|
||||||
+++ mmc-agent-2.3.2/setup.py 2010-01-29 15:52:47.926425328 +0000
|
|
||||||
@@ -8,5 +8,5 @@
|
|
||||||
author_email = "cdelfosse@mandriva.com",
|
|
||||||
maintainer = "Cedric Delfosse",
|
|
||||||
maintainer_email = "cdelfosse@mandriva.com",
|
|
||||||
- packages = ["mmc", "mmc.support", "mmc.plugins", "mmc.plugins.base", "mmc.plugins.samba", "mmc.plugins.proxy", "mmc.plugins.mail", "mmc.plugins.network", "mmc.plugins.kerberos", "mmc.plugins.printstats", "mmc.plugins.printing"],
|
|
||||||
+ packages = ["mmc", "mmc.support", "mmc.plugins", "mmc.plugins.base", "mmc.plugins.samba", "mmc.plugins.proxy", "mmc.plugins.mail", "mmc.plugins.network", "mmc.plugins.kerberos", "mmc.plugins.printstats", "mmc.plugins.printing", "mmc.plugins.userquota"],
|
|
||||||
)
|
|
File diff suppressed because it is too large
Load Diff
@ -1,20 +0,0 @@
|
|||||||
#!/sbin/runscript
|
|
||||||
# Copyright 1999-2007 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: $
|
|
||||||
|
|
||||||
depend() {
|
|
||||||
need net slapd
|
|
||||||
}
|
|
||||||
|
|
||||||
start() {
|
|
||||||
ebegin "Starting mmc-agent"
|
|
||||||
eval start-stop-daemon --start --quiet --exec /usr/sbin/mmc-agent --pidfile /var/run/mmc-agent.pid
|
|
||||||
eend $?
|
|
||||||
}
|
|
||||||
|
|
||||||
stop() {
|
|
||||||
ebegin "Stopping mmc-agent"
|
|
||||||
start-stop-daemon --stop --quiet --pidfile /var/run/mmc-agent.pid
|
|
||||||
eend $?
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
|
||||||
<pkgmetadata>
|
|
||||||
<herd>maintainer-wanted</herd>
|
|
||||||
</pkgmetadata>
|
|
@ -1,57 +0,0 @@
|
|||||||
# Copyright 1999-2010 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: $
|
|
||||||
|
|
||||||
inherit distutils
|
|
||||||
|
|
||||||
DESCRIPTION="The MMC Agent and its Python plugins."
|
|
||||||
HOMEPAGE="http://mds.mandriva.org/"
|
|
||||||
SRC_URI="http://mds.mandriva.org/pub/mds/sources/${PV}/${P}.tar.gz"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
KEYWORDS="~alpha ~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
|
|
||||||
IUSE=""
|
|
||||||
|
|
||||||
SLOT="0"
|
|
||||||
|
|
||||||
RDEPEND=">=dev-python/twisted-web-0.7.0
|
|
||||||
>=dev-python/python-ldap-2.2.1
|
|
||||||
>=dev-python/psycopg-2.0.2"
|
|
||||||
|
|
||||||
DEPEND=">=dev-python/setuptools-0.6_rc1"
|
|
||||||
|
|
||||||
src_unpack() {
|
|
||||||
unpack ${A}
|
|
||||||
cd "${S}"
|
|
||||||
epatch "${FILESDIR}"/${PN}-2.3.1-kerberos-1.patch
|
|
||||||
epatch "${FILESDIR}"/${PN}-2.3.2-printing-1.patch
|
|
||||||
epatch "${FILESDIR}"/${PN}-2.3.2-powerdns-1.patch
|
|
||||||
}
|
|
||||||
|
|
||||||
# from marienz's setuptools.eclass:
|
|
||||||
src_install() {
|
|
||||||
"${python}" setup.py install --root="${D}" --no-compile "$@" || die "install failed"
|
|
||||||
dosbin bin/* || die "bin install failed"
|
|
||||||
insinto etc/mmc/agent/keys
|
|
||||||
doins -r conf/agent/keys/* || die "key install failed"
|
|
||||||
insinto etc/mmc/agent
|
|
||||||
doins -r conf/agent/*.ini || die "agent ini install failed"
|
|
||||||
insinto etc/mmc/plugins
|
|
||||||
doins -r conf/plugins/*.ini || die "plugins ini install failed"
|
|
||||||
insinto usr/share/doc/${P}
|
|
||||||
doins -r contrib || die "ldap schemas install failed"
|
|
||||||
dodoc Changelog || die "doc install failed"
|
|
||||||
|
|
||||||
newinitd "${FILESDIR}"/mmc-agent.initd mmc-agent
|
|
||||||
}
|
|
||||||
|
|
||||||
src_test() {
|
|
||||||
"${python}" setup.py test || die "tests failed"
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst() {
|
|
||||||
elog "To disable some plugin in your mmc environments, you have to set"
|
|
||||||
elog "disable to 1 in /etc/mmc/plugins/*.ini"
|
|
||||||
elog "(one config file per service)"
|
|
||||||
elog "You can't disable the base plugin."
|
|
||||||
}
|
|
@ -1,53 +0,0 @@
|
|||||||
# Copyright 1999-2010 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: $
|
|
||||||
|
|
||||||
EAPI="2"
|
|
||||||
|
|
||||||
inherit distutils
|
|
||||||
|
|
||||||
DESCRIPTION="The MMC Agent and its Python plugins."
|
|
||||||
HOMEPAGE="http://mds.mandriva.org/"
|
|
||||||
SRC_URI="http://mds.mandriva.org/pub/mds/sources/${PV}/${P}.tar.gz"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
KEYWORDS="~alpha ~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
|
|
||||||
IUSE=""
|
|
||||||
|
|
||||||
SLOT="0"
|
|
||||||
|
|
||||||
RDEPEND=">=dev-python/twisted-web-0.7.0
|
|
||||||
>=dev-python/python-ldap-2.2.1
|
|
||||||
>=dev-python/psycopg-2.0.2"
|
|
||||||
|
|
||||||
DEPEND=">=dev-python/setuptools-0.6_rc1"
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
epatch "${FILESDIR}"/${PN}-2.3.1-kerberos-1.patch
|
|
||||||
epatch "${FILESDIR}"/${PN}-2.3.2-printing-1.patch
|
|
||||||
epatch "${FILESDIR}"/${PN}-2.3.2-powerdns-1.patch
|
|
||||||
}
|
|
||||||
|
|
||||||
# from marienz's setuptools.eclass:
|
|
||||||
src_install() {
|
|
||||||
"${python}" setup.py install --root="${D}" --no-compile "$@" || die "install failed"
|
|
||||||
dosbin bin/* || die "bin install failed"
|
|
||||||
insinto etc/mmc/agent/keys
|
|
||||||
doins -r conf/agent/keys/* || die "key install failed"
|
|
||||||
insinto etc/mmc/agent
|
|
||||||
doins -r conf/agent/*.ini || die "agent ini install failed"
|
|
||||||
insinto etc/mmc/plugins
|
|
||||||
doins -r conf/plugins/*.ini || die "plugins ini install failed"
|
|
||||||
insinto usr/share/doc/${P}
|
|
||||||
doins -r contrib || die "ldap schemas install failed"
|
|
||||||
dodoc Changelog || die "doc install failed"
|
|
||||||
|
|
||||||
newinitd "${FILESDIR}"/mmc-agent.initd mmc-agent
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst() {
|
|
||||||
elog "To disable some plugin in your mmc environments, you have to set"
|
|
||||||
elog "disable to 1 in /etc/mmc/plugins/*.ini"
|
|
||||||
elog "(one config file per service)"
|
|
||||||
elog "You can't disable the base plugin."
|
|
||||||
}
|
|
@ -1,53 +0,0 @@
|
|||||||
# Copyright 1999-2010 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: $
|
|
||||||
|
|
||||||
EAPI="2"
|
|
||||||
|
|
||||||
inherit distutils
|
|
||||||
|
|
||||||
DESCRIPTION="The MMC Agent and its Python plugins."
|
|
||||||
HOMEPAGE="http://mds.mandriva.org/"
|
|
||||||
SRC_URI="http://mds.mandriva.org/pub/mds/sources/${PV}/${P}.tar.gz"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
KEYWORDS="~alpha ~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
|
|
||||||
IUSE=""
|
|
||||||
|
|
||||||
SLOT="0"
|
|
||||||
|
|
||||||
RDEPEND=">=dev-python/twisted-web-0.7.0
|
|
||||||
>=dev-python/python-ldap-2.2.1
|
|
||||||
>=dev-python/psycopg-2.0.2"
|
|
||||||
|
|
||||||
DEPEND=">=dev-python/setuptools-0.6_rc1"
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
epatch "${FILESDIR}"/${PN}-2.3.1-kerberos-1.patch
|
|
||||||
epatch "${FILESDIR}"/${PN}-2.3.2-printing-1.patch
|
|
||||||
epatch "${FILESDIR}"/${PN}-2.3.2-powerdns-2.patch
|
|
||||||
}
|
|
||||||
|
|
||||||
# from marienz's setuptools.eclass:
|
|
||||||
src_install() {
|
|
||||||
"${python}" setup.py install --root="${D}" --no-compile "$@" || die "install failed"
|
|
||||||
dosbin bin/* || die "bin install failed"
|
|
||||||
insinto etc/mmc/agent/keys
|
|
||||||
doins -r conf/agent/keys/* || die "key install failed"
|
|
||||||
insinto etc/mmc/agent
|
|
||||||
doins -r conf/agent/*.ini || die "agent ini install failed"
|
|
||||||
insinto etc/mmc/plugins
|
|
||||||
doins -r conf/plugins/*.ini || die "plugins ini install failed"
|
|
||||||
insinto usr/share/doc/${P}
|
|
||||||
doins -r contrib || die "ldap schemas install failed"
|
|
||||||
dodoc Changelog || die "doc install failed"
|
|
||||||
|
|
||||||
newinitd "${FILESDIR}"/mmc-agent.initd mmc-agent
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst() {
|
|
||||||
elog "To disable some plugin in your mmc environments, you have to set"
|
|
||||||
elog "disable to 1 in /etc/mmc/plugins/*.ini"
|
|
||||||
elog "(one config file per service)"
|
|
||||||
elog "You can't disable the base plugin."
|
|
||||||
}
|
|
@ -1,55 +0,0 @@
|
|||||||
# Copyright 1999-2010 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: $
|
|
||||||
|
|
||||||
EAPI="2"
|
|
||||||
|
|
||||||
inherit distutils
|
|
||||||
|
|
||||||
DESCRIPTION="The MMC Agent and its Python plugins."
|
|
||||||
HOMEPAGE="http://mds.mandriva.org/"
|
|
||||||
SRC_URI="http://mds.mandriva.org/pub/mds/sources/${PV}/${P}.tar.gz"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
KEYWORDS="~alpha ~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
|
|
||||||
IUSE=""
|
|
||||||
|
|
||||||
SLOT="0"
|
|
||||||
|
|
||||||
RDEPEND=">=dev-python/twisted-web-0.7.0
|
|
||||||
>=dev-python/python-ldap-2.2.1
|
|
||||||
>=dev-python/psycopg-2.0.2
|
|
||||||
>=dev-python/pyopenssl-0.6
|
|
||||||
>=dev-python/sqlalchemy-0.4.6"
|
|
||||||
|
|
||||||
DEPEND=">=dev-python/setuptools-0.6_rc1"
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
epatch "${FILESDIR}"/${PN}-2.3.1-kerberos-1.patch
|
|
||||||
epatch "${FILESDIR}"/${PN}-2.3.2-printing-1.patch
|
|
||||||
epatch "${FILESDIR}"/${PN}-2.3.2-powerdns-2.patch
|
|
||||||
}
|
|
||||||
|
|
||||||
# from marienz's setuptools.eclass:
|
|
||||||
src_install() {
|
|
||||||
"${python}" setup.py install --root="${D}" --no-compile "$@" || die "install failed"
|
|
||||||
dosbin bin/* || die "bin install failed"
|
|
||||||
insinto etc/mmc/agent/keys
|
|
||||||
doins -r conf/agent/keys/* || die "key install failed"
|
|
||||||
insinto etc/mmc/agent
|
|
||||||
doins -r conf/agent/*.ini || die "agent ini install failed"
|
|
||||||
insinto etc/mmc/plugins
|
|
||||||
doins -r conf/plugins/*.ini || die "plugins ini install failed"
|
|
||||||
insinto usr/share/doc/${P}
|
|
||||||
doins -r contrib || die "ldap schemas install failed"
|
|
||||||
dodoc Changelog || die "doc install failed"
|
|
||||||
|
|
||||||
newinitd "${FILESDIR}"/mmc-agent.initd mmc-agent
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst() {
|
|
||||||
elog "To disable some plugin in your mmc environments, you have to set"
|
|
||||||
elog "disable to 1 in /etc/mmc/plugins/*.ini"
|
|
||||||
elog "(one config file per service)"
|
|
||||||
elog "You can't disable the base plugin."
|
|
||||||
}
|
|
@ -1,63 +0,0 @@
|
|||||||
# Copyright 1999-2010 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: $
|
|
||||||
|
|
||||||
EAPI="2"
|
|
||||||
|
|
||||||
inherit eutils distutils
|
|
||||||
|
|
||||||
MY_P="${P/_p/-}"
|
|
||||||
MY_PV="${PV/_p*/}"
|
|
||||||
|
|
||||||
DESCRIPTION="The MMC Agent and its Python plugins."
|
|
||||||
HOMEPAGE="http://mds.mandriva.org/"
|
|
||||||
#SRC_URI="http://mds.mandriva.org/pub/mds/sources/${PV}/${P}.tar.gz"
|
|
||||||
SRC_URI="http://mds.mandriva.org/pub/pulse2/server/sources/1.2.4/3rd_party/MMC-${MY_PV}/${MY_P}.tar.gz"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
KEYWORDS="~alpha ~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
|
|
||||||
IUSE=""
|
|
||||||
|
|
||||||
SLOT="0"
|
|
||||||
|
|
||||||
RDEPEND=">=dev-python/twisted-web-0.7.0
|
|
||||||
>=dev-python/python-ldap-2.2.1
|
|
||||||
>=dev-python/psycopg-2.0.2
|
|
||||||
>=dev-python/pyopenssl-0.6
|
|
||||||
>=dev-python/sqlalchemy-0.4.6"
|
|
||||||
|
|
||||||
DEPEND=">=dev-python/setuptools-0.6_rc1"
|
|
||||||
|
|
||||||
S="${WORKDIR}/${PN}-${MY_PV}"
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
epatch "${FILESDIR}"/${PN}-2.3.1-kerberos-1.patch
|
|
||||||
epatch "${FILESDIR}"/${PN}-2.3.2-printing-1.patch
|
|
||||||
epatch "${FILESDIR}"/${PN}-2.3.2-powerdns-2.patch
|
|
||||||
epatch "${FILESDIR}"/${PN}-2.3.2-userquota-2.patch
|
|
||||||
epatch "${FILESDIR}"/${PN}-2.3.2-bulkimport-2.patch
|
|
||||||
}
|
|
||||||
|
|
||||||
# from marienz's setuptools.eclass:
|
|
||||||
src_install() {
|
|
||||||
"${python}" setup.py install --root="${D}" --no-compile "$@" || die "install failed"
|
|
||||||
dosbin bin/* || die "bin install failed"
|
|
||||||
insinto etc/mmc/agent/keys
|
|
||||||
doins -r conf/agent/keys/* || die "key install failed"
|
|
||||||
insinto etc/mmc/agent
|
|
||||||
doins -r conf/agent/*.ini || die "agent ini install failed"
|
|
||||||
insinto etc/mmc/plugins
|
|
||||||
doins -r conf/plugins/*.ini || die "plugins ini install failed"
|
|
||||||
insinto usr/share/doc/${P}
|
|
||||||
doins -r contrib || die "ldap schemas install failed"
|
|
||||||
dodoc Changelog || die "doc install failed"
|
|
||||||
|
|
||||||
newinitd "${FILESDIR}"/mmc-agent.initd mmc-agent
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst() {
|
|
||||||
elog "To disable some plugin in your mmc environments, you have to set"
|
|
||||||
elog "disable to 1 in /etc/mmc/plugins/*.ini"
|
|
||||||
elog "(one config file per service)"
|
|
||||||
elog "You can't disable the base plugin."
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
# ChangeLog for app-admin/mmc-web-bulkimport
|
|
||||||
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
|
|
||||||
# $Header: $
|
|
||||||
|
|
||||||
18 Feb 2010; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
mmc-web-bulkimport-0.0.1.ebuild, mmc-web-bulkimport-0.0.2.ebuild:
|
|
||||||
add arm keyword
|
|
||||||
|
|
||||||
02 Feb 2010; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
+mmc-web-bulkimport-0.0.2.ebuild:
|
|
||||||
Bump
|
|
||||||
|
|
||||||
29 Jan 2010; Mario Fetka <mario.fetka@gmail.com> Manifest:
|
|
||||||
add german translation to source package
|
|
||||||
|
|
||||||
29 Jan 2010; Mario Fetka <mario.fetka@gmail.com> ChangeLog:
|
|
||||||
initial checkin
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
|||||||
DIST mmc-web-bulkimport-0.0.1.tar.gz 7671 RMD160 852cfa79171a2f85ff41d703a0d18e8500324330 SHA1 7363aeb28b8abd7260e9aa6054a23516b085c5ab SHA256 58c9c8dc6eb8ec36e56a57637c015e0d09c5626974f07b444f1b78a9b0e7d7bb
|
|
||||||
DIST mmc-web-bulkimport-0.0.2.tar.gz 7827 RMD160 7310244c39d572078349a60c7ca14e50e5b2bed2 SHA1 15e2ddae858f87eb8487a92ebb9168a2d00e5778 SHA256 ab6b1d50d329d115f6077c1358bc5944950d5693bce267f33da35cda82351a64
|
|
||||||
EBUILD mmc-web-bulkimport-0.0.1.ebuild 692 RMD160 b57a4d41b633dd8879b01e45a9234fe7081d4ce3 SHA1 3a8bc73c8e8b4cdcbba1bd97785314a894375888 SHA256 778806e72a66f7d4875db64c2c38020bb6441886c609234662a80e0ce3f118a2
|
|
||||||
EBUILD mmc-web-bulkimport-0.0.2.ebuild 692 RMD160 b57a4d41b633dd8879b01e45a9234fe7081d4ce3 SHA1 3a8bc73c8e8b4cdcbba1bd97785314a894375888 SHA256 778806e72a66f7d4875db64c2c38020bb6441886c609234662a80e0ce3f118a2
|
|
||||||
MISC ChangeLog 548 RMD160 aa430095c47ad1737330e21f08329c82abd19356 SHA1 290b5ab2c1fc0a67aaace5a1a3b8b50fe9ebf18a SHA256 299e98cf4ff3aee5d02fc1a9786a790abe46592cefb603a30906056cacd7cb8d
|
|
||||||
MISC metadata.xml 170 RMD160 645927a396fdc21cdeb089fe42c5397332420ea6 SHA1 ac7f48a14fec325926f9ce1be8fbf1f311b4f2e4 SHA256 d797a2ec6f9dc516c9f9c1a758ee87ad3e8c43101b5dc76c2f872d5bd4639b42
|
|
@ -1,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
|
||||||
<pkgmetadata>
|
|
||||||
<herd>maintainer-wanted</herd>
|
|
||||||
</pkgmetadata>
|
|
@ -1,27 +0,0 @@
|
|||||||
# Copyright 1999-2010 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: $
|
|
||||||
|
|
||||||
EAPI="2"
|
|
||||||
MY_PV="2.3.2"
|
|
||||||
|
|
||||||
inherit eutils depend.apache depend.php
|
|
||||||
|
|
||||||
DESCRIPTION="Mandriva Directory Server - Identity and network services management made easy !"
|
|
||||||
HOMEPAGE="http://mds.mandriva.org/"
|
|
||||||
SRC_URI="http://mds.mandriva.org/pub/mds/sources/${PV}/${P}.tar.gz
|
|
||||||
http://ftp.mars.arge.at/mds/${P}.tar.gz"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
KEYWORDS="~amd64 ~arm ~x86 ~x86-fbsd"
|
|
||||||
IUSE=""
|
|
||||||
DEPEND="sys-apps/lsb-release
|
|
||||||
sys-devel/gettext"
|
|
||||||
RDEPEND=">=app-admin/mmc-web-base-${MY_PV}"
|
|
||||||
SLOT="0"
|
|
||||||
|
|
||||||
need_php_httpd
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
emake DESTDIR="${D}" PREFIX=/usr install || die "install failed"
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
# Copyright 1999-2010 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: $
|
|
||||||
|
|
||||||
EAPI="2"
|
|
||||||
MY_PV="2.3.2"
|
|
||||||
|
|
||||||
inherit eutils depend.apache depend.php
|
|
||||||
|
|
||||||
DESCRIPTION="Mandriva Directory Server - Identity and network services management made easy !"
|
|
||||||
HOMEPAGE="http://mds.mandriva.org/"
|
|
||||||
SRC_URI="http://mds.mandriva.org/pub/mds/sources/${PV}/${P}.tar.gz
|
|
||||||
http://ftp.mars.arge.at/mds/${P}.tar.gz"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
KEYWORDS="~amd64 ~arm ~x86 ~x86-fbsd"
|
|
||||||
IUSE=""
|
|
||||||
DEPEND="sys-apps/lsb-release
|
|
||||||
sys-devel/gettext"
|
|
||||||
RDEPEND=">=app-admin/mmc-web-base-${MY_PV}"
|
|
||||||
SLOT="0"
|
|
||||||
|
|
||||||
need_php_httpd
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
emake DESTDIR="${D}" PREFIX=/usr install || die "install failed"
|
|
||||||
}
|
|
@ -1,40 +0,0 @@
|
|||||||
# ChangeLog for app-admin/mmc-web-mail
|
|
||||||
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
|
|
||||||
# $Header: $
|
|
||||||
|
|
||||||
18 Feb 2010; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
mmc-web-mail-2.3.2.ebuild, mmc-web-mail-2.3.2-r1.ebuild,
|
|
||||||
mmc-web-mail-2.3.2-r2.ebuild:
|
|
||||||
add arm keyword
|
|
||||||
|
|
||||||
*mmc-web-mail-2.3.2-r2 (03 Sep 2009)
|
|
||||||
|
|
||||||
03 Sep 2009; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
+mmc-web-mail-2.3.2-r2.ebuild:
|
|
||||||
add missing dependencies
|
|
||||||
|
|
||||||
* mmc-web-mail-2.3.2-r1 (17 Apr 2009)
|
|
||||||
|
|
||||||
17 Apr 2009; Mario Fetka <mario.fetka@gmail.com> mmc-web-mail-2.3.2-r1:
|
|
||||||
make it EAPI2
|
|
||||||
|
|
||||||
08 Apr 2009; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
-mmc-web-mail-2.3.1.ebuild, mmc-web-mail-2.3.2.ebuild:
|
|
||||||
correct KEYWORDS
|
|
||||||
|
|
||||||
07 Apr 2009; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
-files/postinstall-en-2.3.txt:
|
|
||||||
delete not reqired files
|
|
||||||
|
|
||||||
13 Mar 2009; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
mmc-web-mail-2.3.2.ebuild:
|
|
||||||
new dependencies on gettext
|
|
||||||
|
|
||||||
17 Feb 2009; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
+mmc-web-mail-2.3.2.ebuild:
|
|
||||||
update to new system and Bump
|
|
||||||
|
|
||||||
02 Nov 2008; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
+files/postinstall-en-2.3.txt, +metadata.xml, +mmc-web-mail-2.3.1.ebuild:
|
|
||||||
initial checkin
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
|||||||
DIST mmc-web-mail-2.3.2.tar.gz 32988 RMD160 7a89fea53cf2712b8a3a6ae5797835d2d79142fd SHA1 428936de04828ce338f700a0c3c59c2c16f5e1ed SHA256 b47cee61e6735ce531ac3402f5ab96abb904367b33d3088bd1e11aa408b16495
|
|
||||||
EBUILD mmc-web-mail-2.3.2-r1.ebuild 675 RMD160 41bb5e7d548a11a871a271f03c8a56eae2fde004 SHA1 5dda2a1f16ac59e56342f707f710c36e59d613c6 SHA256 81452f4b63a712aa6f1119646d1e5103818f6485da9e2831dca00ab7ff5440ff
|
|
||||||
EBUILD mmc-web-mail-2.3.2-r2.ebuild 699 RMD160 999113d4c47384757ef6963ca0ef7c7122a48d56 SHA1 0b9292cd1a3e7dad6a3821f61afb4942f150a28d SHA256 3b342fc73d720fe65fbff3f3d0e106a7f2d100d0a8dd2d74f1f887168d9012a6
|
|
||||||
EBUILD mmc-web-mail-2.3.2.ebuild 672 RMD160 1d63e5a365233febff6f8c3b63e8b839c9b21f26 SHA1 c10c5cb9d3aa7bd873031b372d7b4aa099966504 SHA256 e752b28f7c3c20f2cefa2f6e8fb4765eef22def6ce07b2464a571889196398ee
|
|
||||||
MISC ChangeLog 1175 RMD160 67a0ed4a8f38586183aab9514a3ffe6a030e3176 SHA1 fa671b5357a1140997a516b3c819c4d3c4f15d3e SHA256 3a9fc2f2b1482c366b5c43f9d63e9fac545eced726f1ddebd7a125eda331b145
|
|
||||||
MISC metadata.xml 170 RMD160 645927a396fdc21cdeb089fe42c5397332420ea6 SHA1 ac7f48a14fec325926f9ce1be8fbf1f311b4f2e4 SHA256 d797a2ec6f9dc516c9f9c1a758ee87ad3e8c43101b5dc76c2f872d5bd4639b42
|
|
@ -1,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
|
||||||
<pkgmetadata>
|
|
||||||
<herd>maintainer-wanted</herd>
|
|
||||||
</pkgmetadata>
|
|
@ -1,26 +0,0 @@
|
|||||||
# Copyright 1999-2010 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: $
|
|
||||||
|
|
||||||
EAPI="2"
|
|
||||||
|
|
||||||
inherit eutils depend.apache depend.php
|
|
||||||
|
|
||||||
DESCRIPTION="Mandriva Directory Server - Identity and network services management made easy !"
|
|
||||||
HOMEPAGE="http://mds.mandriva.org/"
|
|
||||||
SRC_URI="http://mds.mandriva.org/pub/mds/sources/${PV}/${P}.tar.gz
|
|
||||||
http://ftp.mars.arge.at/mds/${P}.tar.gz"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
KEYWORDS="~amd64 ~arm ~x86 ~x86-fbsd"
|
|
||||||
IUSE=""
|
|
||||||
DEPEND="sys-apps/lsb-release
|
|
||||||
sys-devel/gettext"
|
|
||||||
RDEPEND=">=app-admin/mmc-web-base-${PV}"
|
|
||||||
SLOT="0"
|
|
||||||
|
|
||||||
need_php_httpd
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
emake DESTDIR="${D}" PREFIX=/usr install || die "install failed"
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
# Copyright 1999-2010 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: $
|
|
||||||
|
|
||||||
EAPI="2"
|
|
||||||
|
|
||||||
inherit eutils depend.apache depend.php
|
|
||||||
|
|
||||||
DESCRIPTION="Mandriva Directory Server - Identity and network services management made easy !"
|
|
||||||
HOMEPAGE="http://mds.mandriva.org/"
|
|
||||||
SRC_URI="http://mds.mandriva.org/pub/mds/sources/${PV}/${P}.tar.gz
|
|
||||||
http://ftp.mars.arge.at/mds/${P}.tar.gz"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
KEYWORDS="~amd64 ~arm ~x86 ~x86-fbsd"
|
|
||||||
IUSE=""
|
|
||||||
DEPEND="sys-apps/lsb-release
|
|
||||||
sys-devel/gettext"
|
|
||||||
RDEPEND=">=app-admin/mmc-web-base-${PV}
|
|
||||||
mail-mta/postfix[ldap]"
|
|
||||||
SLOT="0"
|
|
||||||
|
|
||||||
need_php_httpd
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
emake DESTDIR="${D}" PREFIX=/usr install || die "install failed"
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
# Copyright 1999-2010 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: $
|
|
||||||
|
|
||||||
inherit eutils depend.apache depend.php
|
|
||||||
|
|
||||||
DESCRIPTION="Mandriva Directory Server - Identity and network services management made easy !"
|
|
||||||
HOMEPAGE="http://mds.mandriva.org/"
|
|
||||||
SRC_URI="http://mds.mandriva.org/pub/mds/sources/${PV}/${P}.tar.gz
|
|
||||||
http://ftp.mars.arge.at/mds/${P}.tar.gz"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
KEYWORDS="~amd64 ~arm ~x86 ~x86-fbsd"
|
|
||||||
IUSE=""
|
|
||||||
DEPEND="sys-apps/lsb-release
|
|
||||||
sys-devel/gettext"
|
|
||||||
RDEPEND=">=app-admin/mmc-web-base-${PV}"
|
|
||||||
SLOT="0"
|
|
||||||
|
|
||||||
need_php_httpd
|
|
||||||
|
|
||||||
src_unpack() {
|
|
||||||
unpack ${A}
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
emake DESTDIR="${D}" PREFIX=/usr install
|
|
||||||
}
|
|
@ -1,45 +0,0 @@
|
|||||||
# ChangeLog for app-admin/mmc-web-network
|
|
||||||
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
|
|
||||||
# $Header: $
|
|
||||||
|
|
||||||
18 Feb 2010; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
mmc-web-network-2.3.2-r1.ebuild, mmc-web-network-2.3.2-r2.ebuild,
|
|
||||||
mmc-web-network-2.3.2-r3.ebuild:
|
|
||||||
add arm keyword
|
|
||||||
|
|
||||||
*mmc-web-network-2.3.2-r3 (03 Sep 2009)
|
|
||||||
|
|
||||||
03 Sep 2009; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
+mmc-web-network-2.3.2-r3.ebuild:
|
|
||||||
add missing dependencies
|
|
||||||
|
|
||||||
* mmc-web-network-2.3.2-r2 (17 Apr 2009)
|
|
||||||
|
|
||||||
17 Apr 2009; Mario Fetka <mario.fetka@gmail.com> mmc-web-network-2.3.2-r2:
|
|
||||||
make it EAPI2
|
|
||||||
|
|
||||||
08 Apr 2009; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
-mmc-web-network-2.3.1.ebuild, -mmc-web-network-2.3.2.ebuild,
|
|
||||||
mmc-web-network-2.3.2-r1.ebuild:
|
|
||||||
correct KEYWORDS
|
|
||||||
|
|
||||||
07 Apr 2009; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
-files/postinstall-en-2.3.txt:
|
|
||||||
delete not reqired files
|
|
||||||
|
|
||||||
30 Mar 2009; Mario Fetka <mario.fetka@gmail.com> ChangeLog:
|
|
||||||
Add PowerDNS Support
|
|
||||||
|
|
||||||
13 Mar 2009; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
mmc-web-network-2.3.2.ebuild:
|
|
||||||
new dependencies on gettext
|
|
||||||
|
|
||||||
17 Feb 2009; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
+mmc-web-network-2.3.2.ebuild:
|
|
||||||
update to new system and Bump
|
|
||||||
|
|
||||||
02 Nov 2008; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
+files/postinstall-en-2.3.txt, +metadata.xml,
|
|
||||||
+mmc-web-network-2.3.1.ebuild:
|
|
||||||
initial checkin
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
|||||||
AUX mmc-web-network-2.3.2-powerdns-1.patch 3062 RMD160 c9b0bc977ccf65d7a5a1d60104e4928219ee7de2 SHA1 5a9489a70923e66b255ed4826c3f88238e4899b6 SHA256 2ed793eadcaf24f7bf584f85fe41d0259977c0c508c4bdb714b0abec57ea159d
|
|
||||||
DIST mmc-web-network-2.3.2.tar.gz 64481 RMD160 3ed1254d5e83cd71e581ba6ebacc762f25c556cc SHA1 260892e060fe364a68c1aba64eab6207b4c0168c SHA256 75c19fe8258ed93be73d27b046a21fac54dc6c74c95ea38c0732d1df2e4ddfe8
|
|
||||||
EBUILD mmc-web-network-2.3.2-r1.ebuild 734 RMD160 5c2d9d6d82c867588f5d110e5d1abdf7c0247540 SHA1 097ad599014eb4b27e4c95119705e1921e6abe76 SHA256 3097f89bbe4f71d334d1be6958678813054e0da4df4d5a029ce0b9853a127e07
|
|
||||||
EBUILD mmc-web-network-2.3.2-r2.ebuild 745 RMD160 a46b9b3aab4b1ceb18b565336aea7726744ed3c2 SHA1 a6917d24c1a4330a60545f7657b9081f046b9766 SHA256 d864f506be9ab3dac7aa5226c57bd4c865af76f324fda4dfa31167829bd431e5
|
|
||||||
EBUILD mmc-web-network-2.3.2-r3.ebuild 816 RMD160 409b6301b8707a759ecf1d4084d9ea71bc9f3052 SHA1 6dc66aa7adf51f61667b0067c6043779325fcb29 SHA256 ad9c8110107c9e34aece39206035cff59066c332b29c56d2643678a55aee8734
|
|
||||||
MISC ChangeLog 1341 RMD160 8f02895eb85b41e8066a82c490f1cdb6e4cfa7ef SHA1 819cf38663fbc4f60ef3533fb5a6ce1153f4fcb8 SHA256 f357ed6f7bf3b33eab0b290b93cf289ceac34f6a0b0dd9534cc3815f06a2b737
|
|
||||||
MISC metadata.xml 170 RMD160 645927a396fdc21cdeb089fe42c5397332420ea6 SHA1 ac7f48a14fec325926f9ce1be8fbf1f311b4f2e4 SHA256 d797a2ec6f9dc516c9f9c1a758ee87ad3e8c43101b5dc76c2f872d5bd4639b42
|
|
@ -1,70 +0,0 @@
|
|||||||
Submitted By: Mario Fetka (mario dot fetka at gmail dot com)
|
|
||||||
Date: 2009-03-30
|
|
||||||
Initial Package Version: 2.3.2
|
|
||||||
Origin: http://mds.mandriva.org/ticket/244
|
|
||||||
Upstream Status: accepted
|
|
||||||
Description: add PowerDNS support to mmc
|
|
||||||
|
|
||||||
diff -Naur mmc-web-network-2.3.2.orig/network/network/ajaxZoneFilter.php mmc-web-network-2.3.2/network/network/ajaxZoneFilter.php
|
|
||||||
--- mmc-web-network-2.3.2.orig/network/network/ajaxZoneFilter.php 2007-11-15 14:29:44.000000000 +0000
|
|
||||||
+++ mmc-web-network-2.3.2/network/network/ajaxZoneFilter.php 2009-03-30 10:10:41.062435101 +0000
|
|
||||||
@@ -11,7 +11,11 @@
|
|
||||||
$count = array();
|
|
||||||
|
|
||||||
foreach(getZones($filter) as $dn => $entry) {
|
|
||||||
- $zonename = $entry[1]["zoneName"][0];
|
|
||||||
+ if (in_array("associatedDomain",array_keys($entry[1]))) {
|
|
||||||
+ $zonename = $entry[1]["associatedDomain"][0];
|
|
||||||
+ } else {
|
|
||||||
+ $zonename = $entry[1]["zoneName"][0];
|
|
||||||
+ }
|
|
||||||
$zones[$zonename] = array();
|
|
||||||
$zones[$zonename]["description"] = "";
|
|
||||||
if (isset($entry[1]["tXTRecord"])) {
|
|
||||||
diff -Naur mmc-web-network-2.3.2.orig/network/network/ajaxZoneMembersFilter.php mmc-web-network-2.3.2/network/network/ajaxZoneMembersFilter.php
|
|
||||||
--- mmc-web-network-2.3.2.orig/network/network/ajaxZoneMembersFilter.php 2007-11-30 15:08:09.000000000 +0000
|
|
||||||
+++ mmc-web-network-2.3.2/network/network/ajaxZoneMembersFilter.php 2009-03-30 10:10:41.062435101 +0000
|
|
||||||
@@ -15,7 +15,11 @@
|
|
||||||
/* Build a $hostname => IP array using A record only */
|
|
||||||
$records = array();
|
|
||||||
foreach($rrs as $dn => $entry) {
|
|
||||||
- $hostname = $entry[1]["relativeDomainName"][0];
|
|
||||||
+ if (in_array("associatedDomain",array_keys($entry[1]))) {
|
|
||||||
+ $hostname = $entry[1]["associatedDomain"][0];
|
|
||||||
+ } else {
|
|
||||||
+ $hostname = $entry[1]["zoneName"][0];
|
|
||||||
+ }
|
|
||||||
if (isset($entry[1]["aRecord"])) {
|
|
||||||
$address = ip2long($entry[1]["aRecord"][0]);
|
|
||||||
$records[$hostname] = $address;
|
|
||||||
@@ -24,7 +28,11 @@
|
|
||||||
/* Complete the array using CNAME entries */
|
|
||||||
$cnames = array();
|
|
||||||
foreach($rrs as $dn => $entry) {
|
|
||||||
- $alias = $entry[1]["relativeDomainName"][0];
|
|
||||||
+ if (in_array("associatedDomain",array_keys($entry[1]))) {
|
|
||||||
+ $alias = $entry[1]["associatedDomain"][0];
|
|
||||||
+ } else {
|
|
||||||
+ $alias = $entry[1]["zoneName"][0];
|
|
||||||
+ }
|
|
||||||
if (isset($entry[1]["cNAMERecord"])) {
|
|
||||||
$cname = $entry[1]["cNAMERecord"][0];
|
|
||||||
$records[$alias] = $records[$cname];
|
|
||||||
@@ -80,4 +88,4 @@
|
|
||||||
$n->addActionItemArray($actionsDel);
|
|
||||||
$n->display();
|
|
||||||
|
|
||||||
-?>
|
|
||||||
\ No newline at end of file
|
|
||||||
+?>
|
|
||||||
diff -Naur mmc-web-network-2.3.2.orig/network/network/edithost.php mmc-web-network-2.3.2/network/network/edithost.php
|
|
||||||
--- mmc-web-network-2.3.2.orig/network/network/edithost.php 2008-12-10 15:13:01.000000000 +0000
|
|
||||||
+++ mmc-web-network-2.3.2/network/network/edithost.php 2009-03-30 10:10:41.062435101 +0000
|
|
||||||
@@ -89,6 +89,7 @@
|
|
||||||
|
|
||||||
if ($_GET["action"] == "edithost") {
|
|
||||||
$hostname = $_GET["host"];
|
|
||||||
+ $hostname = str_replace('.' . $zone, '', $hostname);
|
|
||||||
$data = getResourceRecord($zone, $hostname);
|
|
||||||
if (empty($data)) die("Record $hostname does not exist.");
|
|
||||||
else if (isset($data[0][1]["aRecord"])) {
|
|
@ -1,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
|
||||||
<pkgmetadata>
|
|
||||||
<herd>maintainer-wanted</herd>
|
|
||||||
</pkgmetadata>
|
|
@ -1,30 +0,0 @@
|
|||||||
# Copyright 1999-2010 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: $
|
|
||||||
|
|
||||||
inherit eutils depend.apache depend.php
|
|
||||||
|
|
||||||
DESCRIPTION="Mandriva Directory Server - Identity and network services management made easy !"
|
|
||||||
HOMEPAGE="http://mds.mandriva.org/"
|
|
||||||
SRC_URI="http://mds.mandriva.org/pub/mds/sources/${PV}/${P}.tar.gz
|
|
||||||
http://ftp.mars.arge.at/mds/${P}.tar.gz"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
KEYWORDS="~amd64 ~arm ~x86 ~x86-fbsd"
|
|
||||||
IUSE=""
|
|
||||||
DEPEND="sys-apps/lsb-release
|
|
||||||
sys-devel/gettext"
|
|
||||||
RDEPEND=">=app-admin/mmc-web-base-${PV}"
|
|
||||||
SLOT="0"
|
|
||||||
|
|
||||||
need_php_httpd
|
|
||||||
|
|
||||||
src_unpack() {
|
|
||||||
unpack ${A}
|
|
||||||
cd "${S}"
|
|
||||||
epatch "${FILESDIR}"/${PN}-2.3.2-powerdns-1.patch
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
emake DESTDIR="${D}" PREFIX=/usr install
|
|
||||||
}
|
|
@ -1,30 +0,0 @@
|
|||||||
# Copyright 1999-2010 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: $
|
|
||||||
|
|
||||||
EAPI="2"
|
|
||||||
|
|
||||||
inherit eutils depend.apache depend.php
|
|
||||||
|
|
||||||
DESCRIPTION="Mandriva Directory Server - Identity and network services management made easy !"
|
|
||||||
HOMEPAGE="http://mds.mandriva.org/"
|
|
||||||
SRC_URI="http://mds.mandriva.org/pub/mds/sources/${PV}/${P}.tar.gz
|
|
||||||
http://ftp.mars.arge.at/mds/${P}.tar.gz"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
KEYWORDS="~amd64 ~arm ~x86 ~x86-fbsd"
|
|
||||||
IUSE=""
|
|
||||||
DEPEND="sys-apps/lsb-release
|
|
||||||
sys-devel/gettext"
|
|
||||||
RDEPEND=">=app-admin/mmc-web-base-${PV}"
|
|
||||||
SLOT="0"
|
|
||||||
|
|
||||||
need_php_httpd
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
epatch "${FILESDIR}"/${PN}-2.3.2-powerdns-1.patch
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
emake DESTDIR="${D}" PREFIX=/usr install || die "install failed"
|
|
||||||
}
|
|
@ -1,32 +0,0 @@
|
|||||||
# Copyright 1999-2010 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: $
|
|
||||||
|
|
||||||
EAPI="2"
|
|
||||||
|
|
||||||
inherit eutils depend.apache depend.php
|
|
||||||
|
|
||||||
DESCRIPTION="Mandriva Directory Server - Identity and network services management made easy !"
|
|
||||||
HOMEPAGE="http://mds.mandriva.org/"
|
|
||||||
SRC_URI="http://mds.mandriva.org/pub/mds/sources/${PV}/${P}.tar.gz
|
|
||||||
http://ftp.mars.arge.at/mds/${P}.tar.gz"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
KEYWORDS="~amd64 ~arm ~x86 ~x86-fbsd"
|
|
||||||
IUSE=""
|
|
||||||
DEPEND="sys-apps/lsb-release
|
|
||||||
sys-devel/gettext"
|
|
||||||
RDEPEND=">=app-admin/mmc-web-base-${PV}
|
|
||||||
net-misc/dhcp[ldap]
|
|
||||||
|| ( net-dns/bind[sdb-ldap] net-dns/pdns[ldap] )"
|
|
||||||
SLOT="0"
|
|
||||||
|
|
||||||
need_php_httpd
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
epatch "${FILESDIR}"/${PN}-2.3.2-powerdns-1.patch
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
emake DESTDIR="${D}" PREFIX=/usr install || die "install failed"
|
|
||||||
}
|
|
@ -1,44 +0,0 @@
|
|||||||
# ChangeLog for app-admin/mmc-web-proxy
|
|
||||||
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
|
|
||||||
# $Header: $
|
|
||||||
|
|
||||||
18 Feb 2010; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
mmc-web-proxy-2.3.2.ebuild, mmc-web-proxy-2.3.2-r1.ebuild,
|
|
||||||
mmc-web-proxy-2.3.2-r2.ebuild:
|
|
||||||
add arm keyword
|
|
||||||
|
|
||||||
03 Sep 2009; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
mmc-web-proxy-2.3.2-r2.ebuild:
|
|
||||||
correct dependencies
|
|
||||||
|
|
||||||
*mmc-web-proxy-2.3.2-r2 (03 Sep 2009)
|
|
||||||
|
|
||||||
03 Sep 2009; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
+mmc-web-proxy-2.3.2-r2.ebuild:
|
|
||||||
add missing dependencies
|
|
||||||
|
|
||||||
* mmc-web-proxy-2.3.2-r1 (17 Apr 2009)
|
|
||||||
|
|
||||||
17 Apr 2009; Mario Fetka <mario.fetka@gmail.com> mmc-web-proxy-2.3.2-r1:
|
|
||||||
make it EAPI2
|
|
||||||
|
|
||||||
08 Apr 2009; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
-mmc-web-proxy-2.3.1.ebuild, mmc-web-proxy-2.3.2.ebuild:
|
|
||||||
correct KEYWORDS
|
|
||||||
|
|
||||||
07 Apr 2009; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
-files/postinstall-en-2.3.txt:
|
|
||||||
delete not reqired files
|
|
||||||
|
|
||||||
13 Mar 2009; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
mmc-web-proxy-2.3.2.ebuild:
|
|
||||||
new dependencies on gettext
|
|
||||||
|
|
||||||
17 Feb 2009; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
+mmc-web-proxy-2.3.2.ebuild:
|
|
||||||
update to new system and Bump
|
|
||||||
|
|
||||||
02 Nov 2008; Mario Fetka <mario.fetka@gmail.com> +metadata.xml,
|
|
||||||
+mmc-web-proxy-2.3.1.ebuild:
|
|
||||||
initial checkin
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
|||||||
DIST mmc-web-proxy-2.3.2.tar.gz 18543 RMD160 79e13052a2a6425c84cae910ee759a492e934b74 SHA1 bd9349161c0fbecc3d2cf8d6452c9991a29ac93b SHA256 09e23500a5b49b94c6b5978df31e893bf15c24474f1a499f1ede0dc2b84e8d20
|
|
||||||
EBUILD mmc-web-proxy-2.3.2-r1.ebuild 675 RMD160 41bb5e7d548a11a871a271f03c8a56eae2fde004 SHA1 5dda2a1f16ac59e56342f707f710c36e59d613c6 SHA256 81452f4b63a712aa6f1119646d1e5103818f6485da9e2831dca00ab7ff5440ff
|
|
||||||
EBUILD mmc-web-proxy-2.3.2-r2.ebuild 703 RMD160 a20388480f1196fd32af951149fafbe1a94c117c SHA1 0d3196bceec53df118e3377667749ae64c4cfb1f SHA256 b33cec1e64f7d859570d76c1d14a518b99da604d09c0703bdfaa032fa5c2a1a8
|
|
||||||
EBUILD mmc-web-proxy-2.3.2.ebuild 672 RMD160 1d63e5a365233febff6f8c3b63e8b839c9b21f26 SHA1 c10c5cb9d3aa7bd873031b372d7b4aa099966504 SHA256 e752b28f7c3c20f2cefa2f6e8fb4765eef22def6ce07b2464a571889196398ee
|
|
||||||
MISC ChangeLog 1265 RMD160 dbf85adee54dfb739b6a15448b5d68a189238826 SHA1 776ec6e269bdf50998625c14cc425e28395d00c8 SHA256 bfd44db640039b017020f26de0ec677ada3307554529819e9493c3ace787c9b4
|
|
||||||
MISC metadata.xml 170 RMD160 645927a396fdc21cdeb089fe42c5397332420ea6 SHA1 ac7f48a14fec325926f9ce1be8fbf1f311b4f2e4 SHA256 d797a2ec6f9dc516c9f9c1a758ee87ad3e8c43101b5dc76c2f872d5bd4639b42
|
|
@ -1,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
|
||||||
<pkgmetadata>
|
|
||||||
<herd>maintainer-wanted</herd>
|
|
||||||
</pkgmetadata>
|
|
@ -1,26 +0,0 @@
|
|||||||
# Copyright 1999-2010 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: $
|
|
||||||
|
|
||||||
EAPI="2"
|
|
||||||
|
|
||||||
inherit eutils depend.apache depend.php
|
|
||||||
|
|
||||||
DESCRIPTION="Mandriva Directory Server - Identity and network services management made easy !"
|
|
||||||
HOMEPAGE="http://mds.mandriva.org/"
|
|
||||||
SRC_URI="http://mds.mandriva.org/pub/mds/sources/${PV}/${P}.tar.gz
|
|
||||||
http://ftp.mars.arge.at/mds/${P}.tar.gz"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
KEYWORDS="~amd64 ~arm ~x86 ~x86-fbsd"
|
|
||||||
IUSE=""
|
|
||||||
DEPEND="sys-apps/lsb-release
|
|
||||||
sys-devel/gettext"
|
|
||||||
RDEPEND=">=app-admin/mmc-web-base-${PV}"
|
|
||||||
SLOT="0"
|
|
||||||
|
|
||||||
need_php_httpd
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
emake DESTDIR="${D}" PREFIX=/usr install || die "install failed"
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
# Copyright 1999-2010 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: $
|
|
||||||
|
|
||||||
EAPI="2"
|
|
||||||
|
|
||||||
inherit eutils depend.apache depend.php
|
|
||||||
|
|
||||||
DESCRIPTION="Mandriva Directory Server - Identity and network services management made easy !"
|
|
||||||
HOMEPAGE="http://mds.mandriva.org/"
|
|
||||||
SRC_URI="http://mds.mandriva.org/pub/mds/sources/${PV}/${P}.tar.gz
|
|
||||||
http://ftp.mars.arge.at/mds/${P}.tar.gz"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
KEYWORDS="~amd64 ~arm ~x86 ~x86-fbsd"
|
|
||||||
IUSE=""
|
|
||||||
DEPEND="sys-apps/lsb-release
|
|
||||||
sys-devel/gettext"
|
|
||||||
RDEPEND=">=app-admin/mmc-web-base-${PV}
|
|
||||||
net-proxy/squidguard[ldap]"
|
|
||||||
SLOT="0"
|
|
||||||
|
|
||||||
need_php_httpd
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
emake DESTDIR="${D}" PREFIX=/usr install || die "install failed"
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
# Copyright 1999-2010 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: $
|
|
||||||
|
|
||||||
inherit eutils depend.apache depend.php
|
|
||||||
|
|
||||||
DESCRIPTION="Mandriva Directory Server - Identity and network services management made easy !"
|
|
||||||
HOMEPAGE="http://mds.mandriva.org/"
|
|
||||||
SRC_URI="http://mds.mandriva.org/pub/mds/sources/${PV}/${P}.tar.gz
|
|
||||||
http://ftp.mars.arge.at/mds/${P}.tar.gz"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
KEYWORDS="~amd64 ~arm ~x86 ~x86-fbsd"
|
|
||||||
IUSE=""
|
|
||||||
DEPEND="sys-apps/lsb-release
|
|
||||||
sys-devel/gettext"
|
|
||||||
RDEPEND=">=app-admin/mmc-web-base-${PV}"
|
|
||||||
SLOT="0"
|
|
||||||
|
|
||||||
need_php_httpd
|
|
||||||
|
|
||||||
src_unpack() {
|
|
||||||
unpack ${A}
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
emake DESTDIR="${D}" PREFIX=/usr install
|
|
||||||
}
|
|
@ -1,44 +0,0 @@
|
|||||||
# ChangeLog for app-admin/mmc-web-samba
|
|
||||||
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
|
|
||||||
# $Header: $
|
|
||||||
|
|
||||||
18 Feb 2010; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
mmc-web-samba-2.3.2.ebuild, mmc-web-samba-2.3.2-r1.ebuild,
|
|
||||||
mmc-web-samba-2.3.2-r2.ebuild:
|
|
||||||
add arm keyword
|
|
||||||
|
|
||||||
03 Sep 2009; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
mmc-web-samba-2.3.2-r2.ebuild:
|
|
||||||
correct dependencies
|
|
||||||
|
|
||||||
*mmc-web-samba-2.3.2-r2 (03 Sep 2009)
|
|
||||||
|
|
||||||
03 Sep 2009; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
+mmc-web-samba-2.3.2-r2.ebuild:
|
|
||||||
add missing dependencies
|
|
||||||
|
|
||||||
* mmc-web-samba-2.3.2-r1 (17 Apr 2009)
|
|
||||||
|
|
||||||
17 Apr 2009; Mario Fetka <mario.fetka@gmail.com> mmc-web-samba-2.3.2-r1:
|
|
||||||
make it EAPI2
|
|
||||||
|
|
||||||
08 Apr 2009; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
-mmc-web-samba-2.3.1.ebuild, mmc-web-samba-2.3.2.ebuild:
|
|
||||||
correct KEYWORDS
|
|
||||||
|
|
||||||
07 Apr 2009; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
-files/postinstall-en-2.3.txt:
|
|
||||||
delete not reqired files
|
|
||||||
|
|
||||||
13 Mar 2009; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
mmc-web-samba-2.3.2.ebuild:
|
|
||||||
new dependencies on gettext
|
|
||||||
|
|
||||||
17 Feb 2009; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
+mmc-web-samba-2.3.2.ebuild:
|
|
||||||
update to new system and Bump
|
|
||||||
|
|
||||||
02 Nov 2008; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
+files/postinstall-en-2.3.txt, +metadata.xml, +mmc-web-samba-2.3.1.ebuild:
|
|
||||||
initial checkin
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
|||||||
DIST mmc-web-samba-2.3.2.tar.gz 43111 RMD160 dd68699978b4ed0f4ef1820a7905b2e2a960802b SHA1 126da52a27f997404d79980eb0e24d911cf8eee2 SHA256 b219868448d3d10f9e69a441b1c8aa63420c1bf20f42de04546c747dc45d8bdb
|
|
||||||
EBUILD mmc-web-samba-2.3.2-r1.ebuild 675 RMD160 41bb5e7d548a11a871a271f03c8a56eae2fde004 SHA1 5dda2a1f16ac59e56342f707f710c36e59d613c6 SHA256 81452f4b63a712aa6f1119646d1e5103818f6485da9e2831dca00ab7ff5440ff
|
|
||||||
EBUILD mmc-web-samba-2.3.2-r2.ebuild 702 RMD160 79f8b83ce950f529cdae0d4127b7f517a5b7dffd SHA1 86a5c2de73864cf7355c890c759f44299568b69e SHA256 6cbd3f52ead98f1e00f620e84eec123ff381bda4b25340fd9fe56c9211f7c7bd
|
|
||||||
EBUILD mmc-web-samba-2.3.2.ebuild 672 RMD160 1d63e5a365233febff6f8c3b63e8b839c9b21f26 SHA1 c10c5cb9d3aa7bd873031b372d7b4aa099966504 SHA256 e752b28f7c3c20f2cefa2f6e8fb4765eef22def6ce07b2464a571889196398ee
|
|
||||||
MISC ChangeLog 1296 RMD160 b18f3a380163a21b7d17ce5f26f7007413c5a8a3 SHA1 e6675b60aa33218ee07e1f1d0612799f610598d7 SHA256 c209fb5a05cab8f99456291b6f73a9686c7fbd34e366a9e5e8640a5641a40142
|
|
||||||
MISC metadata.xml 170 RMD160 645927a396fdc21cdeb089fe42c5397332420ea6 SHA1 ac7f48a14fec325926f9ce1be8fbf1f311b4f2e4 SHA256 d797a2ec6f9dc516c9f9c1a758ee87ad3e8c43101b5dc76c2f872d5bd4639b42
|
|
@ -1,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
|
||||||
<pkgmetadata>
|
|
||||||
<herd>maintainer-wanted</herd>
|
|
||||||
</pkgmetadata>
|
|
@ -1,26 +0,0 @@
|
|||||||
# Copyright 1999-2010 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: $
|
|
||||||
|
|
||||||
EAPI="2"
|
|
||||||
|
|
||||||
inherit eutils depend.apache depend.php
|
|
||||||
|
|
||||||
DESCRIPTION="Mandriva Directory Server - Identity and network services management made easy !"
|
|
||||||
HOMEPAGE="http://mds.mandriva.org/"
|
|
||||||
SRC_URI="http://mds.mandriva.org/pub/mds/sources/${PV}/${P}.tar.gz
|
|
||||||
http://ftp.mars.arge.at/mds/${P}.tar.gz"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
KEYWORDS="~amd64 ~arm ~x86 ~x86-fbsd"
|
|
||||||
IUSE=""
|
|
||||||
DEPEND="sys-apps/lsb-release
|
|
||||||
sys-devel/gettext"
|
|
||||||
RDEPEND=">=app-admin/mmc-web-base-${PV}"
|
|
||||||
SLOT="0"
|
|
||||||
|
|
||||||
need_php_httpd
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
emake DESTDIR="${D}" PREFIX=/usr install || die "install failed"
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
# Copyright 1999-2010 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: $
|
|
||||||
|
|
||||||
EAPI="2"
|
|
||||||
|
|
||||||
inherit eutils depend.apache depend.php
|
|
||||||
|
|
||||||
DESCRIPTION="Mandriva Directory Server - Identity and network services management made easy !"
|
|
||||||
HOMEPAGE="http://mds.mandriva.org/"
|
|
||||||
SRC_URI="http://mds.mandriva.org/pub/mds/sources/${PV}/${P}.tar.gz
|
|
||||||
http://ftp.mars.arge.at/mds/${P}.tar.gz"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
KEYWORDS="~amd64 ~arm ~x86 ~x86-fbsd"
|
|
||||||
IUSE=""
|
|
||||||
DEPEND="sys-apps/lsb-release
|
|
||||||
sys-devel/gettext"
|
|
||||||
RDEPEND=">=app-admin/mmc-web-base-${PV}
|
|
||||||
net-fs/samba-server[ldap]"
|
|
||||||
SLOT="0"
|
|
||||||
|
|
||||||
need_php_httpd
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
emake DESTDIR="${D}" PREFIX=/usr install || die "install failed"
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
# Copyright 1999-2010 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: $
|
|
||||||
|
|
||||||
inherit eutils depend.apache depend.php
|
|
||||||
|
|
||||||
DESCRIPTION="Mandriva Directory Server - Identity and network services management made easy !"
|
|
||||||
HOMEPAGE="http://mds.mandriva.org/"
|
|
||||||
SRC_URI="http://mds.mandriva.org/pub/mds/sources/${PV}/${P}.tar.gz
|
|
||||||
http://ftp.mars.arge.at/mds/${P}.tar.gz"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
KEYWORDS="~amd64 ~arm ~x86 ~x86-fbsd"
|
|
||||||
IUSE=""
|
|
||||||
DEPEND="sys-apps/lsb-release
|
|
||||||
sys-devel/gettext"
|
|
||||||
RDEPEND=">=app-admin/mmc-web-base-${PV}"
|
|
||||||
SLOT="0"
|
|
||||||
|
|
||||||
need_php_httpd
|
|
||||||
|
|
||||||
src_unpack() {
|
|
||||||
unpack ${A}
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
emake DESTDIR="${D}" PREFIX=/usr install
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
# ChangeLog for app-admin/mmc-web-userquota
|
|
||||||
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
|
|
||||||
# $Header: $
|
|
||||||
|
|
||||||
18 Feb 2010; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
mmc-web-userquota-0.0.2.ebuild, mmc-web-userquota-0.0.3.ebuild:
|
|
||||||
add arm keyword
|
|
||||||
|
|
||||||
05 Feb 2010; Mario Fetka <mario.fetka@gmail.com>
|
|
||||||
+mmc-web-userquota-0.0.3.ebuild:
|
|
||||||
Bump
|
|
||||||
|
|
||||||
29 Jan 2010; Mario Fetka <mario.fetka@gmail.com> Manifest:
|
|
||||||
add german translation to source package
|
|
||||||
|
|
||||||
29 Jan 2010; Mario Fetka <mario.fetka@gmail.com> ChangeLog:
|
|
||||||
initial checkin
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
|||||||
DIST mmc-web-userquota-0.0.2.tar.gz 6609 RMD160 1b10742640597c6f4db8b390a27177991caa7376 SHA1 f5e61fa2824a7b472d04f485f9192a1e99719c4f SHA256 4c631cf1a804aa321c82fe548b38d7f59d33b4769f138e11f3d9f89c267adf94
|
|
||||||
DIST mmc-web-userquota-0.0.3.tar.gz 7826 RMD160 c1a2385874a995dea8a6298407672f4beacdd9d8 SHA1 76cc31095ca5efdf6dcc04a6e726405724cabd72 SHA256 dd62ce4b9f76fa114195f1193fe3c3f7c09b129d20b8d5cd2774d2864329a80f
|
|
||||||
EBUILD mmc-web-userquota-0.0.2.ebuild 692 RMD160 b57a4d41b633dd8879b01e45a9234fe7081d4ce3 SHA1 3a8bc73c8e8b4cdcbba1bd97785314a894375888 SHA256 778806e72a66f7d4875db64c2c38020bb6441886c609234662a80e0ce3f118a2
|
|
||||||
EBUILD mmc-web-userquota-0.0.3.ebuild 692 RMD160 b57a4d41b633dd8879b01e45a9234fe7081d4ce3 SHA1 3a8bc73c8e8b4cdcbba1bd97785314a894375888 SHA256 778806e72a66f7d4875db64c2c38020bb6441886c609234662a80e0ce3f118a2
|
|
||||||
MISC ChangeLog 544 RMD160 d7e6cba6fd81a9bfd7ed2e1278a5144e03093bb2 SHA1 71a80b542e7f7cc115f15c4c2675221c7e079fe7 SHA256 9f5591365876443734b1f8753f41a95498d3412135848109a08e223a556903f7
|
|
||||||
MISC metadata.xml 170 RMD160 645927a396fdc21cdeb089fe42c5397332420ea6 SHA1 ac7f48a14fec325926f9ce1be8fbf1f311b4f2e4 SHA256 d797a2ec6f9dc516c9f9c1a758ee87ad3e8c43101b5dc76c2f872d5bd4639b42
|
|
@ -1,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
|
||||||
<pkgmetadata>
|
|
||||||
<herd>maintainer-wanted</herd>
|
|
||||||
</pkgmetadata>
|
|
@ -1,27 +0,0 @@
|
|||||||
# Copyright 1999-2010 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: $
|
|
||||||
|
|
||||||
EAPI="2"
|
|
||||||
MY_PV="2.3.2"
|
|
||||||
|
|
||||||
inherit eutils depend.apache depend.php
|
|
||||||
|
|
||||||
DESCRIPTION="Mandriva Directory Server - Identity and network services management made easy !"
|
|
||||||
HOMEPAGE="http://mds.mandriva.org/"
|
|
||||||
SRC_URI="http://mds.mandriva.org/pub/mds/sources/${PV}/${P}.tar.gz
|
|
||||||
http://ftp.mars.arge.at/mds/${P}.tar.gz"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
KEYWORDS="~amd64 ~arm ~x86 ~x86-fbsd"
|
|
||||||
IUSE=""
|
|
||||||
DEPEND="sys-apps/lsb-release
|
|
||||||
sys-devel/gettext"
|
|
||||||
RDEPEND=">=app-admin/mmc-web-base-${MY_PV}"
|
|
||||||
SLOT="0"
|
|
||||||
|
|
||||||
need_php_httpd
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
emake DESTDIR="${D}" PREFIX=/usr install || die "install failed"
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
# Copyright 1999-2010 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: $
|
|
||||||
|
|
||||||
EAPI="2"
|
|
||||||
MY_PV="2.3.2"
|
|
||||||
|
|
||||||
inherit eutils depend.apache depend.php
|
|
||||||
|
|
||||||
DESCRIPTION="Mandriva Directory Server - Identity and network services management made easy !"
|
|
||||||
HOMEPAGE="http://mds.mandriva.org/"
|
|
||||||
SRC_URI="http://mds.mandriva.org/pub/mds/sources/${PV}/${P}.tar.gz
|
|
||||||
http://ftp.mars.arge.at/mds/${P}.tar.gz"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
KEYWORDS="~amd64 ~arm ~x86 ~x86-fbsd"
|
|
||||||
IUSE=""
|
|
||||||
DEPEND="sys-apps/lsb-release
|
|
||||||
sys-devel/gettext"
|
|
||||||
RDEPEND=">=app-admin/mmc-web-base-${MY_PV}"
|
|
||||||
SLOT="0"
|
|
||||||
|
|
||||||
need_php_httpd
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
emake DESTDIR="${D}" PREFIX=/usr install || die "install failed"
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user