diff -Nru web2ldap-1.1.31~dfsg/CHANGES web2ldap-1.1.43~dfsg/CHANGES --- web2ldap-1.1.31~dfsg/CHANGES 2005-09-24 16:58:49.000000000 +0000 +++ web2ldap-1.1.43~dfsg/CHANGES 2013-06-22 15:51:04.000000000 +0000 @@ -9,5 +9,3 @@ of source distribution package or http://www.web2ldap.de/changes.html - -$Id: CHANGES,v 1.1 2005/09/24 16:58:49 michael Exp $ diff -Nru web2ldap-1.1.31~dfsg/INSTALL web2ldap-1.1.43~dfsg/INSTALL --- web2ldap-1.1.31~dfsg/INSTALL 2003-07-03 06:31:19.000000000 +0000 +++ web2ldap-1.1.43~dfsg/INSTALL 2013-06-22 15:51:04.000000000 +0000 @@ -9,5 +9,3 @@ of source distribution package or http://www.web2ldap.de/install.html - -$Id: INSTALL,v 1.4 2003/07/03 06:31:19 michael Exp $ diff -Nru web2ldap-1.1.31~dfsg/README web2ldap-1.1.43~dfsg/README --- web2ldap-1.1.31~dfsg/README 2008-08-05 22:19:22.000000000 +0000 +++ web2ldap-1.1.43~dfsg/README 2013-06-22 15:51:04.000000000 +0000 @@ -31,5 +31,3 @@ This software is still actively developed. Check the announcements_page and the roadmap. - -$Id: README,v 1.6 2008/08/05 22:19:22 michael Exp $ diff -Nru web2ldap-1.1.31~dfsg/debian/changelog web2ldap-1.1.43~dfsg/debian/changelog --- web2ldap-1.1.31~dfsg/debian/changelog 2013-02-17 11:19:09.000000000 +0000 +++ web2ldap-1.1.43~dfsg/debian/changelog 2013-09-05 15:25:55.000000000 +0000 @@ -1,3 +1,15 @@ +web2ldap (1.1.43~dfsg-1) unstable; urgency=low + + * Imported Upstream version 1.1.43 + * refresh patches + * document that this package is for FastCGI/apache use + * use new apache authorization scheme for > 2.4 while keeping compatibility + * Standards-Version: 3.9.4 (no changes necessary) + * Lintian: override non-standard-apache2-configuration-name + * Lintian: override apache2-reverse-dependency-calls-wrapper-script #717132 + + -- Marc Haber Thu, 05 Sep 2013 17:23:09 +0200 + web2ldap (1.1.31~dfsg-1) unstable; urgency=low * Imported Upstream version 1.1.31 diff -Nru web2ldap-1.1.31~dfsg/debian/control web2ldap-1.1.43~dfsg/debian/control --- web2ldap-1.1.31~dfsg/debian/control 2013-02-17 11:19:09.000000000 +0000 +++ web2ldap-1.1.43~dfsg/debian/control 2013-09-05 15:25:55.000000000 +0000 @@ -3,7 +3,7 @@ Priority: optional Maintainer: Marc Haber Build-Depends: debhelper (>= 8~), dpkg-dev (>= 1.15.8), python -Standards-Version: 3.9.3 +Standards-Version: 3.9.4 Homepage: http://web2ldap.de/ Vcs-Git: git://git.debian.org/collab-maint/web2ldap.git Vcs-Browser: http://git.debian.org/?p=collab-maint/web2ldap.git;a=summary @@ -26,3 +26,9 @@ references/dependencies within an LDAPv3 schema. It may also be used as a customizable platform for prototyping LDAP administration use-cases. + . + The code in this package is primarily intended to be used as FastCGI + process under apache2. Web2ldap can also be used in a stand alone + mode, but you'll need to write your own init script and take care of + your logs yourself (including creating /var/log/web2ldap and + rotation). diff -Nru web2ldap-1.1.31~dfsg/debian/lintian-overrides web2ldap-1.1.43~dfsg/debian/lintian-overrides --- web2ldap-1.1.31~dfsg/debian/lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ web2ldap-1.1.43~dfsg/debian/lintian-overrides 2013-09-05 15:25:55.000000000 +0000 @@ -0,0 +1,13 @@ +# our config file is called web2ldap.fcgid for a reason (there are +# alternatives, this is the one we chose) +web2ldap: non-standard-apache2-configuration-name + +# we only call that on wheezy (#717132) +web2ldap: apache2-reverse-dependency-calls-wrapper-script postinst a2enmod + +# we use IfVersion to mask the old auth scheme (#710656) +web2ldap: apache2-deprecated-auth-config Order +web2ldap: apache2-deprecated-auth-config Allow +web2ldap: apache2-deprecated-auth-config +web2ldap: apache2-deprecated-auth-config +web2ldap: apache2-deprecated-auth-config diff -Nru web2ldap-1.1.31~dfsg/debian/patches/access-list web2ldap-1.1.43~dfsg/debian/patches/access-list --- web2ldap-1.1.31~dfsg/debian/patches/access-list 2013-02-17 11:19:09.000000000 +0000 +++ web2ldap-1.1.43~dfsg/debian/patches/access-list 2013-09-05 15:25:55.000000000 +0000 @@ -2,7 +2,7 @@ Origin: vendor --- a/etc/httpd/sample-mod_fcgid.conf +++ b/etc/httpd/sample-mod_fcgid.conf -@@ -42,9 +42,6 @@ +@@ -42,9 +42,6 @@ IPCCommTimeout 600 Order allow,deny Allow from 127.0.0.1 Allow from ::1 diff -Nru web2ldap-1.1.31~dfsg/debian/patches/debian-compatible-paths web2ldap-1.1.43~dfsg/debian/patches/debian-compatible-paths --- web2ldap-1.1.31~dfsg/debian/patches/debian-compatible-paths 2013-02-17 11:19:09.000000000 +0000 +++ web2ldap-1.1.43~dfsg/debian/patches/debian-compatible-paths 2013-09-05 15:25:55.000000000 +0000 @@ -2,7 +2,7 @@ Origin: vendor --- a/etc/web2ldap/web2ldapcnf/__init__.py +++ b/etc/web2ldap/web2ldapcnf/__init__.py -@@ -15,19 +15,18 @@ +@@ -15,19 +15,18 @@ import sys,os web2ldap_dir = os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0]))) # Default directory for [web2ldap]/var diff -Nru web2ldap-1.1.31~dfsg/debian/patches/dumpasn1cfg web2ldap-1.1.43~dfsg/debian/patches/dumpasn1cfg --- web2ldap-1.1.31~dfsg/debian/patches/dumpasn1cfg 2013-02-17 11:19:09.000000000 +0000 +++ web2ldap-1.1.43~dfsg/debian/patches/dumpasn1cfg 2013-09-05 15:25:55.000000000 +0000 @@ -2,7 +2,7 @@ Origin: vendor --- a/etc/web2ldap/web2ldapcnf/misc.py +++ b/etc/web2ldap/web2ldapcnf/misc.py -@@ -64,7 +64,7 @@ +@@ -64,7 +64,7 @@ max_searchparams=20 # Path name to dumpasn1.cfg. Grab it from # http://www.cs.auckland.ac.nz/~pgut001/dumpasn1.cfg diff -Nru web2ldap-1.1.31~dfsg/debian/patches/pylib-dir web2ldap-1.1.43~dfsg/debian/patches/pylib-dir --- web2ldap-1.1.31~dfsg/debian/patches/pylib-dir 2013-02-17 11:19:09.000000000 +0000 +++ web2ldap-1.1.43~dfsg/debian/patches/pylib-dir 2013-09-05 15:25:55.000000000 +0000 @@ -2,7 +2,7 @@ Origin: vendor --- a/etc/web2ldap/web2ldapcnf/misc.py +++ b/etc/web2ldap/web2ldapcnf/misc.py -@@ -8,7 +8,7 @@ +@@ -8,7 +8,7 @@ web2ldapcnf/misc.py - Misc. configuratio import os,web2ldapcnf # A list with directories containing additional Python modules diff -Nru web2ldap-1.1.31~dfsg/debian/patches/restricted_ldap_uri_list web2ldap-1.1.43~dfsg/debian/patches/restricted_ldap_uri_list --- web2ldap-1.1.31~dfsg/debian/patches/restricted_ldap_uri_list 2013-02-17 11:19:09.000000000 +0000 +++ web2ldap-1.1.43~dfsg/debian/patches/restricted_ldap_uri_list 2013-09-05 15:25:55.000000000 +0000 @@ -2,7 +2,7 @@ Origin: vendor --- a/etc/web2ldap/web2ldapcnf/hosts.py +++ b/etc/web2ldap/web2ldapcnf/hosts.py -@@ -61,7 +61,7 @@ +@@ -61,7 +61,7 @@ ldap_uri_list = [ # Set to True (or 1) if LDAP access should be restricted to the LDAP servers # defined in ldap_uri_list (default if absent is 0 - restriction disabled) diff -Nru web2ldap-1.1.31~dfsg/debian/patches/sample-cgi-conf web2ldap-1.1.43~dfsg/debian/patches/sample-cgi-conf --- web2ldap-1.1.31~dfsg/debian/patches/sample-cgi-conf 2013-02-17 11:19:09.000000000 +0000 +++ web2ldap-1.1.43~dfsg/debian/patches/sample-cgi-conf 2013-09-05 15:25:55.000000000 +0000 @@ -26,7 +26,7 @@ # Tell mod_ssl to set the SSL standard env vars -@@ -36,7 +36,7 @@ +@@ -36,7 +36,7 @@ FastCgiServer /opt/web2ldap/fcgi/web2lda @@ -62,7 +62,22 @@ # Force use of a pseudo-random salt to make hash() values # in Python 2.6.8+ and Python 2.7.3+ to avoid DoS attacks -@@ -45,7 +51,7 @@ +@@ -39,17 +45,28 @@ IPCCommTimeout 600 + SSLOptions +StdEnvVars + + +- Order allow,deny +- Allow from 127.0.0.1 +- Allow from ::1 ++ = 2.4> ++ Require local ++ ++ ++ # This will trigger Lintian (#710656, override in place) ++ Order allow,deny ++ Allow from 127.0.0.1 ++ Allow from ::1 ++ @@ -70,4 +85,15 @@ + DirectoryIndex web2ldap.html - Order allow,deny +- Order allow,deny +- Allow from All ++ = 2.4> ++ Require all granted ++ ++ ++ Order allow,deny ++ Allow from All ++ + + + diff -Nru web2ldap-1.1.31~dfsg/debian/postinst web2ldap-1.1.43~dfsg/debian/postinst --- web2ldap-1.1.31~dfsg/debian/postinst 2013-02-17 11:19:09.000000000 +0000 +++ web2ldap-1.1.43~dfsg/debian/postinst 2013-09-05 15:25:55.000000000 +0000 @@ -11,6 +11,7 @@ elif dpkg-query -f '${Version}' -W 'apache2.2-common' > /dev/null 2>&1 ; then # if the configuration uses uncomment the next line # a2enmod -q version + # this will trigger lintian, see #717132, override in place [ -d /etc/apache2/conf.d/ ] && [ ! -L /etc/apache2/conf.d/$CONF.conf ] && ln -s ../conf-available/$CONF.conf /etc/apache2/conf.d/$CONF.conf || true fi fi diff -Nru web2ldap-1.1.31~dfsg/etc/dumpasn1.cfg web2ldap-1.1.43~dfsg/etc/dumpasn1.cfg --- web2ldap-1.1.31~dfsg/etc/dumpasn1.cfg 2012-05-28 16:43:55.000000000 +0000 +++ web2ldap-1.1.43~dfsg/etc/dumpasn1.cfg 2013-08-30 17:22:41.000000000 +0000 @@ -1,6 +1,6 @@ # dumpasn1 Object Identifier configuration file, available from -# http://www.cs.auckland.ac.nz/~pgut001/dumpasn1.cfg. Last updated 1 -# February 2011, or 20110201 if you want it that way. This file is read by +# http://www.cs.auckland.ac.nz/~pgut001/dumpasn1.cfg. Last updated 5 +# August 2013, or 20130805 if you want it that way. This file is read by # dumpasn1.c and is used to display information on Object Identifiers found # in ASN.1 objects. This is merely a list of things that you might # conceivably find in use somewhere, and should in no way be taken as a @@ -582,8 +582,11 @@ # BSI e-Pass (TR-03110/TR-03111). TA = Terminal Authentication (Passport # PKI with monthly global cert updates), CA = Chip Authentication -# (Auth using static [EC]DH). - +# (Auth using static [EC]DH), PACE = Password Authenticated Connection +# Establishment, RI = Restricted Information Protocol, Eid = eID +# Smartcard Application, PT = Privileged Terminal, IS = Inspection +# System, AT = Authentication Terminal, ST = Signature Terminal. + OID = 0 4 0 127 0 7 Comment = BSI TR-03110/TR-03111 Description = bsi @@ -704,6 +707,14 @@ Comment = BSI TR-03110 Description = bsiTA_RSAPSS_SHA256 +OID = 0 4 0 127 0 7 2 2 2 1 5 +Comment = BSI TR-03110 +Description = bsiTA_RSAv1_5_SHA512 + +OID = 0 4 0 127 0 7 2 2 2 1 6 +Comment = BSI TR-03110 +Description = bsiTA_RSAPSS_SHA512 + OID = 0 4 0 127 0 7 2 2 2 2 Comment = BSI TR-03110 Description = bsiTA_ECDSA @@ -720,6 +731,14 @@ Comment = BSI TR-03110 Description = bsiTA_ECDSA_SHA256 +OID = 0 4 0 127 0 7 2 2 2 2 4 +Comment = BSI TR-03110 +Description = bsiTA_ECDSA_SHA384 + +OID = 0 4 0 127 0 7 2 2 2 2 5 +Comment = BSI TR-03110 +Description = bsiTA_ECDSA_SHA512 + OID = 0 4 0 127 0 7 2 2 3 Comment = BSI TR-03110 Description = bsiCA @@ -728,13 +747,253 @@ Comment = BSI TR-03110 Description = bsiCA_DH +OID = 0 4 0 127 0 7 2 2 3 1 1 +Comment = BSI TR-03110 +Description = bsiCA_DH_3DES_CBC_CBC + +OID = 0 4 0 127 0 7 2 2 3 1 2 +Comment = BSI TR-03110 +Description = bsiCA_DH_AES_CBC_CMAC_128 + +OID = 0 4 0 127 0 7 2 2 3 1 3 +Comment = BSI TR-03110 +Description = bsiCA_DH_AES_CBC_CMAC_192 + +OID = 0 4 0 127 0 7 2 2 3 1 4 +Comment = BSI TR-03110 +Description = bsiCA_DH_AES_CBC_CMAC_256 + OID = 0 4 0 127 0 7 2 2 3 2 Comment = BSI TR-03110 Description = bsiCA_ECDH +OID = 0 4 0 127 0 7 2 2 3 2 1 +Comment = BSI TR-03110 +Description = bsiCA_ECDH_3DES_CBC_CBC + +OID = 0 4 0 127 0 7 2 2 3 2 2 +Comment = BSI TR-03110 +Description = bsiCA_ECDH_AES_CBC_CMAC_128 + +OID = 0 4 0 127 0 7 2 2 3 2 3 +Comment = BSI TR-03110 +Description = bsiCA_ECDH_AES_CBC_CMAC_192 + +OID = 0 4 0 127 0 7 2 2 3 2 4 +Comment = BSI TR-03110 +Description = bsiCA_ECDH_AES_CBC_CMAC_256 + +OID = 0 4 0 127 0 7 2 2 4 +Comment = BSI TR-03110 +Description = bsiPACE + +OID = 0 4 0 127 0 7 2 2 4 1 +Comment = BSI TR-03110 +Description = bsiPACE_DH_GM + +OID = 0 4 0 127 0 7 2 2 4 1 1 +Comment = BSI TR-03110 +Description = bsiPACE_DH_GM_3DES_CBC_CBC + +OID = 0 4 0 127 0 7 2 2 4 1 2 +Comment = BSI TR-03110 +Description = bsiPACE_DH_GM_AES_CBC_CMAC_128 + +OID = 0 4 0 127 0 7 2 2 4 1 3 +Comment = BSI TR-03110 +Description = bsiPACE_DH_GM_AES_CBC_CMAC_192 + +OID = 0 4 0 127 0 7 2 2 4 1 4 +Comment = BSI TR-03110 +Description = bsiPACE_DH_GM_AES_CBC_CMAC_256 + +OID = 0 4 0 127 0 7 2 2 4 2 +Comment = BSI TR-03110 +Description = bsiPACE_ECDH_GM + +OID = 0 4 0 127 0 7 2 2 4 2 1 +Comment = BSI TR-03110 +Description = bsiPACE_ECDH_GM_3DES_CBC_CBC + +OID = 0 4 0 127 0 7 2 2 4 2 2 +Comment = BSI TR-03110 +Description = bsiPACE_ECDH_GM_AES_CBC_CMAC_128 + +OID = 0 4 0 127 0 7 2 2 4 2 3 +Comment = BSI TR-03110 +Description = bsiPACE_ECDH_GM_AES_CBC_CMAC_192 + +OID = 0 4 0 127 0 7 2 2 4 2 4 +Comment = BSI TR-03110 +Description = bsiPACE_ECDH_GM_AES_CBC_CMAC_256 + +OID = 0 4 0 127 0 7 2 2 4 3 +Comment = BSI TR-03110 +Description = bsiPACE_DH_IM + +OID = 0 4 0 127 0 7 2 2 4 3 1 +Comment = BSI TR-03110 +Description = bsiPACE_DH_IM_3DES_CBC_CBC + +OID = 0 4 0 127 0 7 2 2 4 3 2 +Comment = BSI TR-03110 +Description = bsiPACE_DH_IM_AES_CBC_CMAC_128 + +OID = 0 4 0 127 0 7 2 2 4 3 3 +Comment = BSI TR-03110 +Description = bsiPACE_DH_IM_AES_CBC_CMAC_192 + +OID = 0 4 0 127 0 7 2 2 4 3 4 +Comment = BSI TR-03110 +Description = bsiPACE_DH_IM_AES_CBC_CMAC_256 + +OID = 0 4 0 127 0 7 2 2 4 4 +Comment = BSI TR-03110 +Description = bsiPACE_ECDH_IM + +OID = 0 4 0 127 0 7 2 2 4 4 1 +Comment = BSI TR-03110 +Description = bsiPACE_ECDH_IM_3DES_CBC_CBC + +OID = 0 4 0 127 0 7 2 2 4 4 2 +Comment = BSI TR-03110 +Description = bsiPACE_ECDH_IM_AES_CBC_CMAC_128 + +OID = 0 4 0 127 0 7 2 2 4 4 3 +Comment = BSI TR-03110 +Description = bsiPACE_ECDH_IM_AES_CBC_CMAC_192 + +OID = 0 4 0 127 0 7 2 2 4 4 4 +Comment = BSI TR-03110 +Description = bsiPACE_ECDH_IM_AES_CBC_CMAC_256 + +OID = 0 4 0 127 0 7 2 2 5 +Comment = BSI TR-03110 +Description = bsiRI + +OID = 0 4 0 127 0 7 2 2 5 1 +Comment = BSI TR-03110 +Description = bsiRI_DH + +OID = 0 4 0 127 0 7 2 2 5 1 1 +Comment = BSI TR-03110 +Description = bsiRI_DH_SHA1 + +OID = 0 4 0 127 0 7 2 2 5 1 2 +Comment = BSI TR-03110 +Description = bsiRI_DH_SHA224 + +OID = 0 4 0 127 0 7 2 2 5 1 3 +Comment = BSI TR-03110 +Description = bsiRI_DH_SHA256 + +OID = 0 4 0 127 0 7 2 2 5 1 4 +Comment = BSI TR-03110 +Description = bsiRI_DH_SHA384 + +OID = 0 4 0 127 0 7 2 2 5 1 5 +Comment = BSI TR-03110 +Description = bsiRI_DH_SHA512 + +OID = 0 4 0 127 0 7 2 2 5 2 +Comment = BSI TR-03110 +Description = bsiRI_ECDH + +OID = 0 4 0 127 0 7 2 2 5 2 1 +Comment = BSI TR-03110 +Description = bsiRI_ECDH_SHA1 + +OID = 0 4 0 127 0 7 2 2 5 2 2 +Comment = BSI TR-03110 +Description = bsiRI_ECDH_SHA224 + +OID = 0 4 0 127 0 7 2 2 5 2 3 +Comment = BSI TR-03110 +Description = bsiRI_ECDH_SHA256 + +OID = 0 4 0 127 0 7 2 2 5 2 4 +Comment = BSI TR-03110 +Description = bsiRI_ECDH_SHA384 + +OID = 0 4 0 127 0 7 2 2 5 2 5 +Comment = BSI TR-03110 +Description = bsiRI_ECDH_SHA512 + +OID = 0 4 0 127 0 7 2 2 6 +Comment = BSI TR-03110 +Description = bsiCardInfo + +OID = 0 4 0 127 0 7 2 2 7 +Comment = BSI TR-03110 +Description = bsiEidSecurity + +OID = 0 4 0 127 0 7 2 2 8 +Comment = BSI TR-03110 +Description = bsiPT + +OID = 0 4 0 127 0 7 3 1 2 +Comment = BSI TR-03110 +Description = bsiEACRoles + OID = 0 4 0 127 0 7 3 1 2 1 Comment = BSI TR-03110 -Description = bsiRoleEAC +Description = bsiEACRolesIS + +OID = 0 4 0 127 0 7 3 1 2 2 +Comment = BSI TR-03110 +Description = bsiEACRolesAT + +OID = 0 4 0 127 0 7 3 1 2 3 +Comment = BSI TR-03110 +Description = bsiEACRolesST + +OID = 0 4 0 127 0 7 3 1 3 +Comment = BSI TR-03110 +Description = bsiTAv2ce + +OID = 0 4 0 127 0 7 3 1 3 1 +Comment = BSI TR-03110 +Description = bsiTAv2ceDescription + +OID = 0 4 0 127 0 7 3 1 3 1 1 +Comment = BSI TR-03110 +Description = bsiTAv2ceDescriptionPlainText + +OID = 0 4 0 127 0 7 3 1 3 1 2 +Comment = BSI TR-03110 +Description = bsiTAv2ceDescriptionIA5String + +OID = 0 4 0 127 0 7 3 1 3 1 3 +Comment = BSI TR-03110 +Description = bsiTAv2ceDescriptionOctetString + +OID = 0 4 0 127 0 7 3 1 3 2 +Comment = BSI TR-03110 +Description = bsiTAv2ceTerminalSector + +OID = 0 4 0 127 0 7 3 1 4 +Comment = BSI TR-03110 +Description = bsiAuxData + +OID = 0 4 0 127 0 7 3 1 4 1 +Comment = BSI TR-03110 +Description = bsiAuxDataBirthday + +OID = 0 4 0 127 0 7 3 1 4 2 +Comment = BSI TR-03110 +Description = bsiAuxDataExpireDate + +OID = 0 4 0 127 0 7 3 1 4 3 +Comment = BSI TR-03110 +Description = bsiAuxDataCommunityID + +OID = 0 4 0 127 0 7 3 1 4 +Comment = BSI TR-03110 +Description = bsiAuxData + +OID = 0 4 0 127 0 7 3 2 1 +Comment = BSI TR-03110 +Description = bsiSecObj # ETSI TS 101 862 V1.3.3 (2006-01), Qualified certificate profile @@ -827,14 +1086,6 @@ Comment = QGPKI policy Description = qgpkiMedIntermedDeviceSystem -OID = 1 2 36 1 3 1 1 1 1 1 2 -Comment = QGPKI policy -Description = qgpkiMedIntermedDeviceControl - -OID = 1 2 36 1 3 1 1 1 1 1 2 -Comment = QGPKI policy -Description = qgpkiMedIntermedDeviceControl - OID = 1 2 36 1 3 1 1 1 1 2 Comment = QGPKI policy Description = qgpkiMedIssuingCA @@ -1309,11 +1560,11 @@ Comment = ARIA algorithm modes Description = aria256-cfb -OID = 1 2 410 200046 1 1 13 +OID = 1 2 410 200046 1 1 14 Comment = ARIA algorithm modes Description = aria256-ofb -OID = 1 2 410 200046 1 1 13 +OID = 1 2 410 200046 1 1 15 Comment = ARIA algorithm modes Description = aria256-ctr @@ -2686,10 +2937,6 @@ Comment = S/MIME Symmetric Key Distribution Attributes Description = glKey -OID = 1 2 840 113549 1 9 15 -Comment = PKCS #9. This OID was formerly assigned as symmetricCapabilities, then reassigned as SMIMECapabilities, then renamed to the current name -Description = sMIMECapabilities - OID = 1 2 840 113549 1 9 16 9 Comment = S/MIME Description = signatureTypeIdentifier @@ -3229,6 +3476,100 @@ # Adobe +OID = 1 2 840 113583 1 +Comment = Adobe Acrobat +Description = adobeAcrobat + +OID = 1 2 840 113583 1 1 +Comment = Adobe Acrobat security +Description = acrobatSecurity + +OID = 1 2 840 113583 1 1 1 +Comment = Adobe Acrobat security +Description = pdfPassword + +OID = 1 2 840 113583 1 1 2 +Comment = Adobe Acrobat security +Description = pdfDefaultSigningCredential + +OID = 1 2 840 113583 1 1 3 +Comment = Adobe Acrobat security +Description = pdfDefaultEncryptionCredential + +OID = 1 2 840 113583 1 1 4 +Comment = Adobe Acrobat security +Description = pdfPasswordTimeout + +OID = 1 2 840 113583 1 1 5 +Comment = Adobe Acrobat security +Description = pdfAuthenticDocumentsTrust + +OID = 1 2 840 113583 1 1 6 +Comment = Adobe Acrobat security +Description = pdfDynamicContentTrust +Warning + +OID = 1 2 840 113583 1 1 7 +Comment = Adobe Acrobat security +Description = pdfUbiquityTrust + +OID = 1 2 840 113583 1 1 8 +Comment = Adobe Acrobat security +Description = pdfRevocationInfoArchival + +OID = 1 2 840 113583 1 1 9 +Comment = Adobe Acrobat security +Description = pdfX509Extension + +OID = 1 2 840 113583 1 1 9 1 +Comment = Adobe Acrobat security +Description = pdfTimeStamp + +OID = 1 2 840 113583 1 1 9 2 +Comment = Adobe Acrobat security +Description = pdfArchiveRevInfo + +OID = 1 2 840 113583 1 1 10 +Comment = Adobe Acrobat security +Description = pdfPPLKLiteCredential + +OID = 1 2 840 113583 1 2 +Comment = Adobe Acrobat CPS +Description = acrobatCPS + +OID = 1 2 840 113583 1 2 1 +Comment = Adobe Acrobat CPS +Description = pdfAuthenticDocumentsCPS + +OID = 1 2 840 113583 1 2 2 +Comment = Adobe Acrobat CPS +Description = pdfTestCPS + +OID = 1 2 840 113583 1 2 3 +Comment = Adobe Acrobat CPS +Description = pdfUbiquityCPS + +OID = 1 2 840 113583 1 2 4 +Comment = Adobe Acrobat CPS +Description = pdfAdhocCPS + +OID = 1 2 840 113583 1 7 +Comment = Adobe Acrobat ubiquity +Description = acrobatUbiquity + +OID = 1 2 840 113583 1 7 1 +Comment = Adobe Acrobat ubiquity +Description = pdfUbiquitySubRights + +# The following arc is explicitly reserved for extensions that don't fall +# under 1 2 840 113583 1 1 9. In other words someone at Adobe either made +# an editing error or codified an OID-encoding error. +OID = 1 2 840 113583 1 9 +Comment = Adobe Acrobat X.509 extension +Description = acrobatExtension + +# Another Adobe(?) + OID = 1 2 840 113628 114 1 7 Comment = Adobe Description = adobePKCS7 @@ -4313,6 +4654,28 @@ Comment = Northrop Grumman policy Description = ngcClass3 +# Safenet + +OID = 1 3 6 1 4 1 23629 1 4 2 1 1 +Comment = SafeNet +Description = safenetUsageLimit + +OID = 1 3 6 1 4 1 23629 1 4 2 1 2 +Comment = SafeNet +Description = safenetEndDate + +OID = 1 3 6 1 4 1 23629 1 4 2 1 3 +Comment = SafeNet +Description = safenetStartDate + +OID = 1 3 6 1 4 1 23629 1 4 2 1 4 +Comment = SafeNet +Description = safenetAdminCert + +OID = 1 3 6 1 4 1 23629 1 4 2 2 1 +Comment = SafeNet +Description = safenetKeyDigest + # PKIX OID = 1 3 6 1 5 5 7 @@ -5827,9 +6190,9 @@ Comment = Teletrust presentation types Description = ptWMF -OID = 1 3 36 8 7 1 43 +OID = 1 3 36 8 7 1 44 Comment = Teletrust presentation types -Description = ptWordPerfect x +Description = ptWordPerfect OID = 1 3 36 8 7 1 45 Comment = Teletrust presentation types @@ -7853,10 +8216,6 @@ Comment = Verisign policy (obsolete) Description = verisignCPSv1nsi -OID = 2 16 840 1 113733 1 7 23 6 -Comment = Verisign extension -Description = verisignEVPolicy - OID = 2 16 840 1 113733 1 8 1 Comment = Verisign Description = verisignISSStrongCrypto @@ -7902,8 +8261,40 @@ Description = extensionReq Warning +# Intel. Intel's BIOS-signing certificates contain the following OID +# values: +# +# 2 16 840 1 113741 2 1 3 1 +# 2 16 840 1 113741 3 1 1 1 1 2 1 +# 2 16 840 1 113741 3 1 1 1 2 1 1 +# 2 16 840 1 113741 3 1 1 2 2 1 1 +# 2 16 840 1 113741 3 1 1 2 1 1 1 1 +# +# None of these are documented anywhere, in fact the entire '3' arc isn't +# documented. + +OID = 2 16 840 1 113741 2 +Comment = Intel CDSA +Description = intelCDSA + # DigiCert +OID = 2 16 840 1 114412 1 +Comment = Digicert CA policy +Description = digiCertNonEVCerts + +OID = 2 16 840 1 114412 1 1 +Comment = Digicert CA policy +Description = digiCertOVCert + +OID = 2 16 840 1 114412 1 2 +Comment = Digicert CA policy +Description = digiCertDVCert + +OID = 2 16 840 1 114412 1 11 +Comment = Digicert CA policy +Description = digiCertFederatedDeviceCert + OID = 2 16 840 1 114412 1 3 0 1 Comment = Digicert CA policy Description = digiCertGlobalCAPolicy @@ -7920,6 +8311,88 @@ Comment = Digicert CA policy Description = digiCertAssuredIDRootCAPolicy +OID = 2 16 840 1 114412 2 2 +Comment = Digicert CA policy +Description = digiCertEVCert + +OID = 2 16 840 1 114412 2 3 +Comment = Digicert CA policy +Description = digiCertObjectSigningCert + +OID = 2 16 840 1 114412 2 3 1 +Comment = Digicert CA policy +Description = digiCertCodeSigningCert + +OID = 2 16 840 1 114412 2 3 2 +Comment = Digicert CA policy +Description = digiCertEVCodeSigningCert + +OID = 2 16 840 1 114412 2 3 11 +Comment = Digicert CA policy +Description = digiCertKernelCodeSigningCert + +OID = 2 16 840 1 114412 2 3 21 +Comment = Digicert CA policy +Description = digiCertDocumentSigningCert + +OID = 2 16 840 1 114412 2 4 +Comment = Digicert CA policy +Description = digiCertClientCert + +OID = 2 16 840 1 114412 2 4 1 1 +Comment = Digicert CA policy +Description = digiCertLevel1PersonalClientCert + +OID = 2 16 840 1 114412 2 4 1 2 +Comment = Digicert CA policy +Description = digiCertLevel1EnterpriseClientCert + +OID = 2 16 840 1 114412 2 4 2 +Comment = Digicert CA policy +Description = digiCertLevel2ClientCert + +OID = 2 16 840 1 114412 2 4 3 1 +Comment = Digicert CA policy +Description = digiCertLevel3USClientCert + +OID = 2 16 840 1 114412 2 4 3 2 +Comment = Digicert CA policy +Description = digiCertLevel3CBPClientCert + +OID = 2 16 840 1 114412 2 4 4 1 +Comment = Digicert CA policy +Description = digiCertLevel4USClientCert + +OID = 2 16 840 1 114412 2 4 4 2 +Comment = Digicert CA policy +Description = digiCertLevel4CBPClientCert + +OID = 2 16 840 1 114412 2 4 5 1 +Comment = Digicert CA policy +Description = digiCertPIVHardwareCert + +OID = 2 16 840 1 114412 2 4 5 2 +Comment = Digicert CA policy +Description = digiCertPIVCardAuthCert + +OID = 2 16 840 1 114412 2 4 5 3 +Comment = Digicert CA policy +Description = digiCertPIVContentSigningCert + +OID = 2 16 840 1 114412 4 31 +Comment = Digicert CA policy +Description = digiCertGridClassicCert + +OID = 2 16 840 1 114412 4 31 5 +Comment = Digicert CA policy +Description = digiCertGridIntegratedCert + +# There's another arc for grid stuff around 2 16 840 1 114412 31 * +# so the following probably isn't a typo. +OID = 2 16 840 1 114412 31 4 31 1 +Comment = Digicert CA policy +Description = digiCertGridHostCert + # SET OID = 2 23 42 0 @@ -8260,6 +8733,20 @@ Comment = SET national Description = Japan +# PostSignum. + +OID = 2 23 134 1 4 2 1 +Comment = PostSignum CA +Description = postSignumRootQCA + +OID = 2 23 134 1 2 2 3 +Comment = PostSignum CA +Description = postSignumPublicCA + +OID = 2 23 134 1 2 1 8 210 +Comment = PostSignum CA +Description = postSignumCommercialServerPolicy + # ICAO. Technically this OID is called "SOD" but displaying that as a name # will just bugger up people's understanding of the data. Newer versions of # the spec call it ldsSecurityObject but that's a bit too vague to indicate @@ -8309,14 +8796,26 @@ # EV certificate policies. There's no official record of what all the EV # policy OIDs are, it seems to be defined as "whatever the browsers will -# accept as EV". The following list is from the Chromium -# ev_root_ca_metadata list. The OIDs are collected here in owner-name -# alphabetical order rather than scattering them throughout this list -# in OID order to make it easier to track what's already present. - -OID = 1 3 6 1 4 1 6449 1 2 1 5 1 -Comment = AddTrust External CA Root -Description = AddTrust EV policy +# accept as EV". This is taken from +# http://en.wikipedia.org/wiki/Extended_Validation_Certificate, there's also +# a list in Chromium, the ev_root_ca_metadata list, but this contains +# errors (e.g. the value "1.3.6.1.4.1.6449.1.2.1.5.1" [sic] is recorded as +# being for both AddTrust and Comodo). +# +# The OIDs are collected here in owner-name alphabetical order rather than +# scattering them throughout this list in OID order to make it easier to +# track what's already present. + +OID = 1 2 40 0 17 1 22 +Comment = A-Trust CA Root +Description = A-Trust EV policy + +# This appears to be an error in Chromium's ev_root_ca_metadata. +# OTOH this OID was also used by UTN-Userfirst, which is now +# Comodo. +#OID = 1 3 6 1 4 1 6449 1 2 1 5 1 +#Comment = AddTrust External CA Root +#Description = AddTrust EV policy OID = 1 3 6 1 4 1 34697 2 1 Comment = AffirmTrust Commercial @@ -8338,22 +8837,30 @@ Comment = BuyPass Class 3 EV Description = BuyPass EV policy +OID = 1 3 6 1 4 1 17326 10 14 2 1 2 +Comment = Camerfirma CA Root +Description = Camerfirma EV policy + +OID = 1 3 6 1 4 1 17326 10 8 12 1 2 +Comment = Camerfirma CA Root +Description = Camerfirma EV policy + OID = 1 3 6 1 4 1 22234 2 5 2 3 1 -Comment = CertPlus Class 2 Primary CA (KEYNECTIS) +Comment = CertPlus Class 2 Primary CA (formerly Keynectis) Description = CertPlus EV policy OID = 1 3 6 1 4 1 6449 1 2 1 5 1 Comment = COMODO Certification Authority Description = Comodo EV policy -OID = 1 3 6 1 4 1 6449 1 2 1 5 1 -Comment = COMODO ECC Certification Authority -Description = Comodo EV policy - OID = 1 3 6 1 4 1 6334 1 100 1 -Comment = Cybertrust Global Root +Comment = Cybertrust Global Root (now Verizon Business) Description = Cybertrust EV policy +OID = 1 3 6 1 4 1 4788 2 202 1 +Comment = D-TRUST Root Class 3 CA 2 EV 2009 +Description = D-TRUST EV policy + OID = 2 16 840 1 114412 2 1 Comment = DigiCert High Assurance EV Root CA Description = DigiCert EV policy @@ -8363,37 +8870,21 @@ Description = DigiNotar EV policy OID = 2 16 840 1 114028 10 1 2 -Comment = Entrust Net Secure Server Certification Authority -Description = Entrust EV policy - -OID = 2 16 840 1 114028 10 1 2 Comment = Entrust Root Certification Authority Description = Entrust EV policy OID = 1 3 6 1 4 1 14370 1 6 -Comment = Equifax Secure Certificate Authority (GeoTrust) -Description = Equifax EV policy - -OID = 1 3 6 1 4 1 14370 1 6 -Comment = GeoTrust Primary Certification Authority +Comment = GeoTrust Primary Certification Authority (formerly Equifax) Description = GeoTrust EV policy OID = 1 3 6 1 4 1 4146 1 1 Comment = GlobalSign Description = GlobalSign EV policy -OID = 1 3 6 1 4 1 4146 1 1 -Comment = GlobalSign Root CA -Description = GlobalSign EV policy - OID = 2 16 840 1 114413 1 7 23 3 -Comment = GoDaddy Class 2 Certification Authority +Comment = GoDaddy Class 2 Certification Authority (formerly ValiCert) Description = GoDaddy EV policy -OID = 1 3 6 1 4 1 6334 1 100 1 -Comment = GTE CyberTrust Global Root -Description = GTE CyberTrust EV policy - OID = 1 3 6 1 4 1 14777 6 1 1 Comment = Certificado de Servidor Seguro SSL EV Description = Izenpe EV policy @@ -8402,10 +8893,6 @@ Comment = Certificado de Sede Electronica EV Description = Izenpe EV policy -OID = 1 3 6 1 4 1 22234 2 5 2 3 1 -Comment = Keynectis EV CA -Description = Keynectis EV policy - OID = 1 3 6 1 4 1 782 1 2 1 8 1 Comment = Network Solutions Certificate Authority Description = Network Solutions EV policy @@ -8415,71 +8902,43 @@ Description = QuoVadis EV policy OID = 1 2 392 200091 100 721 1 -Comment = SECOM Trust Systems EV -Description = SECOM EV policy - -OID = 2 16 840 1 114404 1 1 2 4 1 -Comment = SecureTrust CA, SecureTrust Corporation -Description = SecureTrust EV policy - -OID = 2 16 840 1 114404 1 1 2 4 1 -Comment = Secure Global CA, SecureTrust Corporation -Description = Secure Global EV policy - -OID = 1 2 392 200091 100 721 1 Comment = Security Communication RootCA1 -Description = Security Communication EV policy - -OID = 1 3 6 1 4 1 23223 1 1 1 -Comment = StartCom Certification Authority -Description = StartCom EV policy +Description = Security Communication (SECOM) EV policy OID = 2 16 840 1 114414 1 7 23 3 Comment = Starfield Class 2 Certification Authority Description = Starfield EV policy +OID = 1 3 6 1 4 1 23223 1 1 1 +Comment = StartCom Certification Authority +Description = StartCom EV policy + OID = 2 16 756 1 89 1 2 1 1 Comment = SwissSign Gold CA - G2 Description = SwissSign EV policy -OID = 2 16 840 1 113733 1 7 48 1 -Comment = Thawte Premium Server CA -Description = Thawte EV policy +OID = 1 3 6 1 4 1 7879 13 24 1 +Comment = T-TeleSec GlobalRoot Class 3 +Description = T-TeleSec EV policy OID = 2 16 840 1 113733 1 7 48 1 -Comment = Thawte Primary Root CA +Comment = Thawte Premium Server CA Description = Thawte EV policy OID = 2 16 840 1 114404 1 1 2 4 1 -Comment = SecureTrust EV -Description = SecureTrust EV policy - -OID = 1 3 6 1 4 1 6449 1 2 1 5 1 -Comment = UTN-DATACorp SGC -Description = UTN-DATACorp EV policy +Comment = TrustWave CA, formerly SecureTrust, before that XRamp +Description = TrustWave EV policy -OID = 1 3 6 1 4 1 6449 1 2 1 5 1 -Comment = UTN-USERFirst-Hardware -Description = UTN-USERFirst EV policy - -OID = 2 16 840 1 114413 1 7 23 3 -Comment = ValiCert Class 2 Policy Validation Authority -Description = ValiCert EV policy +OID = 1 3 6 1 4 1 40869 1 1 22 3 +Comment = TWCA Root Certification Authority +Description = TWCA EV policy OID = 2 16 840 1 113733 1 7 23 6 Comment = VeriSign Class 3 Public Primary Certification Authority Description = VeriSign EV policy -OID = 2 16 840 1 113733 1 7 23 6 -Comment = VeriSign Class 3 Public Primary Certification Authority - G5 -Description = VeriSign EV policy - OID = 2 16 840 1 114171 500 9 Comment = Wells Fargo WellsSecure Public Root Certificate Authority Description = Wells Fargo EV policy -OID = 2 16 840 1 114404 1 1 2 4 1 -Comment = XRamp Global Certification Authority -Description = XRamp EV policy - # End of Fahnenstange diff -Nru web2ldap-1.1.31~dfsg/etc/httpd/sample-mod_fastcgi.conf web2ldap-1.1.43~dfsg/etc/httpd/sample-mod_fastcgi.conf --- web2ldap-1.1.31~dfsg/etc/httpd/sample-mod_fastcgi.conf 2012-04-05 19:58:04.000000000 +0000 +++ web2ldap-1.1.43~dfsg/etc/httpd/sample-mod_fastcgi.conf 2013-03-12 11:24:33.000000000 +0000 @@ -2,7 +2,7 @@ # web2ldap under the control of Apache with mod_fastcgi # # application is access through following URL: -# http:///web2ldap-fcgi/web2ldap.py +# http:///web2ldap # # See mod_fastcgi docs on: # http://www.fastcgi.com/mod_fastcgi/docs/mod_fastcgi.html diff -Nru web2ldap-1.1.31~dfsg/etc/httpd/sample-mod_fcgid.conf web2ldap-1.1.43~dfsg/etc/httpd/sample-mod_fcgid.conf --- web2ldap-1.1.31~dfsg/etc/httpd/sample-mod_fcgid.conf 2012-10-24 17:42:05.000000000 +0000 +++ web2ldap-1.1.43~dfsg/etc/httpd/sample-mod_fcgid.conf 2013-03-12 11:24:33.000000000 +0000 @@ -2,7 +2,7 @@ # web2ldap under the control of Apache with mod_fcgid # # application is access through following URL: -# http:///web2ldap-fcgi/web2ldap.py +# http:///web2ldap # # See mod_fcgid docs on: # http://httpd.apache.org/mod_fcgid/ diff -Nru web2ldap-1.1.31~dfsg/etc/systemd/web2ldap.service web2ldap-1.1.43~dfsg/etc/systemd/web2ldap.service --- web2ldap-1.1.31~dfsg/etc/systemd/web2ldap.service 2012-05-12 19:38:58.000000000 +0000 +++ web2ldap-1.1.43~dfsg/etc/systemd/web2ldap.service 2013-06-22 15:51:04.000000000 +0000 @@ -1,4 +1,3 @@ -# $Id: web2ldap.service,v 1.2 2012/05/12 19:38:58 michael Exp $ # required by systemd, this service file should be used to # to start web2ldap standalone service # modify ExecStart according to your settings diff -Nru web2ldap-1.1.31~dfsg/etc/web2ldap/ldapoidreg.py web2ldap-1.1.43~dfsg/etc/web2ldap/ldapoidreg.py --- web2ldap-1.1.31~dfsg/etc/web2ldap/ldapoidreg.py 2012-12-17 20:52:57.000000000 +0000 +++ web2ldap-1.1.43~dfsg/etc/web2ldap/ldapoidreg.py 2013-08-31 19:28:14.000000000 +0000 @@ -9,8 +9,6 @@ see http://www.web2ldap.de for details Comprehensive list initially contributed by Norbert Klasen - -$Id: ldapoidreg.py,v 1.94 2012/12/17 20:52:57 michael Exp $ """ oid_list = ( @@ -1228,7 +1226,8 @@ u"SunONE Directory Server 5.2+"), ############################################################################ - # IBM Tivoli Directory Server + # IBM Directory Server + # see http://pic.dhe.ibm.com/infocenter/tivihelp/v2r1/topic/com.ibm.IBMDS.doc/admin_gd508.htm ############################################################################ # ACI mechanisms @@ -1352,6 +1351,34 @@ u"User type extended operation", u"Request to get the User Type of the bound user.", u"IBM Directory Server"), + ("1.3.18.0.2.12.64", + u"Prepare transaction extended operation", + u"Requests the server to start processing the operations sent in a transaction.", + u"IBM Directory Server"), + ("1.3.18.0.2.12.74", + u"Online backup extended operation", + u"Perform online backup of the directory server instance's database.", + u"IBM Directory Server"), + ("1.3.18.0.2.12.75", + u"Effective password policy extended operation", + u"Query effective password policy for a user or a group.", + u"IBM Directory Server"), + ("1.3.18.0.2.12.79", + u"Password policy bind initialize and verify extended operation", + u"Performs password policy bind initialization and verification for a specified user.", + u"IBM Directory Server"), + ("1.3.18.0.2.12.80", + u"Password policy finalize and verify bind extended operation", + u"Performs password policy post-bind processing for a specified user.", + u"IBM Directory Server"), + ("1.3.18.0.2.12.73", + u"Get file extended operation", + u"Return the contents of a given file on the server.", + u"IBM Directory Server"), + ("1.3.18.0.2.12.70", + u"LogMgmtControl extended operation", + u"Start, stop, or query the status of the log management.", + u"IBM Directory Server"), # Extended controls @@ -1403,6 +1430,18 @@ u"Transaction control", u"Marks the operation as part of a transactional context.", u"IBM Directory Server"), + ("1.3.18.0.2.10.30", + u"Limit number of attribute values control", + u"Limit the number of attribute values returned for an entry in a search operation.", + u"IBM Directory Server"), + ("1.3.18.0.2.10.32", + u"Delete operation timestamp control", + u"Send the modified timestamp values to a replica during a delete operation.", + u"IBM Directory Server"), + ("1.3.18.0.2.10.33", + u"Return deleted objects control", + u"Return all entries in the database including those with (isDeleted=TRUE).", + u"IBM Directory Server"), # Supported and enabled capabilities diff -Nru web2ldap-1.1.31~dfsg/etc/web2ldap/localschema.ldif web2ldap-1.1.43~dfsg/etc/web2ldap/localschema.ldif --- web2ldap-1.1.31~dfsg/etc/web2ldap/localschema.ldif 2012-12-08 20:07:00.000000000 +0000 +++ web2ldap-1.1.43~dfsg/etc/web2ldap/localschema.ldif 2013-06-22 15:51:04.000000000 +0000 @@ -1,6 +1,5 @@ #----------------------------------------------------------------- # Local fallback subschema for web2ldap -# $Id: localschema.ldif,v 1.19 2012/12/08 20:07:00 michael Exp $ #----------------------------------------------------------------- version: 1 diff -Nru web2ldap-1.1.31~dfsg/etc/web2ldap/templates/html_begin.html web2ldap-1.1.43~dfsg/etc/web2ldap/templates/html_begin.html --- web2ldap-1.1.31~dfsg/etc/web2ldap/templates/html_begin.html 2012-09-06 10:58:41.000000000 +0000 +++ web2ldap-1.1.43~dfsg/etc/web2ldap/templates/html_begin.html 2013-06-15 18:55:07.000000000 +0000 @@ -11,12 +11,6 @@ - diff -Nru web2ldap-1.1.31~dfsg/etc/web2ldap/templates/inputform_msPerson.html web2ldap-1.1.43~dfsg/etc/web2ldap/templates/inputform_msPerson.html --- web2ldap-1.1.31~dfsg/etc/web2ldap/templates/inputform_msPerson.html 2012-03-03 16:06:12.000000000 +0000 +++ web2ldap-1.1.43~dfsg/etc/web2ldap/templates/inputform_msPerson.html 2013-06-18 18:16:55.000000000 +0000 @@ -11,6 +11,14 @@ + Personal title: + + + %(personalTitle)s + + + + Gender (1=male, 2=female): diff -Nru web2ldap-1.1.31~dfsg/etc/web2ldap/templates/inputform_msPerson.html.de web2ldap-1.1.43~dfsg/etc/web2ldap/templates/inputform_msPerson.html.de --- web2ldap-1.1.31~dfsg/etc/web2ldap/templates/inputform_msPerson.html.de 2012-03-03 16:22:24.000000000 +0000 +++ web2ldap-1.1.43~dfsg/etc/web2ldap/templates/inputform_msPerson.html.de 2013-06-18 18:16:55.000000000 +0000 @@ -11,6 +11,14 @@ + Anrede: + + + %(personalTitle)s + + + + Geschlecht (1=männlich, 2=weiblich): diff -Nru web2ldap-1.1.31~dfsg/etc/web2ldap/templates/inputform_pwdPolicy.html web2ldap-1.1.43~dfsg/etc/web2ldap/templates/inputform_pwdPolicy.html --- web2ldap-1.1.31~dfsg/etc/web2ldap/templates/inputform_pwdPolicy.html 2011-11-09 21:19:39.000000000 +0000 +++ web2ldap-1.1.43~dfsg/etc/web2ldap/templates/inputform_pwdPolicy.html 2013-02-25 21:26:20.000000000 +0000 @@ -9,7 +9,7 @@ Minimum time between password modifications: - %(pwdMinAge)s seconds + %(pwdMinAge)s Maximum number of passwords stored in history: @@ -42,11 +42,11 @@ - + - + @@ -65,7 +65,7 @@ - + @@ -73,7 +73,7 @@ - +
Time after which a password is no longer valid (password expiry):%(pwdMaxAge)s seconds%(pwdMaxAge)s
Time before password expiry a warning message is returned:%(pwdExpireWarning)s seconds%(pwdExpireWarning)s
Maximum number of times that an expired password may be used:
Time for password lockout:%(pwdLockoutDuration)s seconds%(pwdLockoutDuration)s
Number of failed bind attempts for lockout:
Time after which failed bind attempts are purged:%(pwdFailureCountInterval)s seconds%(pwdFailureCountInterval)s
diff -Nru web2ldap-1.1.31~dfsg/etc/web2ldap/templates/read_msPerson.html web2ldap-1.1.43~dfsg/etc/web2ldap/templates/read_msPerson.html --- web2ldap-1.1.31~dfsg/etc/web2ldap/templates/read_msPerson.html 2012-03-03 16:06:12.000000000 +0000 +++ web2ldap-1.1.43~dfsg/etc/web2ldap/templates/read_msPerson.html 2013-06-18 18:16:55.000000000 +0000 @@ -11,6 +11,14 @@ + Personal title: + + + %(personalTitle)s + + + + Gender (1=male, 2=female): diff -Nru web2ldap-1.1.31~dfsg/etc/web2ldap/templates/read_msPerson.html.de web2ldap-1.1.43~dfsg/etc/web2ldap/templates/read_msPerson.html.de --- web2ldap-1.1.31~dfsg/etc/web2ldap/templates/read_msPerson.html.de 2012-03-03 16:22:42.000000000 +0000 +++ web2ldap-1.1.43~dfsg/etc/web2ldap/templates/read_msPerson.html.de 2013-06-18 18:16:55.000000000 +0000 @@ -11,6 +11,14 @@ + Anrede: + + + %(personalTitle)s + + + + Geschlecht (1=männlich, 2=weiblich): diff -Nru web2ldap-1.1.31~dfsg/etc/web2ldap/templates/read_pwdPolicy.html web2ldap-1.1.43~dfsg/etc/web2ldap/templates/read_pwdPolicy.html --- web2ldap-1.1.31~dfsg/etc/web2ldap/templates/read_pwdPolicy.html 2012-12-21 16:41:11.000000000 +0000 +++ web2ldap-1.1.43~dfsg/etc/web2ldap/templates/read_pwdPolicy.html 2013-05-21 21:20:37.000000000 +0000 @@ -1,4 +1,8 @@ -

Password policy

+

Password policy %(cn)s

+ +

+ %(description)s +

Password change parameters

@@ -9,7 +13,7 @@ Minimum time between password modifications: - %(pwdMinAge)s seconds + %(pwdMinAge)s Maximum number of passwords stored in history: @@ -42,11 +46,11 @@ - + - + @@ -65,7 +69,7 @@ - + @@ -73,7 +77,7 @@ - +
Time after which a password is no longer valid (password expiry):%(pwdMaxAge)s seconds%(pwdMaxAge)s
Time before password expiry a warning message is returned:%(pwdExpireWarning)s seconds%(pwdExpireWarning)s
Maximum number of times that an expired password may be used:
Duration of password lockout:%(pwdLockoutDuration)s seconds%(pwdLockoutDuration)s
Number of failed bind attempts for lockout:
Time after which failed bind attempts are purged:%(pwdFailureCountInterval)s seconds%(pwdFailureCountInterval)s
diff -Nru web2ldap-1.1.31~dfsg/etc/web2ldap/templates/searchform_Base.html web2ldap-1.1.43~dfsg/etc/web2ldap/templates/searchform_Base.html --- web2ldap-1.1.31~dfsg/etc/web2ldap/templates/searchform_Base.html 2012-02-27 09:40:07.000000000 +0000 +++ web2ldap-1.1.43~dfsg/etc/web2ldap/templates/searchform_Base.html 2013-05-15 14:35:33.000000000 +0000 @@ -34,10 +34,12 @@ is

diff -Nru web2ldap-1.1.31~dfsg/etc/web2ldap/templates/searchform_Base.html.de web2ldap-1.1.43~dfsg/etc/web2ldap/templates/searchform_Base.html.de --- web2ldap-1.1.31~dfsg/etc/web2ldap/templates/searchform_Base.html.de 2011-10-17 09:44:00.000000000 +0000 +++ web2ldap-1.1.43~dfsg/etc/web2ldap/templates/searchform_Base.html.de 2013-05-15 14:35:33.000000000 +0000 @@ -34,10 +34,12 @@ ist

diff -Nru web2ldap-1.1.31~dfsg/etc/web2ldap/web2ldapcnf/hosts.py web2ldap-1.1.43~dfsg/etc/web2ldap/web2ldapcnf/hosts.py --- web2ldap-1.1.31~dfsg/etc/web2ldap/web2ldapcnf/hosts.py 2012-12-27 13:30:49.000000000 +0000 +++ web2ldap-1.1.43~dfsg/etc/web2ldap/web2ldapcnf/hosts.py 2013-08-30 17:51:14.000000000 +0000 @@ -130,12 +130,13 @@ # Sun Directory Server 'isMemberOf', # MS Active Directory + 'nTSecurityDescriptor', 'tokenGroups','tokenGroupsGlobalAndUniversal','tokenGroupsNoGCAcceptable', 'mS-DS-CreatorSID','primaryGroupToken','canonicalName','fromEntry', 'sDRightsEffective','msDS-Approx-Immed-Subordinates','msDS-KeyVersionNumber', # 'msDS-ReplAttributeMetaData', # 'lastLogonTimestamp','lockoutTime', -# 'allowedAttributes','allowedAttributesEffective','allowedChildClasses','allowedChildClassesEffective', + 'allowedAttributes','allowedAttributesEffective','allowedChildClasses','allowedChildClassesEffective', # X.500 DSAs 'administrativeRole', ], @@ -199,13 +200,7 @@ login_default_mech='', # Attributes which should be present in attribute select list of advanced search form - search_attrs=[ - 'cn','mail','sn','givenName', - 'o','ou','departmentNumber','employeeNumber', - 'telephoneNumber','homePhone','mobile', - 'l','streetAddress','uid','uidNumber','description', - 'objectClass','entryUUID', - ], + search_attrs=[], # There are some situations where this client just wants to get the # attributes of an entry and not the data itself for saving bandwidth. @@ -382,6 +377,15 @@ ssl_valid_dn=r'^/S=Stroeder/G=Michael/CN=Michael Stroeder/Email=michael@stroeder.com$', ssl_valid_idn=r'^/C=ZA/ST=Western Cape/L=Durbanville/O=Thawte/OU=Certificate Services/CN=Personal Freemail RSA 1999\.9\.16$', session_track_control=1, + searchform_search_root_url=u'ldap:///dc=stroeder,dc=de??sub?(&(|(ou:dn:=Bizness)(ou:dn:=Kultur))(objectClass=organization)(hasSubordinates=TRUE))', + search_attrs=[ + 'cn','mail','sn','givenName','personalTitle','businessTitle', + 'o','ou','departmentNumber','employeeNumber', + 'telephoneNumber','homePhone','mobile', + 'c','st','l','streetAddress','roomNumber', + 'uid','uidNumber','description', + 'objectClass','entryUUID','organizationalStatus', + ], read_template={ # 'object class':'pathname of HTML template file' 'germanBankArrangement':os.path.join(web2ldapcnf.templates_dir,'read_germanBankArrangement.html'), @@ -434,14 +438,14 @@ 'ldap:///cn=accesslog': Web2LDAPConfig( description=u'OpenLDAP accesslog', search_tdtemplate= { - 'auditsearch':r'%(reqtype)s %(reqstart)s session %(reqSession)s ⇒ %(reqresult)s
Search %(reqscope)s: %(reqdn)s
%(reqfilter)s', - 'auditbind':r'%(reqtype)s %(reqstart)s session %(reqSession)s ⇒ %(reqresult)s: %(reqsession)s
%(reqdn)s', - 'auditadd':r'%(reqtype)s %(reqstart)s session %(reqSession)s ⇒ %(reqresult)s
Entry %(reqdn)s added
by %(reqauthzid)s', - 'auditmodify':r'%(reqtype)s %(reqstart)s session %(reqSession)s ⇒ %(reqresult)s
Entry %(reqdn)s modified
by %(reqauthzid)s', - 'auditmodrdn':r'%(reqtype)s %(reqstart)s session %(reqSession)s ⇒ %(reqresult)s
Entry %(reqdn)s renamed to %(reqnewrdn)s,%(reqnewsuperior)s
by %(reqauthzid)s', - 'auditobject':r'%(reqtype)s %(reqstart)s session %(reqSession)s ⇒ %(reqresult)s
by %(reqauthzid)s', - 'auditdelete':r'%(reqtype)s %(reqstart)s session %(reqSession)s ⇒ %(reqresult)s
Entry %(reqdn)s deleted
by %(reqauthzid)s', - 'auditabandon':r'%(reqtype)s %(reqstart)s session %(reqSession)s ⇒ %(reqresult)s
Abandonded %(reqId)s by %(reqauthzid)s', + 'auditsearch':r'%(reqtype)s %(reqstart)s session %(reqSession)s
⇒ %(reqresult)s: %(reqMessage)s
Search %(reqscope)s: %(reqdn)s
%(reqfilter)s', + 'auditbind':r'%(reqtype)s %(reqstart)s session %(reqSession)s
⇒ %(reqresult)s: %(reqMessage)s: %(reqsession)s
%(reqdn)s', + 'auditadd':r'%(reqtype)s %(reqstart)s session %(reqSession)s
⇒ %(reqresult)s: %(reqMessage)s
Entry %(reqdn)s added
by %(reqauthzid)s', + 'auditmodify':r'%(reqtype)s %(reqstart)s session %(reqSession)s
⇒ %(reqresult)s: %(reqMessage)s
Entry %(reqdn)s modified
by %(reqauthzid)s', + 'auditmodrdn':r'%(reqtype)s %(reqstart)s session %(reqSession)s
⇒ %(reqresult)s: %(reqMessage)s
Entry %(reqdn)s renamed to %(reqnewrdn)s,%(reqnewsuperior)s
by %(reqauthzid)s', + 'auditobject':r'%(reqtype)s %(reqstart)s session %(reqSession)s
⇒ %(reqresult)s: %(reqMessage)s
by %(reqauthzid)s', + 'auditdelete':r'%(reqtype)s %(reqstart)s session %(reqSession)s
⇒ %(reqresult)s: %(reqMessage)s
Entry %(reqdn)s deleted
by %(reqauthzid)s', + 'auditabandon':r'%(reqtype)s %(reqstart)s session %(reqSession)s
⇒ %(reqresult)s: %(reqMessage)s
Abandonded %(reqId)s by %(reqauthzid)s', }, searchform_template= { u'_':os.path.join(web2ldapcnf.templates_dir,'searchform_accesslog.html'), @@ -477,7 +481,8 @@ # for OpenLDAP 'monitorOperation':r'%(cn)s operations: %(monitorOpCompleted)s of %(monitorOpInitiated)s completed', 'monitoredObject':r"""%(cn)s: %(monitoredInfo)s
- %(monitorTimestamp)s %(namingContexts)s %(labeledURI)s + %(monitorTimestamp)s %(namingContexts)s %(labeledURI)s
+ %(seeAlso)s """, 'monitorContainer':r'%(cn)s - %(description)s', 'monitorCounterObject':r'%(cn)s: %(monitorCounter)s', diff -Nru web2ldap-1.1.31~dfsg/etc/web2ldap/web2ldapcnf/misc.py web2ldap-1.1.43~dfsg/etc/web2ldap/web2ldapcnf/misc.py --- web2ldap-1.1.31~dfsg/etc/web2ldap/web2ldapcnf/misc.py 2012-12-01 17:07:40.000000000 +0000 +++ web2ldap-1.1.43~dfsg/etc/web2ldap/web2ldapcnf/misc.py 2013-06-15 18:55:07.000000000 +0000 @@ -116,6 +116,24 @@ 'SSL_CLIENT_M_SERIAL','SSL_CLIENT_CERT_SERIAL', ) +# Static dict of HTTP headers to be always sent to the browser +http_headers = { + 'Pragma':'no-cache', + 'Cache-Control':'no-store,no-cache,max-age=0,must-revalidate', + 'X-XSS-Protection':'0', + 'X-DNS-Prefetch-Control':'off', + 'X-Content-Type-Options':'nosniff', + 'X-FRAME-OPTIONS':'DENY', + # Content Security Policy + 'X-Content-Security-Policy':';'.join(( + "default-src 'self'", +# "connect-src 'none'", + "script-src 'none'", +# "report-uri https://nb2.stroeder.local/csp-error-handler", + )), +} +http_headers['X-Webkit-CSP'] = http_headers['X-Content-Security-Policy'] + # If non-zero this is the time-span in seconds after which a # new session ID is generated. # Disadvantage: The browser's back button does not work anymore. diff -Nru web2ldap-1.1.31~dfsg/etc/web2ldap/web2ldapcnf/plugins/__init__.py web2ldap-1.1.43~dfsg/etc/web2ldap/web2ldapcnf/plugins/__init__.py --- web2ldap-1.1.31~dfsg/etc/web2ldap/web2ldapcnf/plugins/__init__.py 2013-02-08 19:38:36.000000000 +0000 +++ web2ldap-1.1.43~dfsg/etc/web2ldap/web2ldapcnf/plugins/__init__.py 2013-08-31 23:44:39.000000000 +0000 @@ -5,8 +5,6 @@ Some features might be too special so consider this file to be subject of local configuration and tweak it to your needs. - -$Id: __init__.py,v 1.49 2013/02/08 19:38:36 michael Exp $ """ #--------------------------------------------------------------------------- @@ -188,6 +186,12 @@ import w2lapp.schema.plugins.asn1objects #--------------------------------------------------------------------------- +# X.509-related LDAP syntaxes defined in RFC 4523 +#--------------------------------------------------------------------------- + +import w2lapp.schema.plugins.x509 + +#--------------------------------------------------------------------------- # X.509 cert/CRL schema #--------------------------------------------------------------------------- @@ -224,6 +228,12 @@ import w2lapp.schema.plugins.dds #--------------------------------------------------------------------------- +# Attribute types for FreeRADIUS/LDAP +#--------------------------------------------------------------------------- + +import w2lapp.schema.plugins.freeradius + +#--------------------------------------------------------------------------- # Add more local or experimental plugins from # etc/web2ldap/web2ldapcnf/plugins/ here #--------------------------------------------------------------------------- diff -Nru web2ldap-1.1.31~dfsg/fcgi/web2ldap.py web2ldap-1.1.43~dfsg/fcgi/web2ldap.py --- web2ldap-1.1.31~dfsg/fcgi/web2ldap.py 2012-06-26 14:05:49.000000000 +0000 +++ web2ldap-1.1.43~dfsg/fcgi/web2ldap.py 2013-06-22 15:51:04.000000000 +0000 @@ -9,8 +9,6 @@ This software is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: web2ldap.py,v 1.41 2012/06/26 14:05:49 michael Exp $ """ import sys,os,signal,time,fcgi,threading diff -Nru web2ldap-1.1.31~dfsg/htdocs/changes-0.10.html web2ldap-1.1.43~dfsg/htdocs/changes-0.10.html --- web2ldap-1.1.31~dfsg/htdocs/changes-0.10.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/changes-0.10.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - @@ -83,6 +82,7 @@

+1.2| 1.1| 1.0| 0.16.x| diff -Nru web2ldap-1.1.31~dfsg/htdocs/changes-0.11.html web2ldap-1.1.43~dfsg/htdocs/changes-0.11.html --- web2ldap-1.1.31~dfsg/htdocs/changes-0.11.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/changes-0.11.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - @@ -83,6 +82,7 @@

+1.2| 1.1| 1.0| 0.16.x| diff -Nru web2ldap-1.1.31~dfsg/htdocs/changes-0.12.html web2ldap-1.1.43~dfsg/htdocs/changes-0.12.html --- web2ldap-1.1.31~dfsg/htdocs/changes-0.12.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/changes-0.12.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - @@ -83,6 +82,7 @@

+1.2| 1.1| 1.0| 0.16.x| diff -Nru web2ldap-1.1.31~dfsg/htdocs/changes-0.13.html web2ldap-1.1.43~dfsg/htdocs/changes-0.13.html --- web2ldap-1.1.31~dfsg/htdocs/changes-0.13.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/changes-0.13.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - @@ -83,6 +82,7 @@

+1.2| 1.1| 1.0| 0.16.x| diff -Nru web2ldap-1.1.31~dfsg/htdocs/changes-0.14.html web2ldap-1.1.43~dfsg/htdocs/changes-0.14.html --- web2ldap-1.1.31~dfsg/htdocs/changes-0.14.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/changes-0.14.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - @@ -83,6 +82,7 @@

+1.2| 1.1| 1.0| 0.16.x| diff -Nru web2ldap-1.1.31~dfsg/htdocs/changes-0.15.html web2ldap-1.1.43~dfsg/htdocs/changes-0.15.html --- web2ldap-1.1.31~dfsg/htdocs/changes-0.15.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/changes-0.15.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - @@ -83,6 +82,7 @@

+1.2| 1.1| 1.0| 0.16.x| diff -Nru web2ldap-1.1.31~dfsg/htdocs/changes-0.16.html web2ldap-1.1.43~dfsg/htdocs/changes-0.16.html --- web2ldap-1.1.31~dfsg/htdocs/changes-0.16.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/changes-0.16.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - @@ -83,6 +82,7 @@

+1.2| 1.1| 1.0| 0.16.x| diff -Nru web2ldap-1.1.31~dfsg/htdocs/changes-0.7.html web2ldap-1.1.43~dfsg/htdocs/changes-0.7.html --- web2ldap-1.1.31~dfsg/htdocs/changes-0.7.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/changes-0.7.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - @@ -83,6 +82,7 @@

+1.2| 1.1| 1.0| 0.16.x| diff -Nru web2ldap-1.1.31~dfsg/htdocs/changes-0.8.html web2ldap-1.1.43~dfsg/htdocs/changes-0.8.html --- web2ldap-1.1.31~dfsg/htdocs/changes-0.8.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/changes-0.8.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - @@ -83,6 +82,7 @@

+1.2| 1.1| 1.0| 0.16.x| diff -Nru web2ldap-1.1.31~dfsg/htdocs/changes-0.9.html web2ldap-1.1.43~dfsg/htdocs/changes-0.9.html --- web2ldap-1.1.31~dfsg/htdocs/changes-0.9.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/changes-0.9.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - @@ -83,6 +82,7 @@

+1.2| 1.1| 1.0| 0.16.x| diff -Nru web2ldap-1.1.31~dfsg/htdocs/changes-1.0.html web2ldap-1.1.43~dfsg/htdocs/changes-1.0.html --- web2ldap-1.1.31~dfsg/htdocs/changes-1.0.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/changes-1.0.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - @@ -83,6 +82,7 @@

+1.2| 1.1| 1.0| 0.16.x| diff -Nru web2ldap-1.1.31~dfsg/htdocs/changes-1.1.html web2ldap-1.1.43~dfsg/htdocs/changes-1.1.html --- web2ldap-1.1.31~dfsg/htdocs/changes-1.1.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/changes-1.1.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - @@ -83,6 +82,7 @@

+1.2| 1.1| 1.0| 0.16.x| @@ -100,6 +100,479 @@

+

1.1.43

+

Release Date: 2013-08-31

+
+
New features/enhancements
+
+
    +
  • + Improved HTML layout when displaying certificate/CRL. +
  • +
  • + Certificate/CRL viewer now displays OID names also for deeply nested + X.500 Name (DNs). +
  • +
  • + CRL viewer now displays CRLReason extension. +
  • +
  • + New plugin module w2lapp.schema.plugins.x509 now + contains all the cert/CRL plugin classes and new stub classes + for all the LDAP syntaxes defined in + RFC 4523. +
  • +
+
+
Bugs fixed
+
+
    +
  • + Fixed using module pisces.asn1 really optionally + (regression introduced in 1.1.42). +
  • +
  • + Fixed Unicode issue in plugin class for Lotus Domino/LDAP attribute + dominoCertificate. +
  • +
  • + Added work-around for UnicodeDecodeError if buggy + LDAP server (Lotus Domino/LDAP 7.x) returns diagnosticMessage + with non-ASCII characters as ISO-8859-1 (Latin1). +
  • +
+
+
Code cleaning
+
+
    +
  • + New syntax class w2lapp.schema.syntaxes.CSN registered + for OpenLDAP attribute types contextCSN, entryCSN + and namingCSN. +
  • +
+
+
+ +

1.1.42

+

Release Date: 2013-08-31

+
+
New features/enhancements
+
+
    +
  • + Additional search roots can be dynamically searched + with search parameters specified by + searchform_search_root_url +
  • +
  • + Some basic support for displaying crlEntryExtensions. +
  • +
+
+
Bugs fixed
+
+
    +
  • + The formerly used type of the entry input form is correctly + used when representing the input form in case of an error. +
  • +
  • + Fixed displaying an error message for noSuchObject + with a matchedDN containing non-ASCII characters. +
  • +
  • + Fixed determining the possible DIT structure rules for a DN + containing non-ASCII characters. +
  • +
  • + PEM to DER conversion for certificates and CRLs now uses a more + liberal parsing function to deal with various delimiter texts + for CA certs. +
  • +
  • + Added a work-around to parse a broken CRL without + nextUpdate attribute. +
  • +
+
+
+ +

1.1.41

+

Release Date: 2013-08-13

+
+
New features/enhancements
+
+
    +
  • + If attribute numSubordinates is present but + numAllSubordinates is missing + values of numSubordinates are summed up to determine + the number of all entries in a subtree (e.g. when displaying the + delete form). +
  • +
+
+
Code cleaning
+
+ +
+
+ +

1.1.40

+

Release Date: 2013-07-18

+
+
Bugs fixed
+
+
    +
  • + Fixed regression with missing >= filter part in plugin class + for pwdExpireWarning. +
  • +
+
+
+ +

1.1.39

+

Release Date: 2013-07-16

+
+
Bugs fixed
+
+
    +
  • + When generating links to advanced search form with missing + form parameters reasonable defaults are set now. +
  • +
  • + Fixed several regressions in search parameter handling. +
  • +
+
+
+ +

1.1.38

+

Release Date: 2013-07-15

+
+
New features/enhancements
+
+
    +
  • + Advanced search form handling was improved: +
      +
    • Table layout.
    • +
    • Buttons [+] and [-] extend/shortens search parameter list.
    • +
    • Matching rules can be specified.
    • +
    • Whenever appropriate the user is redirected back to advanced search form.
    • +
    • + Various plugin classes now display link to advanced search form + instead of simple LDAP filter in expert search form. +
    • +
    +
  • +
  • + Error message and fall-back to advanced search form in case IOError + is raised during loading template file referenced by + searchform_template. +
  • +
  • + DIT content rules referencing an attribute type are listed + when displaying the attribute type in schema viewer. +
  • +
  • + Directly referencing object classes and inherited object + classes are displayed separately when displaying the + attribute type in schema viewer. +
  • +
  • + No-op search control used to determine number of subordinate entries + when presenting deletion input form. +
  • +
  • + In case of ldap.FILTER_ERROR being caught the + errornous filter is displayed. +
  • +
+
+
Bugs fixed
+
+
    +
  • + Better error handling in case of invalid certificate/CRLs values. +
  • +
+
+
Code cleaning
+
+
    +
  • + OpenLDAP's no-op search now isolated in new method + MyLDAPObject.noop_search_st(). +
  • +
  • + Some code clean-up in w2lapp.searchform. +
  • +
+
+
+ +

1.1.37

+

Release Date: 2013-06-25

+
+
New features/enhancements
+
+
    +
  • + New class attrs LDAPSyntax.searchSep/readSep/fieldSep + used consequently everywhere through class + w2lapp.read.DisplayEntry. This enables plugin classes + to control how multiple attribute values are separated. +
  • +
  • + Search form parameter filterstr can now be + multi-valued and its values are always evaluated along with the + other form parameters from basic/advanced search form. This + allows to define search form templates with arbitrary additional + filters to be combined with user's input in the search form. +
  • +
  • + OpenLDAP's no-op search control is now sent with tight timeout (5 sec) + to not overwhelm the server in case many entries have to be checked. +
  • +
+
+
Bugs fixed
+
+
    +
  • + Corrected determining server name in standalone mode. +
  • +
  • + Fixed Unicode handling of attribute type names when displaying + password attributes after changing them. +
  • +
  • + Fixed issue with multiple delsid form parameter sent + after re-login. +
  • +
+
+
+ +

1.1.36

+

Release Date: 2013-06-18

+
+
Dropped features
+
+
    +
  • + Syncing password attributes of ancient Samba 2 schema is + not supported anymore. Use Samba 3 instead. +
  • +
  • + Removed inline Javascript frame-buster in favour of sending + secure values for HTTP header X-Content-Security-Policy + (see Content Security Policy (CSP)). + You can add an reference to an external Javascript source file + to the template file referenced by + html_begin_template. +
  • +
+
+
New features/enhancements
+
+
    +
  • + Plugin class for pwdChangedTime now displays that a + password will never expire. +
  • +
  • + New host-specific parameter + passwd_modlist + allows to set a custom initial password attribute modification list. +
  • +
  • + New global configuration parameter + http_headers + allows to define a static dictionary of HTTP headers in the + configuration to be sent to the browser in any case. +
  • +
  • + New session ID is generated when login is performed to prevent + session fixation attacks. +
  • +
+
+
Bugs fixed
+
+
    +
  • + Fixed exception plugin class for pwdChangedTime in + case the referended password policy entry does not contain + pwdMaxAge. +
  • +
  • + Fixed UnicodeError in plugin class DynamicDNSelectList. +
  • +
+
+
+ +

1.1.35

+

Release Date: 2013-05-28

+
+
New features/enhancements
+
+
    +
  • + Some improvements to searching for schema elements in the schema + viewer. +
  • +
  • + Also absolute date/time of password expiry timestamp is + displayed in plugin class for pwdChangedTime. +
  • +
  • + New small plugin module for FreeRADIUS/LDAP schema. +
  • +
+
+
Bugs fixed
+
+
    +
  • + More robust version number check in sbin/checkinst.py. +
  • +
  • + Timestamp seconds now converted to long integer before + transforming it to readable representation to eliminate + unnecessary strings in output due to float rounding. +
  • +
  • + The user name taken from login form is now correctely escaped + before adding it into a LDAP filter. +
  • +
+
+
+ +

1.1.34

+

Release Date: 2013-05-22

+
+
New features/enhancements
+
+
    +
  • + New plugin class for attribute pwdChangedTime. +
  • +
  • +
  • +
+
+
Bugs fixed
+
+
    +
  • + Fixed Unicode issue in plugin class Timespan. +
  • +
  • + Fixed Unicode issue in module w2lapp.schema.plugin.ppolicy. +
  • +
+
+
+ +

1.1.33

+

Release Date: 2013-05-17

+
+
New features/enhancements
+
+
    +
  • + All group modifications are displayed. +
  • +
  • + New plugin classes for MS AD attributes: +
      +
    • GUIDs (objectGUID, parentGUID, rightsGuid, siteGUID)
    • +
    • msDS-SupportedEncryptionTypes
    • +
    +
  • +
  • + New plugin classes for pwdExpireWarning and + pwdMaxAge display search links. +
  • +
  • + It's now possible to search for arbitrary OctetString values. +
  • +
  • + If host-specific parameter + search_attrs + is not set or an empty list all attribute types are displayed + in attribute select list in advanced search form. +
  • +
+
+
Bugs fixed
+
+
    +
  • + If a only a single char * or + is given as attribute list this + is no longer treated as a real single attribute when reading an + entry. +
  • +
+
+
+ +

1.1.32

+

Release Date: 2013-05-10

+
+
New features/enhancements
+
+
    +
  • + New plugin class w2lapp.schema.syntaxes.Timespan displays + time spans as hours, minutes, seconds used for: +
      +
    • pwdMinAge
    • +
    • pwdMaxAge
    • +
    • pwdExpireWarning
    • +
    • entryTTL
    • +
    +
  • +
  • + Time before password expiration displayed as hours, minutes, seconds. +
  • +
  • + When submitting several group modifications all failed attempts + are collected and displayed with LDAP error information after + processing all group modifications. +
  • +
+
+
Bugs fixed
+
+
    +
  • + Better handling of LDAPError exceptions in case the + LDAP server does not support + "Who am I?". + Especially occured as problem with SASL/GSSAPI bind. +
  • +
  • + Plugin class DNSDomain lower-cases input values + before applying the IDNA encoding. +
  • +
+
+
+

1.1.31

Release Date: 2013-02-16

@@ -130,7 +603,7 @@ Small fix for displaying LDAP error messages.
  • - Fixed handling of class attributes valuePrefix and + Fixed handling of class attributes valuePrefix and valueSuffix in plugin class DynamicValueSelectList.
  • @@ -165,7 +638,7 @@ More liberal regex pattern for sambaAcctFlags.
  • - Fixed an exception caused by empty strings in an attribute list + Fixed an exception caused by empty strings in an attribute list when reading an entry.
  • diff -Nru web2ldap-1.1.31~dfsg/htdocs/changes-ancient.html web2ldap-1.1.43~dfsg/htdocs/changes-ancient.html --- web2ldap-1.1.31~dfsg/htdocs/changes-ancient.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/changes-ancient.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - @@ -83,6 +82,7 @@

    +1.2| 1.1| 1.0| 0.16.x| diff -Nru web2ldap-1.1.31~dfsg/htdocs/changes.html web2ldap-1.1.43~dfsg/htdocs/changes.html --- web2ldap-1.1.31~dfsg/htdocs/changes.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/changes.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - @@ -89,6 +88,11 @@

    +
    1.2.x
    +
    + Partial rewrite. +
    +
    1.1.x
    Support for more complex LDAPv3 controls, more consequent Unicode support, diff -Nru web2ldap-1.1.31~dfsg/htdocs/compability.html web2ldap-1.1.43~dfsg/htdocs/compability.html --- web2ldap-1.1.31~dfsg/htdocs/compability.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/compability.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - diff -Nru web2ldap-1.1.31~dfsg/htdocs/css/web2ldap/default.css web2ldap-1.1.43~dfsg/htdocs/css/web2ldap/default.css --- web2ldap-1.1.31~dfsg/htdocs/css/web2ldap/default.css 2012-12-10 00:39:43.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/css/web2ldap/default.css 2013-06-27 20:29:55.000000000 +0000 @@ -1,8 +1,7 @@ -/********************************************************************* -Fixed layout style sheet for web2ldap -web2ldap - web-based LDAP Client, see http://www.web2ldap.de -$Id: default.css,v 1.39 2012/12/10 00:39:43 michael Exp $ -**********************************************************************/ +/***********************************************************************/ +/* Fixed layout style sheet for web2ldap */ +/* web2ldap - web-based LDAP Client, see http://www.web2ldap.de */ +/***********************************************************************/ body { background-color:#c2df5d; @@ -32,6 +31,7 @@ /* TopSection encloses StatusLine, MainMenu and ContextMenu */ #TopSection { + position:fixed; } #StatusLine { @@ -144,16 +144,16 @@ div.Main { background-color:#FFFFFF; - position:absolute; - top:6em; - left:8.5em; - right:8.5em; text-align:left; - margin:0.5em; + margin:5.3em 9em 0.5em 9em; padding:0.7em; color:#000000; - overflow:hidden; border:1px solid; +/* white-space: nowrap; */ + overflow-x: auto; + -ms-overflow-x: auto; + overflow-y: auto; + -ms-overflow-y: auto; } fieldset { @@ -232,6 +232,13 @@ background-color:#c63; } +dt { + padding:0.2em; +} + +dd { + padding:0.2em; +} #TopSection a.CommandLink { text-align:center; diff -Nru web2ldap-1.1.31~dfsg/htdocs/css/web2ldap/hippie.css web2ldap-1.1.43~dfsg/htdocs/css/web2ldap/hippie.css --- web2ldap-1.1.31~dfsg/htdocs/css/web2ldap/hippie.css 2012-03-21 22:52:14.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/css/web2ldap/hippie.css 2013-06-22 15:51:05.000000000 +0000 @@ -1,8 +1,7 @@ -/********************************************************************* -Hippie (means colorful) layout style sheet for web2ldap -web2ldap - web-based LDAP Client, see http://www.web2ldap.de -$Id: hippie.css,v 1.5 2012/03/21 22:52:14 michael Exp $ -**********************************************************************/ +/***********************************************************************/ +/* Hippie (means colorful) layout style sheet for web2ldap */ +/* web2ldap - web-based LDAP Client, see http://www.web2ldap.de */ +/***********************************************************************/ body { background-color:#f328ad; @@ -202,9 +201,13 @@ text-align:left; padding:0.7em; color:#000000; - overflow:hidden; border:none; border-radius: 10px; +/* white-space: nowrap; */ + overflow-x: auto; + -ms-overflow-x: auto; + overflow-y: auto; + -ms-overflow-y: auto; } legend { diff -Nru web2ldap-1.1.31~dfsg/htdocs/css/web2ldap/print.css web2ldap-1.1.43~dfsg/htdocs/css/web2ldap/print.css --- web2ldap-1.1.31~dfsg/htdocs/css/web2ldap/print.css 2012-03-21 22:52:14.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/css/web2ldap/print.css 2013-06-22 15:51:05.000000000 +0000 @@ -1,14 +1,13 @@ -/********************************************************************* -Style sheet for printable output of web2ldap -web2ldap - web-based LDAP Client, see http://www.web2ldap.de -$Id: print.css,v 1.8 2012/03/21 22:52:14 michael Exp $ -**********************************************************************/ +/***********************************************************************/ +/* Style sheet for printable output of web2ldap */ +/* web2ldap - web-based LDAP Client, see http://www.web2ldap.de */ +/***********************************************************************/ @page { margin-top:1.5cm; margin-bottom:1.5cm; margin-left:2cm; - margin-right:2cm */ + margin-right:2cm; } body { diff -Nru web2ldap-1.1.31~dfsg/htdocs/css/web2ldap/terminal.css web2ldap-1.1.43~dfsg/htdocs/css/web2ldap/terminal.css --- web2ldap-1.1.31~dfsg/htdocs/css/web2ldap/terminal.css 2012-03-21 22:52:14.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/css/web2ldap/terminal.css 2013-06-22 15:51:05.000000000 +0000 @@ -1,9 +1,8 @@ -/********************************************************************* -Fixed layout style sheet for web2ldap -looking like a old-fashioned terminal -web2ldap - web-based LDAP Client, see http://www.web2ldap.de -$Id: terminal.css,v 1.10 2012/03/21 22:52:14 michael Exp $ -**********************************************************************/ +/***********************************************************************/ +/* Fixed layout style sheet for web2ldap */ +/* looking like a old-fashioned terminal */ +/* web2ldap - web-based LDAP Client, see http://www.web2ldap.de */ +/***********************************************************************/ body { color:#00ff00; @@ -179,8 +178,12 @@ right:9em; text-align:left; padding:0.7em; - overflow:hidden; border:1px solid; +/* white-space: nowrap; */ + overflow-x: auto; + -ms-overflow-x: auto; + overflow-y: auto; + -ms-overflow-y: auto; } fieldset { diff -Nru web2ldap-1.1.31~dfsg/htdocs/css/web2ldap.de-screen.css web2ldap-1.1.43~dfsg/htdocs/css/web2ldap.de-screen.css --- web2ldap-1.1.31~dfsg/htdocs/css/web2ldap.de-screen.css 2012-03-19 17:12:09.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/css/web2ldap.de-screen.css 2013-06-22 15:51:05.000000000 +0000 @@ -1,6 +1,6 @@ -/*--------------------------------------- -Screen layout für stroeder.com -----------------------------------------*/ +/*---------------------------------------*/ +/* Screen layout for web2ldap.de */ +/*---------------------------------------*/ /* sets all margin and padding (browser defaults) back to zero for ease of use */ @@ -21,9 +21,9 @@ bottom: 1em; left: 1em; color: #ffffff; } -/*--------------------------------------- -GENERAL STYLING -----------------------------------------*/ +/*---------------------------------------*/ +/* GENERAL STYLING */ +/*---------------------------------------*/ p { margin: 0.25em 0 0 1.5em; diff -Nru web2ldap-1.1.31~dfsg/htdocs/demo.html web2ldap-1.1.43~dfsg/htdocs/demo.html --- web2ldap-1.1.31~dfsg/htdocs/demo.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/demo.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - diff -Nru web2ldap-1.1.31~dfsg/htdocs/docs.html web2ldap-1.1.43~dfsg/htdocs/docs.html --- web2ldap-1.1.31~dfsg/htdocs/docs.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/docs.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - diff -Nru web2ldap-1.1.31~dfsg/htdocs/download.html web2ldap-1.1.43~dfsg/htdocs/download.html --- web2ldap-1.1.31~dfsg/htdocs/download.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/download.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - @@ -141,15 +140,15 @@
    diff -Nru web2ldap-1.1.31~dfsg/htdocs/faq.html web2ldap-1.1.43~dfsg/htdocs/faq.html --- web2ldap-1.1.31~dfsg/htdocs/faq.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/faq.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - diff -Nru web2ldap-1.1.31~dfsg/htdocs/features.html web2ldap-1.1.43~dfsg/htdocs/features.html --- web2ldap-1.1.31~dfsg/htdocs/features.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/features.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - diff -Nru web2ldap-1.1.31~dfsg/htdocs/feedback.html web2ldap-1.1.43~dfsg/htdocs/feedback.html --- web2ldap-1.1.31~dfsg/htdocs/feedback.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/feedback.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - diff -Nru web2ldap-1.1.31~dfsg/htdocs/files.html web2ldap-1.1.43~dfsg/htdocs/files.html --- web2ldap-1.1.31~dfsg/htdocs/files.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/files.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - diff -Nru web2ldap-1.1.31~dfsg/htdocs/install.html web2ldap-1.1.43~dfsg/htdocs/install.html --- web2ldap-1.1.31~dfsg/htdocs/install.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/install.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,7 +1,5 @@ - - diff -Nru web2ldap-1.1.31~dfsg/htdocs/install_debian.html web2ldap-1.1.43~dfsg/htdocs/install_debian.html --- web2ldap-1.1.31~dfsg/htdocs/install_debian.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/install_debian.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - diff -Nru web2ldap-1.1.31~dfsg/htdocs/install_opensuse.html web2ldap-1.1.43~dfsg/htdocs/install_opensuse.html --- web2ldap-1.1.31~dfsg/htdocs/install_opensuse.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/install_opensuse.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - diff -Nru web2ldap-1.1.31~dfsg/htdocs/install_rhel.html web2ldap-1.1.43~dfsg/htdocs/install_rhel.html --- web2ldap-1.1.31~dfsg/htdocs/install_rhel.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/install_rhel.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - diff -Nru web2ldap-1.1.31~dfsg/htdocs/install_windows.html web2ldap-1.1.43~dfsg/htdocs/install_windows.html --- web2ldap-1.1.31~dfsg/htdocs/install_windows.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/install_windows.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - diff -Nru web2ldap-1.1.31~dfsg/htdocs/news.html web2ldap-1.1.43~dfsg/htdocs/news.html --- web2ldap-1.1.31~dfsg/htdocs/news.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/news.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - @@ -84,6 +83,70 @@
    +
    2013-08-31
    +
    + Released web2ldap 1.1.42. +
    + +
    2013-08-13
    +
    + Released web2ldap 1.1.41. +
    + +
    2013-07-18
    +
    + Released web2ldap 1.1.40. +
    + +
    2013-06-25
    +
    + Released web2ldap 1.1.37. +
    + +
    2013-06-18
    +
    + Released web2ldap 1.1.36. +
    + +
    2013-05-28
    +
    + Released web2ldap 1.1.35. +
    + +
    2013-05-22
    +
    + Released web2ldap 1.1.34. +
    + +
    2013-05-17
    +
    + Released web2ldap 1.1.33. +
    + +
    2013-05-11
    +
    + Started working on 1.2 release series + (see roadmap). + Set release 1.1.x to maintenance status in separate branch. +
    + +
    2013-05-10
    +
    + Released web2ldap 1.1.32. +
    + +
    2013-05-05
    +
    + Debian: + + web2ldap 1.1.31~dfsg-1 MIGRATED to testing. +
    + +
    2013-02-16
    +
    + Released web2ldap 1.1.31. +
    +
    2013-01-19
    Released web2ldap 1.1.30. @@ -120,6 +183,13 @@ Released web2ldap 1.1.24.
    +
    2012-07-31
    +
    + Marc Haber uploaded first + + Debian package for web2ldap. +
    +
    2012-06-26
    Released web2ldap 1.1.23. diff -Nru web2ldap-1.1.31~dfsg/htdocs/related.html web2ldap-1.1.43~dfsg/htdocs/related.html --- web2ldap-1.1.31~dfsg/htdocs/related.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/related.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - diff -Nru web2ldap-1.1.31~dfsg/htdocs/roadmap.html web2ldap-1.1.43~dfsg/htdocs/roadmap.html --- web2ldap-1.1.31~dfsg/htdocs/roadmap.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/roadmap.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - @@ -89,26 +88,37 @@

    1.1

    - Currently active development (see changes in 1.1.x).
    - New features are still be added after 1.1.0: + In maintenance mode: +

      +
    • + No new features anymore. +
    • +
    • + Important fixes will be provided. +
    • +
    +

    + +

    1.2

    +

    + Planned as small rewrite within 2013:

    • + Make use of HTML 5 features like <datalist> etc. +
    • +
    • CSS style chooser.
    • Time zone chooser.
    • + More password hashing/crypting schemes. +
    • +
    • Support for simple paging control and server-side sorting.
    • -
    - -

    1.2

    -

    - Planned as partial rewrite in year 2013: -

    -
    • Run as WSGI application.
    • diff -Nru web2ldap-1.1.31~dfsg/htdocs/security.html web2ldap-1.1.43~dfsg/htdocs/security.html --- web2ldap-1.1.31~dfsg/htdocs/security.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/security.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - diff -Nru web2ldap-1.1.31~dfsg/htdocs/support.html web2ldap-1.1.43~dfsg/htdocs/support.html --- web2ldap-1.1.31~dfsg/htdocs/support.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/support.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - diff -Nru web2ldap-1.1.31~dfsg/htdocs/usability.html web2ldap-1.1.43~dfsg/htdocs/usability.html --- web2ldap-1.1.31~dfsg/htdocs/usability.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/usability.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - diff -Nru web2ldap-1.1.31~dfsg/htdocs/usage.html web2ldap-1.1.43~dfsg/htdocs/usage.html --- web2ldap-1.1.31~dfsg/htdocs/usage.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/usage.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - diff -Nru web2ldap-1.1.31~dfsg/htdocs/web2ldap.html web2ldap-1.1.43~dfsg/htdocs/web2ldap.html --- web2ldap-1.1.31~dfsg/htdocs/web2ldap.html 2013-02-16 17:16:57.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/web2ldap.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - diff -Nru web2ldap-1.1.31~dfsg/htdocs/web2ldapcnf.html web2ldap-1.1.43~dfsg/htdocs/web2ldapcnf.html --- web2ldap-1.1.31~dfsg/htdocs/web2ldapcnf.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/web2ldapcnf.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - diff -Nru web2ldap-1.1.31~dfsg/htdocs/web2ldapcnf_fastcgi.html web2ldap-1.1.43~dfsg/htdocs/web2ldapcnf_fastcgi.html --- web2ldap-1.1.31~dfsg/htdocs/web2ldapcnf_fastcgi.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/web2ldapcnf_fastcgi.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - diff -Nru web2ldap-1.1.31~dfsg/htdocs/web2ldapcnf_hosts.html web2ldap-1.1.43~dfsg/htdocs/web2ldapcnf_hosts.html --- web2ldap-1.1.31~dfsg/htdocs/web2ldapcnf_hosts.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/web2ldapcnf_hosts.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - @@ -103,6 +102,7 @@ [print_template] [passwd_genchars] [passwd_genlength] + [passwd_modlist] [passwd_template] [read_operationalattrstemplate] [read_tablemaxcount] @@ -112,7 +112,7 @@ [requested_attrs] [schema_uri] [search_attrs] - [searchform_basesearchurl] + [searchform_search_root_url] [search_resultsperpage] [search_tablistattrs] [search_tdtemplate] @@ -439,6 +439,24 @@
    +
    passwd_modlist
    +
    + Allows to extend the modification list to be sent along with a modify + request or after a password modify extended operation. Read und understand + + python-ldap docs for details about the data structure. +
    +
    Default:
    +
    []
    +
    Example:
    +
    + + passwd_modlist=[] + +
    +
    +
    +
    passwd_template
    HTML template file for the input fields of a change password form. @@ -674,7 +692,7 @@
    -
    searchform_basesearchurl
    +
    searchform_search_root_url
    String with a LDAP URL (without hostport portion) which specifies how to search for additional search bases to be displayed as select list in the search form. @@ -686,7 +704,7 @@
    - searchform_basesearchurl='ldap:///dc=example,dc=com??sub?(|(objectClass=organization)(objectClass=organizationalUnit))' + searchform_search_root_url='ldap:///dc=example,dc=com??sub?(|(objectClass=organization)(objectClass=organizationalUnit))'
    diff -Nru web2ldap-1.1.31~dfsg/htdocs/web2ldapcnf_misc.html web2ldap-1.1.43~dfsg/htdocs/web2ldapcnf_misc.html --- web2ldap-1.1.31~dfsg/htdocs/web2ldapcnf_misc.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/web2ldapcnf_misc.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - @@ -91,10 +90,9 @@ [dumpasn1cfg] [gzip_level] [html_begin] + [http_headers] [input_maxattrs] - [input_maxbinattrs] [input_maxfieldlen] - [input_maxfilelen] [ldap_opt_debug_level] [ldap_trace_level] [ldif_maxbytes] @@ -167,16 +165,6 @@ Maximum length of attribute data input fields in addform/modifyform. -
    input_maxattrs
    -
    - Maximum count of file upload attribute fields in addform/modifyform. -
    - -
    input_maxfieldlen
    -
    - Maximum length of attribute uploaded via file in addform/modifyform. -
    -
    max_searchparams
    Maximum count of search parameters in advanced search form. @@ -260,6 +248,13 @@
    +
    http_headers
    +
    + Static dictionary of HTTP headers to be always sent to the browser. + You can extend this if new HTTP headers are defined for enabling + optional security features in browsers. +
    +
    diff -Nru web2ldap-1.1.31~dfsg/htdocs/web2ldapcnf_monitor.html web2ldap-1.1.43~dfsg/htdocs/web2ldapcnf_monitor.html --- web2ldap-1.1.31~dfsg/htdocs/web2ldapcnf_monitor.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/web2ldapcnf_monitor.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - diff -Nru web2ldap-1.1.31~dfsg/htdocs/web2ldapcnf_standalone.html web2ldap-1.1.43~dfsg/htdocs/web2ldapcnf_standalone.html --- web2ldap-1.1.31~dfsg/htdocs/web2ldapcnf_standalone.html 2013-02-16 17:16:56.000000000 +0000 +++ web2ldap-1.1.43~dfsg/htdocs/web2ldapcnf_standalone.html 2013-09-01 09:31:09.000000000 +0000 @@ -1,6 +1,5 @@ - diff -Nru web2ldap-1.1.31~dfsg/pylib/ldapsession.py web2ldap-1.1.43~dfsg/pylib/ldapsession.py --- web2ldap-1.1.31~dfsg/pylib/ldapsession.py 2013-01-13 15:47:47.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/ldapsession.py 2013-07-24 21:13:23.000000000 +0000 @@ -6,13 +6,8 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: ldapsession.py,v 1.378 2013/01/13 15:47:47 michael Exp $ """ -__version__ = '$Revision: 1.378 $'.split(' ')[1] - - import sys,socket,time,types,codecs,ldap,ldap.cidict,ldap.resiter,ldaputil.base,ldaputil.schema try: @@ -23,8 +18,9 @@ from ldap.ldapobject import ReconnectLDAPObject from ldapurl import LDAPUrl,LDAPUrlExtension from ldap.schema.models import DITStructureRule +from ldaputil.base import escape_ldap_filter_chars from ldaputil.extldapurl import ExtendedLDAPUrl -from ldaputil.controls import PreReadControl,PostReadControl +from ldaputil.controls import PreReadControl,PostReadControl,SearchNoOpControl from ldap.controls import ValueLessRequestControl,AssertionControl # Authorization Identity Request and Response Controls (see RFC 3829) @@ -118,6 +114,10 @@ READ_CACHE_EXPIRE = 120 +LDAPLimitErrors = (ldap.TIMEOUT,ldap.TIMELIMIT_EXCEEDED,ldap.SIZELIMIT_EXCEEDED,ldap.ADMINLIMIT_EXCEEDED) + +COUNT_TIMEOUT = 5.0 + class MyLDAPObject(ReconnectLDAPObject,ldap.resiter.ResultProcessor): @@ -241,6 +241,31 @@ self._cache[cache_key_args] = (current_time+self.cache_time,result) return result # search_ext_s() + def noop_search_st(self,base,scope=ldap.SCOPE_SUBTREE,filterstr='(objectClass=*)',timeout=-1): + try: + msg_id = self.search_ext( + base, + scope, + filterstr=filterstr, + attrlist=['1.1'], + timeout=timeout, + serverctrls=[SearchNoOpControl()], + ) + _,_,_,search_response_ctrls = self.result3(msg_id,all=1,timeout=timeout) + except LDAPLimitErrors,e: + self.abandon(msg_id) + raise e + else: + noop_srch_ctrl = [ + c + for c in search_response_ctrls + if c.controlType==SearchNoOpControl.controlType + ] + if noop_srch_ctrl: + return noop_srch_ctrl[0].numSearchResults,noop_srch_ctrl[0].numSearchContinuations + else: + return (None,None) + def get_cache_hit_ratio(self): """ Returns percentage of cache hit ratio @@ -293,10 +318,14 @@ pass class PWD_EXPIRATION_WARNING(PasswordPolicyException): - pass + def __init__(self,who=None,desc=None,timeBeforeExpiration=None): + PasswordPolicyException.__init__(self,who,desc) + self.timeBeforeExpiration = timeBeforeExpiration class PWD_EXPIRED(PasswordPolicyException): - pass + def __init__(self,who=None,desc=None,graceAuthNsRemaining=None): + PasswordPolicyException.__init__(self,who,desc) + self.graceAuthNsRemaining = graceAuthNsRemaining class USERNAME_NOT_FOUND(LDAPSessionException): """ @@ -576,15 +605,15 @@ 'msDS-Approx-Immed-Subordinates') # First try to read operational attributes from entry itself # which might indicate whether there are subordinate entries - result_ldap = self.l.search_ext_s( + ldap_result = self.l.search_ext_s( self.uc_encode(dn)[0], ldap.SCOPE_BASE,'(objectClass=*)', subordinate_attrs, timeout=self.timeout ) hasSubordinates = None; numSubordinates = None; numAllSubordinates = None - if result_ldap: - entry = ldap.cidict.cidict(result_ldap[0][1]) + if ldap_result: + entry = ldap.cidict.cidict(ldap_result[0][1]) for a in ('subordinateCount','numSubordinates','msDS-Approx-Immed-Subordinates'): try: numSubordinates = int(entry[a][0]) @@ -595,7 +624,17 @@ try: numAllSubordinates = int(entry['numAllSubordinates'][0]) except KeyError: - pass + if numSubordinates!=None: + ldap_result = self.l.search_ext_s( + self.uc_encode(dn)[0], + ldap.SCOPE_SUBTREE, + '(numSubordinates>=1)', + attrlist=['numSubordinates'], + timeout=COUNT_TIMEOUT + ) + numAllSubordinates = 0 + for ldap_dn,ldap_entry in ldap_result: + numAllSubordinates += int(ldap_entry['numSubordinates'][0]) try: hasSubordinates = entry['hasSubordinates'][0].upper()=='TRUE' except KeyError: @@ -610,11 +649,32 @@ ldap.SCOPE_ONELEVEL,'(objectClass=*)', ['objectClass'],self.onlyAttrTypes,timeout=self.timeout,sizelimit=1 ) - result_ldap = (None,None) - while result_ldap==(None,None): - result_ldap = self.l.result(ldap_msgid,0,self.timeout) + ldap_result = (None,None) + while ldap_result==(None,None): + ldap_result = self.l.result(ldap_msgid,0,self.timeout) self.l.abandon(ldap_msgid) - hasSubordinates = len(result_ldap)>0 + hasSubordinates = len(ldap_result)>0 + + if SearchNoOpControl.controlType in self.rootDSE.get('supportedControl',[]): + if not numSubordinates: + try: + numSubordinates,_ = self.l.noop_search_st( + self.uc_encode(dn)[0], + ldap.SCOPE_ONELEVEL, + timeout=COUNT_TIMEOUT, + ) + except LDAPLimitErrors,e: + pass + if not numAllSubordinates: + try: + numAllSubordinates,_ = self.l.noop_search_st( + self.uc_encode(dn)[0], + ldap.SCOPE_SUBTREE, + timeout=COUNT_TIMEOUT, + ) + except LDAPLimitErrors,e: + pass + return (hasSubordinates,numSubordinates,numAllSubordinates) def getObjectClasses(self,dn): @@ -909,7 +969,8 @@ elif ldaputil.base.is_dn(username): return ldaputil.base.normalize_dn(username) else: - searchfilter = filtertemplate.replace('%s',username) + username_filter_escaped = escape_ldap_filter_chars(username) + searchfilter = filtertemplate.replace('%s',username_filter_escaped) if searchroot is None: searchroot = u'' # Try to find a unique entry with filtertemplate @@ -1035,8 +1096,11 @@ # Determine identity by sending LDAPv3 Who Am I? extended operation try: whoami = unicode(self.l.whoami_s(),self.charset) - except ldap.LDAPError: - self.who = u'u:%s' % (who) + except ldap.LDAPError,e: + if who: + self.who = u'u:%s' % (who) + else: + self.who = None else: if whoami.startswith('dn:'): self.who = whoami[3:] @@ -1107,11 +1171,13 @@ raise PWD_EXPIRATION_WARNING( who=self.who.encode(self.charset), desc='Password will expire in %d seconds!' % (ppolicy_ctrl.timeBeforeExpiration), + timeBeforeExpiration=ppolicy_ctrl.timeBeforeExpiration, ) elif ppolicy_ctrl.graceAuthNsRemaining!=None: raise PWD_EXPIRED( who=self.who.encode(self.charset), desc='Password expired! %d grace logins left.' % (ppolicy_ctrl.graceAuthNsRemaining), + graceAuthNsRemaining=ppolicy_ctrl.graceAuthNsRemaining, ) return # bind() diff -Nru web2ldap-1.1.31~dfsg/pylib/ldaputil/__init__.py web2ldap-1.1.43~dfsg/pylib/ldaputil/__init__.py --- web2ldap-1.1.31~dfsg/pylib/ldaputil/__init__.py 2012-04-15 21:52:13.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/ldaputil/__init__.py 2013-06-22 15:38:52.000000000 +0000 @@ -6,8 +6,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: __init__.py,v 1.9 2012/04/15 21:52:13 michael Exp $ """ import base,passwd,modlist2,controls,extldapurl diff -Nru web2ldap-1.1.31~dfsg/pylib/ldaputil/base.py web2ldap-1.1.43~dfsg/pylib/ldaputil/base.py --- web2ldap-1.1.31~dfsg/pylib/ldaputil/base.py 2013-02-08 18:40:10.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/ldaputil/base.py 2013-06-22 15:51:05.000000000 +0000 @@ -6,18 +6,8 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -Python compability note: -This module only works with Python 1.6+ since all string parameters -are assumed to be Unicode objects and string methods are used instead -string module. - -$Id: base.py,v 1.46 2013/02/08 18:40:10 michael Exp $ """ -__version__ = '$Revision: 1.46 $'.split(' ')[1] - - import re,ldap,ldap.sasl,ldap.dn from types import IntType @@ -239,6 +229,16 @@ return dn_comp[0], u','.join(dn_comp[1:]) +def escape_ldap_filter_chars(search_string): + if type(search_string)==UnicodeType: + result = ldap.filter.escape_filter_chars(search_string,escape_mode=0) + elif type(search_string)==StringType: + result = unicode(ldap.filter.escape_filter_chars(search_string,escape_mode=1),'ascii') + else: + raise TypeError,'search_string is not UnicodeType or StringType: %s' % (repr(search_string)) + return result + + def test(): """Test functions""" diff -Nru web2ldap-1.1.31~dfsg/pylib/ldaputil/controls.py web2ldap-1.1.43~dfsg/pylib/ldaputil/controls.py --- web2ldap-1.1.31~dfsg/pylib/ldaputil/controls.py 2012-10-07 16:51:59.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/ldaputil/controls.py 2013-06-22 15:38:52.000000000 +0000 @@ -6,8 +6,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: controls.py,v 1.3 2012/10/07 16:51:59 michael Exp $ """ import ldap.controls.readentry diff -Nru web2ldap-1.1.31~dfsg/pylib/ldaputil/dns.py web2ldap-1.1.43~dfsg/pylib/ldaputil/dns.py --- web2ldap-1.1.31~dfsg/pylib/ldaputil/dns.py 2012-04-21 16:29:10.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/ldaputil/dns.py 2013-06-22 15:38:52.000000000 +0000 @@ -7,19 +7,10 @@ GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) -$Id: dns.py,v 1.1 2012/04/21 16:29:10 michael Exp $ - Requirements: This module uses module DNS: http://pydns.sourceforge.net - -Python compability note: -This module only works with Python 2.0+ since string methods -instead of string module and list comprehensions are used. """ -__version__ = '$Revision: 1.1 $'.split(' ')[1] - - import socket,ldaputil.base try: diff -Nru web2ldap-1.1.31~dfsg/pylib/ldaputil/extldapurl.py web2ldap-1.1.43~dfsg/pylib/ldaputil/extldapurl.py --- web2ldap-1.1.31~dfsg/pylib/ldaputil/extldapurl.py 2009-12-01 18:43:08.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/ldaputil/extldapurl.py 2013-06-22 15:38:52.000000000 +0000 @@ -6,13 +6,8 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: extldapurl.py,v 1.3 2009/12/01 18:43:08 michael Exp $ """ -__version__ = '$Revision: 1.3 $'.split(' ')[1] - - import ldapurl diff -Nru web2ldap-1.1.31~dfsg/pylib/ldaputil/modlist2.py web2ldap-1.1.43~dfsg/pylib/ldaputil/modlist2.py --- web2ldap-1.1.31~dfsg/pylib/ldaputil/modlist2.py 2012-02-22 18:12:55.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/ldaputil/modlist2.py 2013-06-22 15:38:52.000000000 +0000 @@ -2,13 +2,8 @@ """ ldaputil.modlist2 - create modify modlist's with schema knowledge (c) by Michael Stroeder - -$Id: modlist2.py,v 1.28 2012/02/22 18:12:55 michael Exp $ """ -__version__ = '$Revision: 1.28 $'.split(' ')[1] - - import ldap,ldaputil.schema # This constant defines the maximum count of attribute values for diff -Nru web2ldap-1.1.31~dfsg/pylib/ldaputil/passwd.py web2ldap-1.1.43~dfsg/pylib/ldaputil/passwd.py --- web2ldap-1.1.31~dfsg/pylib/ldaputil/passwd.py 2012-04-09 15:06:27.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/ldaputil/passwd.py 2013-06-22 16:02:03.000000000 +0000 @@ -6,18 +6,8 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -Python compability note: -This module only works with Python 1.6+ since all string parameters -are assumed to be Unicode objects and string methods are used instead -string module. - -$Id: passwd.py,v 1.26 2012/04/09 15:06:27 michael Exp $ """ -__version__ = '$Revision: 1.26 $'.split(' ')[1] - - import random,base64,ldap,hashlib from hashlib import sha1 as hash_sha1 diff -Nru web2ldap-1.1.31~dfsg/pylib/ldaputil/schema.py web2ldap-1.1.43~dfsg/pylib/ldaputil/schema.py --- web2ldap-1.1.31~dfsg/pylib/ldaputil/schema.py 2013-01-16 17:56:17.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/ldaputil/schema.py 2013-08-27 20:14:57.000000000 +0000 @@ -7,8 +7,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: schema.py,v 1.33 2013/01/16 17:56:17 michael Exp $ """ import collections,ldap.schema,ldap.schema.subentry,msbase @@ -49,6 +47,17 @@ oid = self._schema.getoid(self._se_class,nameoroid,raise_keyerror=0).lower() return oid in self._nameoroid_dict + def intersection(self,s): + return SchemaElementOIDSet( + self._schema, + self._se_class, + [ + i + for i in s + if i in self + ] + ) + def add(self,se_name): se_name = se_name.strip() if se_name[0]=='@': @@ -221,16 +230,22 @@ """ def object_class_oid_set(self): - return SchemaElementOIDSet(self._s,ldap.schema.models.ObjectClass,self.get('objectClass',[])) + try: + object_classes = ldap.schema.Entry.__getitem__(self,'objectClass') + except KeyError: + object_classes = [] + return SchemaElementOIDSet(self._s,ldap.schema.models.ObjectClass,object_classes) def get_structural_oc(self): try: structural_object_class_oid = self._s.getoid( ldap.schema.models.ObjectClass, - self['structuralObjectClass'][-1] + ldap.schema.Entry.__getitem__(self,'structuralObjectClass')[-1] ) except (KeyError,IndexError): - structural_object_class_oid = self._s.get_structural_oc(self['objectClass']) + structural_object_class_oid = self._s.get_structural_oc( + ldap.schema.Entry.__getitem__(self,'objectClass') + ) return structural_object_class_oid def get_possible_dit_structure_rules(self,dn): diff -Nru web2ldap-1.1.31~dfsg/pylib/msHTTPHandler.py web2ldap-1.1.43~dfsg/pylib/msHTTPHandler.py --- web2ldap-1.1.31~dfsg/pylib/msHTTPHandler.py 2012-12-16 15:53:30.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/msHTTPHandler.py 2013-06-23 11:56:32.000000000 +0000 @@ -7,14 +7,11 @@ GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) -$Id: msHTTPHandler.py,v 1.29 2012/12/16 15:53:30 michael Exp $ - The HTTPHandlerClass is derived from class SimpleHTTPServer.SimpleHTTPRequestHandler. """ -__version__ = '$Revision: 1.29 $'.split(' ')[1] - +__version__ = '1.1.37' import sys,os,posixpath,stat,socket,string,time,SimpleHTTPServer,urllib,msbase @@ -154,6 +151,7 @@ ('Accept-Language','HTTP_ACCEPT_LANGUAGE'), ('Referer','HTTP_REFERER'), ('Connection','HTTP_CONNECTION'), + ('Cookie','HTTP_COOKIE'), ]: http_header_value = self.headers.getheader(envitem[0]) if http_header_value: diff -Nru web2ldap-1.1.31~dfsg/pylib/msHTTPServer.py web2ldap-1.1.43~dfsg/pylib/msHTTPServer.py --- web2ldap-1.1.31~dfsg/pylib/msHTTPServer.py 2012-06-28 07:28:34.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/msHTTPServer.py 2013-06-23 14:29:28.000000000 +0000 @@ -6,13 +6,8 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: msHTTPServer.py,v 1.70 2012/06/28 07:28:34 michael Exp $ """ -__version__ = '$Revision: 1.70 $'.split(' ')[1] - - import sys,os,time,SocketServer,socket,traceback try: @@ -350,14 +345,13 @@ ServerInstance = ServerClass(server_address,HTTPHandlerClass) # Set the server name - if ServerInstance.server_address[0]: + try: + ServerInstance.server_name = socket.gethostbyaddr(socket.gethostbyname(ServerInstance.server_address[0]))[0] + except socket.error: try: ServerInstance.server_name = socket.getfqdn() except socket.error: ServerInstance.server_name = ServerInstance.server_address[0] - else: - ServerInstance.server_name = socket.gethostbyaddr(socket.gethostbyname(socket.gethostname()))[0] - # Set the server port ServerInstance.server_port = ServerInstance.server_address[1] diff -Nru web2ldap-1.1.31~dfsg/pylib/msbase.py web2ldap-1.1.43~dfsg/pylib/msbase.py --- web2ldap-1.1.31~dfsg/pylib/msbase.py 2012-02-22 14:28:04.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/msbase.py 2013-06-22 15:51:05.000000000 +0000 @@ -6,16 +6,8 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: msbase.py,v 1.53 2012/02/22 14:28:04 michael Exp $ - -Compability note: -Requires Python 2.0+ """ -__version__ = '$Revision: 1.53 $'.split(' ')[1] - - from collections import defaultdict diff -Nru web2ldap-1.1.31~dfsg/pylib/msgzip.py web2ldap-1.1.43~dfsg/pylib/msgzip.py --- web2ldap-1.1.31~dfsg/pylib/msgzip.py 2009-08-18 23:44:30.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/msgzip.py 2013-06-22 15:38:52.000000000 +0000 @@ -6,8 +6,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: msgzip.py,v 1.10 2009/08/18 23:44:30 michael Exp $ """ try: diff -Nru web2ldap-1.1.31~dfsg/pylib/mspki/__init__.py web2ldap-1.1.43~dfsg/pylib/mspki/__init__.py --- web2ldap-1.1.31~dfsg/pylib/mspki/__init__.py 2003-05-26 07:21:46.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/mspki/__init__.py 2013-06-22 15:38:52.000000000 +0000 @@ -8,6 +8,4 @@ This module requires at least sub-module asn1.py of package Pisces found on http://www.cnri.reston.va.us/software/pisces/ - -$Id: __init__.py,v 1.3 2003/05/26 07:21:46 michael Exp $ """ diff -Nru web2ldap-1.1.31~dfsg/pylib/mspki/asn1helper.py web2ldap-1.1.43~dfsg/pylib/mspki/asn1helper.py --- web2ldap-1.1.31~dfsg/pylib/mspki/asn1helper.py 2009-06-13 13:58:16.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/mspki/asn1helper.py 2013-08-31 16:11:51.000000000 +0000 @@ -8,13 +8,15 @@ This module requires at least sub-module asn1.py of package Pisces found on http://www.cnri.reston.va.us/software/pisces/ - -$Id: asn1helper.py,v 1.6 2009/06/13 13:58:16 michael Exp $ """ import os, string from pisces import asn1 + +oids = {} + + def ParseCfg(dumpasn1cfg): """ Read descriptions of OIDs either from diff -Nru web2ldap-1.1.31~dfsg/pylib/mspki/asn1types.py web2ldap-1.1.43~dfsg/pylib/mspki/asn1types.py --- web2ldap-1.1.31~dfsg/pylib/mspki/asn1types.py 2009-10-23 14:08:02.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/mspki/asn1types.py 2013-08-30 22:07:47.000000000 +0000 @@ -8,8 +8,6 @@ This module requires at least sub-module asn1.py of package Pisces found on http://www.cnri.reston.va.us/software/pisces/ - -$Id: asn1types.py,v 1.7 2009/10/23 14:08:02 michael Exp $ """ import string @@ -67,7 +65,7 @@ str(self) ) - def __html__(self): + def html(self): return str(self) @@ -89,15 +87,12 @@ def __repr__(self): return '{%s}' % string.join(map(repr,self.val),', ') - def __html__(self): + def html(self): return '
      \n%s\n
    \n' % ( - string.join( - map( - lambda x: '
  • %s
  • ' % (x.__html__()), - self.val - ), - '\n' - ) + '\n'.join([ + '
  • %s
  • ' % (x.html()) + for x in self.val + ]) ) @@ -125,13 +120,13 @@ attrs ))) - def __html__(self): + def html(self): l = [] for attr in self.attr_list: if hasattr(self,attr): o = getattr(self,attr) - if hasattr(o,'__html__'): - dd=o.__html__() + if hasattr(o,'html'): + dd=o.html() else: dd=str(o) l.append('
    %s
    \n
    %s
    \n' % (attr,dd)) diff -Nru web2ldap-1.1.31~dfsg/pylib/mspki/nsext.py web2ldap-1.1.43~dfsg/pylib/mspki/nsext.py --- web2ldap-1.1.31~dfsg/pylib/mspki/nsext.py 2009-01-02 22:04:23.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/mspki/nsext.py 2013-08-30 17:51:14.000000000 +0000 @@ -10,8 +10,6 @@ as class names we use the OpenSSL names as class names. netscape-cert-extension OBJECT IDENTIFIER :: = { netscape 1 } - -$Id: nsext.py,v 1.8 2009/01/02 22:04:23 michael Exp $ """ # Python standard lib @@ -49,7 +47,7 @@ """ Base class for URL extensions defined by Netscape """ - def __html__(self,nsBaseUrl='',serial=None,target=''): + def html(self,nsBaseUrl='',serial=None,target=''): if target: target = 'target="%s"' % (target) if str(self.val)[-1]!='?' or serial is None: diff -Nru web2ldap-1.1.31~dfsg/pylib/mspki/pkix.py web2ldap-1.1.43~dfsg/pylib/mspki/pkix.py --- web2ldap-1.1.31~dfsg/pylib/mspki/pkix.py 2009-10-23 14:08:03.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/mspki/pkix.py 2013-08-31 16:11:51.000000000 +0000 @@ -5,8 +5,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: pkix.py,v 1.3 2009/10/23 14:08:03 michael Exp $ """ # Python standard lib @@ -52,11 +50,11 @@ else: return '%s:%s' % (self.tag_str[self.tag],self) - def __html__(self): + def html(self): if self.tag==1: return '%s' % (self,repr(self)) elif self.tag==4: - return self.val.__html__() + return self.val.html() if self.tag==6: return '%s' % ( asn1types.url_target, @@ -127,7 +125,7 @@ str(self) ) - def __html__(self): + def html(self): return str(self) @@ -172,6 +170,12 @@ """ +class CertificateIssuer(GeneralNames): + """ + IssuerAltName ::= GeneralNames + """ + + class DistributionPointName(asn1.Contextual): """ DistributionPointName ::= CHOICE { @@ -200,8 +204,8 @@ def __repr__(self): return '%s:%s' % (self.tag_str[self.tag],str(self)) - def __html__(self): - return '%s:%s' % (self.tag_str[self.tag],self.val.__html__()) + def html(self): + return '%s:%s' % (self.tag_str[self.tag],self.val.html()) class DistributionPoint(asn1types.AttributeSequence): """ @@ -333,13 +337,10 @@ } def __str__(self): - return string.join( - map( - lambda x,d=self.oid_str: d.get(str(x),str(x)), - self.val.val - ), - ', ' - ) + return ', '.join([ + self.oid_str.get(str(x),str(x)) + for x in self.val.val + ]) def __repr__(self): return str(self) @@ -416,7 +417,7 @@ def __init__(self,val): asn1.IA5String.__init__(self,val) - def __html__(self): + def html(self): return '%s' % ( asn1types.url_target, asn1types.url_prefix, @@ -552,3 +553,44 @@ self.requireExplicitPolicy=SkipCerts(i.val) elif i.tag==1: self.inhibitPolicyMapping=SkipCerts(i.val) + + +class CRLReason(asn1.Contextual): + """ + CRLReason ::= ENUMERATED { + unspecified (0), + keyCompromise (1), + cACompromise (2), + affiliationChanged (3), + superseded (4), + cessationOfOperation (5), + certificateHold (6), + -- value 7 is not used + removeFromCRL (8), + privilegeWithdrawn (9), + aACompromise (10) } + """ + enum_dict = { + 0:'unspecified', + 1:'keyCompromise', + 2:'cACompromise', + 3:'affiliationChanged', + 4:'superseded', + 5:'cessationOfOperation', + 6:'certificateHold', + 8:'removeFromCRL', + 9:'privilegeWithdrawn', + 10:'aACompromise', + } + + def __init__(self,val): + self.val = ord(val) + + def __str__(self): + try: + return '%s (%d)' % (self.enum_dict[self.val],self.val) + except KeyError: + return str(self.val) + + def __repr__(self): + return str(self) diff -Nru web2ldap-1.1.31~dfsg/pylib/mspki/utctime.py web2ldap-1.1.43~dfsg/pylib/mspki/utctime.py --- web2ldap-1.1.31~dfsg/pylib/mspki/utctime.py 2009-02-02 16:01:31.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/mspki/utctime.py 2013-06-22 15:38:52.000000000 +0000 @@ -6,8 +6,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: utctime.py,v 1.5 2009/02/02 16:01:31 michael Exp $ """ import time, calendar diff -Nru web2ldap-1.1.31~dfsg/pylib/mspki/util.py web2ldap-1.1.43~dfsg/pylib/mspki/util.py --- web2ldap-1.1.31~dfsg/pylib/mspki/util.py 2010-09-15 13:22:12.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/mspki/util.py 2013-06-22 15:38:52.000000000 +0000 @@ -5,8 +5,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: util.py,v 1.6 2010/09/15 13:22:12 michael Exp $ """ import re,base64 diff -Nru web2ldap-1.1.31~dfsg/pylib/mspki/vendorext.py web2ldap-1.1.43~dfsg/pylib/mspki/vendorext.py --- web2ldap-1.1.31~dfsg/pylib/mspki/vendorext.py 2003-05-26 07:21:47.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/mspki/vendorext.py 2013-08-30 17:51:14.000000000 +0000 @@ -8,8 +8,6 @@ Unlike other extension classes where the ASN.1 type names are used as class names we use the OpenSSL names as class names. - -$Id: vendorext.py,v 1.4 2003/05/26 07:21:47 michael Exp $ """ @@ -61,7 +59,7 @@ self.age = '19'+p[20:22]+'-'+p[16:18]+'-'+p[18:20] self.gender = p[23] - def __html__(self): + def html(self): return """
    country
    @@ -80,4 +78,4 @@ asn1.IA5String( 'd4652bd63f2047029298763c9d2f275069c7359bed1b059da75bc4bc9701747da5d3f2141beadb2bd2e89215ae6bf0d311499da1b845fef3ea450c' ) - ).__html__() + ).html() diff -Nru web2ldap-1.1.31~dfsg/pylib/mspki/x500.py web2ldap-1.1.43~dfsg/pylib/mspki/x500.py --- web2ldap-1.1.31~dfsg/pylib/mspki/x500.py 2009-02-02 16:01:31.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/mspki/x500.py 2013-08-31 16:47:16.000000000 +0000 @@ -5,8 +5,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: x500.py,v 1.16 2009/02/02 16:01:31 michael Exp $ """ # Python standard lib @@ -44,7 +42,7 @@ def __repr__(self): return '%s: %s' % (str(self.val[0]),str(self.val[1])) - def __html__(self): + def html(self): return repr(self) class RelativeDistinguishedName(asn1.Set): @@ -74,7 +72,7 @@ attr_value = unicode(repr(i[0].val[1].val)[1:-1],'ascii') self._name.append((i[0].val[0],attr_value)) - def __descr__(self,oids=None,charset='utf-8'): + def descr(self,oids=None,charset='utf-8'): """Distinguished Name object with OIDs replaced by descriptions""" f=asn1helper.GetOIDDescription return [ @@ -82,7 +80,7 @@ for i in self._name ] - def __htmldescr__(self,oids=None,charset='utf-8'): + def htmldescr(self,oids=None,charset='utf-8'): """Distinguished Name object with OIDs replaced by descriptions""" f=asn1helper.GetOIDDescription return [ @@ -98,8 +96,9 @@ If parameter oids is set (dictionary returned by asn1.parseCfg() descriptions are used instead of OIDs. """ + oids = oids or asn1helper.oids if oids: - rdnlist = self.__descr__(oids) + rdnlist = self.descr(oids) else: rdnlist = self._name return ''.join([ @@ -114,8 +113,9 @@ If parameter oids is set (dictionary returned by asn1.parseCfg() descriptions are used instead of OIDs. """ + oids = oids or asn1helper.oids if oids: - rdnlist = self.__descr__(oids) + rdnlist = self.descr(oids) else: rdnlist = self._name rdnlist.reverse() @@ -124,20 +124,21 @@ for attr_type,attr_value in rdnlist ]) - def __html__(self,oids=None,charset='utf-8'): + def html(self,oids=None,charset='utf-8'): """ HTML-formatted string representation of distinguished name. If parameter oids is set (dictionary returned by asn1.parseCfg() descriptions are used instead of OIDs. """ + oids = oids or asn1helper.oids if oids: - rdnlist = self.__htmldescr__(oids) + rdnlist = self.htmldescr(oids) else: rdnlist = self._name - return '
    \n%s\n
    \n' % ( + return '\n%s\n
    \n' % ( '\n'.join([ - '
    %s
    %s
    ' % (attr_type,attr_value.encode(charset)) + '%s%s' % (attr_type,attr_value.encode(charset)) for attr_type,attr_value in rdnlist ]) ) diff -Nru web2ldap-1.1.31~dfsg/pylib/mspki/x509.py web2ldap-1.1.43~dfsg/pylib/mspki/x509.py --- web2ldap-1.1.31~dfsg/pylib/mspki/x509.py 2013-02-05 20:12:19.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/mspki/x509.py 2013-08-30 20:26:11.000000000 +0000 @@ -5,8 +5,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: x509.py,v 1.16 2013/02/05 20:12:19 michael Exp $ """ # Python standard lib @@ -14,7 +12,7 @@ # Pisces from pisces import asn1 # mspki itself -import utctime, util, x500, asn1helper +import utctime, util, x500, x509v3, asn1helper class Attribute(asn1.ASN1Object): """ @@ -128,31 +126,31 @@ if hasattr(self.tbsCertificate[0],'tag') and \ self.tbsCertificate[0].tag==0: # no version number present - self.__version__ = Version(self.tbsCertificate[0].val) - self.__tbsoffset__ = 1 + self._version = Version(self.tbsCertificate[0].val) + self._tbsoffset = 1 else: # version number present and encoded in contextual object - self.__version__ = Version(None) - self.__tbsoffset__ = 0 + self._version = Version(None) + self._tbsoffset = 0 def version(self): """X.509 certificate version number as integer""" - return self.__version__ + return self._version def serialNumber(self): """Certificate's serial number as long integer""" - return CertificateSerialNumber(self.tbsCertificate[self.__tbsoffset__+0]) + return CertificateSerialNumber(self.tbsCertificate[self._tbsoffset+0]) def signature(self,oids=None): """Certificate's signature""" if oids: - return asn1helper.GetOIDDescription(self.tbsCertificate[self.__tbsoffset__+1].val[0],oids) + return asn1helper.GetOIDDescription(self.tbsCertificate[self._tbsoffset+1].val[0],oids) else: - return self.tbsCertificate[self.__tbsoffset__+1].val[0] + return self.tbsCertificate[self._tbsoffset+1].val[0] def issuer(self): """Issuer's distinguished name""" - return x500.Name(self.tbsCertificate[self.__tbsoffset__+2]) + return x500.Name(self.tbsCertificate[self._tbsoffset+2]) def validity(self): """ @@ -162,21 +160,21 @@ containing UTCTime of begin and end of validity period. """ return ( - utctime.UTCTime(self.tbsCertificate[self.__tbsoffset__+3][0].val), - utctime.UTCTime(self.tbsCertificate[self.__tbsoffset__+3][1].val) + utctime.UTCTime(self.tbsCertificate[self._tbsoffset+3][0].val), + utctime.UTCTime(self.tbsCertificate[self._tbsoffset+3][1].val) ) def subject(self): """Subject's distinguished name""" - return x500.Name(self.tbsCertificate[self.__tbsoffset__+4]) + return x500.Name(self.tbsCertificate[self._tbsoffset+4]) def subjectPublicKeyInfo(self,oids=None): """Subject's public key""" if oids: - alg = asn1helper.GetOIDDescription(self.tbsCertificate[self.__tbsoffset__+5].val[0].val[0],oids) + alg = asn1helper.GetOIDDescription(self.tbsCertificate[self._tbsoffset+5].val[0].val[0],oids) else: - alg = self.tbsCertificate[self.__tbsoffset__+5].val[0].val[0] - modulus, publicExponent = asn1.parse(self.tbsCertificate[self.__tbsoffset__+5].val[1].val) + alg = self.tbsCertificate[self._tbsoffset+5].val[0].val[0] + modulus, publicExponent = asn1.parse(self.tbsCertificate[self._tbsoffset+5].val[1].val) return (alg, modulus, publicExponent) def fingerprint(self,digest_algo,delimiter=':'): @@ -185,7 +183,7 @@ def issuerUniqueID(self): """Get subjectUniqueID (tag 1)""" - for i in range(self.__tbsoffset__+6,len(self.tbsCertificate)): + for i in range(self._tbsoffset+6,len(self.tbsCertificate)): if isinstance(self.tbsCertificate[i],asn1.Contextual): if self.tbsCertificate[i].tag==1: return self.tbsCertificate[i] @@ -193,7 +191,7 @@ def subjectUniqueID(self): """Get subjectUniqueID (tag 2)""" - for i in range(self.__tbsoffset__+6,len(self.tbsCertificate)): + for i in range(self._tbsoffset+6,len(self.tbsCertificate)): if isinstance(self.tbsCertificate[i],asn1.Contextual): if self.tbsCertificate[i].tag==2: return self.tbsCertificate[i] @@ -274,39 +272,39 @@ # Try to determine if optional version field is present # FIX ME!!! This is a pretty ugly hack! if isinstance(self.tbsCertList[0],asn1.Sequence): - self.__version__ = Version(None) - self.__tbsoffset__ = 0 + self._version = Version(None) + self._tbsoffset = 0 else: - self.__version__ = Version(self.tbsCertList[0]) - self.__tbsoffset__ = 1 + self._version = Version(self.tbsCertList[0]) + self._tbsoffset = 1 def version(self): """X.509 CRL version number as integer""" - return self.__version__ + return self._version def signature(self,oids=None): """Certificate's signature algorithm""" if oids: return asn1helper.GetOIDDescription( - self.tbsCertList[self.__tbsoffset__+0].val[0], + self.tbsCertList[self._tbsoffset+0].val[0], oids ) else: - return self.tbsCertList[self.__tbsoffset__+0].val[0] + return self.tbsCertList[self._tbsoffset+0].val[0] def issuer(self): """Issuer's distinguished name""" - return x500.Name(self.tbsCertList[self.__tbsoffset__+1]) + return x500.Name(self.tbsCertList[self._tbsoffset+1]) def thisUpdate(self): """Returns time tuple of thisUpdate""" - return utctime.UTCTime(self.tbsCertList[self.__tbsoffset__+2].val) + return utctime.UTCTime(self.tbsCertList[self._tbsoffset+2].val) def nextUpdate(self): """Returns utctime.UTCTime of nextUpdate if present, None else""" - if isinstance(self.tbsCertList[self.__tbsoffset__+3],asn1.UTCTime) or \ - isinstance(self.tbsCertList[self.__tbsoffset__+3],asn1.GeneralizedTime): - return utctime.UTCTime(self.tbsCertList[self.__tbsoffset__+3].val) + if isinstance(self.tbsCertList[self._tbsoffset+3],asn1.UTCTime) or \ + isinstance(self.tbsCertList[self._tbsoffset+3],asn1.GeneralizedTime): + return utctime.UTCTime(self.tbsCertList[self._tbsoffset+3].val) else: return None @@ -323,9 +321,16 @@ ) """ revokeList = [] - if len (self.tbsCertList)>=self.__tbsoffset__+4+1 and \ - (not hasattr(self.tbsCertList[self.__tbsoffset__+4],'tag') or self.tbsCertList[self.__tbsoffset__+4].tag!=0): - for i in self.tbsCertList[self.__tbsoffset__+4].val: + # Check whether nextUpdate is there + if isinstance(self.tbsCertList[self._tbsoffset+3],asn1.UTCTime) or \ + isinstance(self.tbsCertList[self._tbsoffset+3],asn1.GeneralizedTime): + crl_offset = 4 + else: + # nextUpdate is missing + crl_offset = 3 + if len (self.tbsCertList)>=self._tbsoffset+crl_offset+1 and \ + (not hasattr(self.tbsCertList[self._tbsoffset+crl_offset],'tag') or self.tbsCertList[self._tbsoffset+crl_offset].tag!=0): + for i in self.tbsCertList[self._tbsoffset+crl_offset].val: i_len = len(i) if i_len in [2,3]: userCertificate = i[0] @@ -336,43 +341,8 @@ "Item in revokedCertificates list has invalid length (%d)." % (i_len) ) if i_len==3: - crlEntryExtensions = i[2] + crlEntryExtensions = x509v3.Extensions(i[2]) else: crlEntryExtensions = None revokeList.append((userCertificate,revocationDate,crlEntryExtensions)) return revokeList - - def as_text(self,oids=None): - revokeList = self.revokedCertificates() - if revokeList: - revokeList_str = string.join( - map( - lambda x: - ' Serial Number: %d\n Revocation Date: %s' % (x[0],x[1]), - revokeList - ), - '\n' - ) - else: - revokeList_str = 'None' - return """Certificate Revocation List (CRL): - Version %X - Signature Algorithm: %s - Issuer: %s - Last Update: %s - Next Update: %s -Revoked Certificates: %d -%s - Signature Algorithm: %s -%s -""" % ( - self.version(), - self.signature(oids), - self.issuer().__str__(oids), - self.thisUpdate(), - self.nextUpdate(), - len(revokeList), - revokeList_str, - self.signatureAlgorithm(oids), - util.HexString(self.signatureValue(),wrap=64,indent=8) - ) diff -Nru web2ldap-1.1.31~dfsg/pylib/mspki/x509v3.py web2ldap-1.1.43~dfsg/pylib/mspki/x509v3.py --- web2ldap-1.1.31~dfsg/pylib/mspki/x509v3.py 2010-10-27 07:14:32.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/mspki/x509v3.py 2013-08-31 16:11:51.000000000 +0000 @@ -5,8 +5,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: x509v3.py,v 1.14 2010/10/27 07:14:32 michael Exp $ """ # Python standard lib @@ -14,7 +12,7 @@ # Pisces from pisces import asn1 # mspki itself -import util, asn1helper, x509 +import util, asn1helper, asn1types, x509 _ESCAPE_HTML_CHARS=list('\'&<>":={}()`') @@ -34,8 +32,8 @@ def htmlize(e): """Display certificate extension object e with HTML""" - if hasattr(e,'__html__'): - return e.__html__() + if hasattr(e,'html'): + return e.html() else: return escapeHTML(str(e)) @@ -79,10 +77,10 @@ ' (CRITICAL)'*(self.critical==1) ) - def __html__(self): + def html(self): if hasattr(self,'extnValue'): - if hasattr(self.extnValue,'__html__'): - extnValue_html = self.extnValue.__html__() + if hasattr(self.extnValue,'html'): + extnValue_html = self.extnValue.html() else: extnValue_html = escapeHTML(str(self.extnValue)) else: @@ -98,11 +96,26 @@ """ Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension """ + def __init__(self,val): for i in range(len(val)): val[i]=Extension(val[i]) asn1.Sequence.__init__(self,val) + def __str__(self): + return string.join(map(str,self.val),', ') + + def __repr__(self): + return '{%s}' % string.join(map(repr,self.val),', ') + + def html(self): + return '
      \n%s\n
    \n' % ( + '\n'.join([ + '
  • %s
  • ' % (htmlize(x)) + for x in self.val + ]) + ) + class Certificate(x509.Certificate): """ @@ -133,7 +146,7 @@ """Return extracted X.509v3 extensions""" if int(self.version())<3: return None - for i in self.tbsCertificate[self.__tbsoffset__+6:len(self.tbsCertificate)]: + for i in self.tbsCertificate[self._tbsoffset+6:len(self.tbsCertificate)]: # find first occurence of tag [3] if hasattr(i,'tag') and i.tag==3: return Extensions(i.val) @@ -170,7 +183,7 @@ def crlExtensions(self): """Return extracted X.509v3 extensions""" - for i in self.tbsCertList[self.__tbsoffset__+5:len(self.tbsCertList)]: + for i in self.tbsCertList[self._tbsoffset+5:len(self.tbsCertList)]: # find first occurence of tag [0] if hasattr(i,'tag') and i.tag==0: return Extensions(i.val) @@ -198,6 +211,8 @@ '2.5.29.35':pkix.AuthorityKeyIdentifier, '2.5.29.36':pkix.PolicyConstraints, '2.5.29.37':pkix.extendedKeyUsage, + '2.5.29.21':pkix.CRLReason, + '2.5.29.29':pkix.CertificateIssuer, '1.3.6.1.5.5.7.1.1':pkix.AuthorityInfoAccessSyntax, # Netscape extensions '2.16.840.1.113730.1.1':nsext.nsCertType, @@ -213,5 +228,3 @@ # Verisign extensions '2.16.840.1.113733.1.6.3':vendorext.verisignCZAG, } - - diff -Nru web2ldap-1.1.31~dfsg/pylib/mssignals.py web2ldap-1.1.43~dfsg/pylib/mssignals.py --- web2ldap-1.1.31~dfsg/pylib/mssignals.py 2009-08-18 23:44:30.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/mssignals.py 2013-06-22 15:38:52.000000000 +0000 @@ -7,8 +7,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: mssignals.py,v 1.3 2009/08/18 23:44:30 michael Exp $ """ import signal diff -Nru web2ldap-1.1.31~dfsg/pylib/t61_7.py web2ldap-1.1.43~dfsg/pylib/t61_7.py --- web2ldap-1.1.31~dfsg/pylib/t61_7.py 2010-10-27 08:28:54.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/t61_7.py 2013-06-22 15:38:52.000000000 +0000 @@ -3,8 +3,6 @@ Python Character Mapping Codec for T.61 7-Bit Written by Michael Stroeder . - -$Id: t61_7.py,v 1.10 2010/10/27 08:28:54 michael Exp $ """ import codecs diff -Nru web2ldap-1.1.31~dfsg/pylib/t61_8.py web2ldap-1.1.43~dfsg/pylib/t61_8.py --- web2ldap-1.1.31~dfsg/pylib/t61_8.py 2010-10-27 08:28:54.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/t61_8.py 2013-06-22 15:38:52.000000000 +0000 @@ -3,8 +3,6 @@ Python Character Mapping Codec for T.61 8-Bit Written by Michael Stroeder . - -$Id: t61_8.py,v 1.9 2010/10/27 08:28:54 michael Exp $ """ import codecs diff -Nru web2ldap-1.1.31~dfsg/pylib/utctime.py web2ldap-1.1.43~dfsg/pylib/utctime.py --- web2ldap-1.1.31~dfsg/pylib/utctime.py 2011-05-26 16:02:53.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/utctime.py 2013-06-22 15:38:52.000000000 +0000 @@ -6,8 +6,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: utctime.py,v 1.9 2011/05/26 16:02:53 michael Exp $ """ import time diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/__init__.py web2ldap-1.1.43~dfsg/pylib/w2lapp/__init__.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/__init__.py 2013-02-05 20:17:41.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/__init__.py 2013-08-31 16:07:57.000000000 +0000 @@ -10,9 +10,7 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: __init__.py,v 1.377 2013/02/05 20:17:41 michael Exp $ """ # This is also the release's overall version number -__version__ = '1.1.31' +__version__ = '1.1.43' diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/add.py web2ldap-1.1.43~dfsg/pylib/w2lapp/add.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/add.py 2012-11-16 22:17:33.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/add.py 2013-08-30 17:13:19.000000000 +0000 @@ -10,8 +10,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: add.py,v 1.87 2012/11/16 22:17:33 michael Exp $ """ import ldap, ldap.modlist,pyweblib.forms, \ diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/addmodifyform.py web2ldap-1.1.43~dfsg/pylib/w2lapp/addmodifyform.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/addmodifyform.py 2012-10-28 13:28:52.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/addmodifyform.py 2013-08-27 20:21:38.000000000 +0000 @@ -10,14 +10,13 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: addmodifyform.py,v 1.284 2012/10/28 13:28:52 michael Exp $ """ import re,msbase,pyweblib,ldap,ldif,ldap.schema,\ ldaputil.schema,ldapsession,w2lapp.core,w2lapp.cnf,w2lapp.form,w2lapp.gui,w2lapp.read,w2lapp.schema from w2lapp.schema.viewer import displayNameOrOIDList +from w2lapp.schema.syntaxes import syntax_registry from msbase import GrabKeys try: @@ -95,7 +94,7 @@ def __init__(self,sid,form,ls,dn,schema,entry,writeable_attr_oids,existing_object_classes=None): assert type(dn)==type(u'') - ldaputil.schema.Entry.__init__(self,schema,None,entry) + ldaputil.schema.Entry.__init__(self,schema,dn.encode(ls.charset),entry) self.sid = sid self.form = form self.ls = ls @@ -176,9 +175,7 @@ if not syntax_class.editable: attr_values = [''] - for attr_index in range(len(attr_values)): - - attr_value = attr_values[attr_index] + for attr_index,attr_value in enumerate(attr_values): attr_inst = syntax_class(self.sid,self.form,self.ls,self.dn,self._s,nameoroid,attr_value,self.entry) @@ -246,6 +243,40 @@ return '
    \n'.join(result) + def fieldset_table( + self, + outf, + attr_types_dict, + fieldset_title, + ): + outf_lines = [] + outf_lines.append("""
    + %s + + """ % (fieldset_title,fieldset_title,fieldset_title) + ) + seen_attr_type_oids = ldap.cidict.cidict() + attr_type_names = ldap.cidict.cidict() + for a in self.keys(): + at_oid = self._at2key(a)[0] + if attr_types_dict.has_key(at_oid): + seen_attr_type_oids[at_oid] = None + attr_type_names[a.encode('ascii')] = None + for at_oid,at_se in attr_types_dict.items(): + if at_se and \ + not seen_attr_type_oids.has_key(at_oid) and \ + not w2lapp.schema.no_userapp_attr(self._s,at_oid): + attr_type_names[(at_se.names or (at_se.oid,))[0].encode('ascii')] = None + attr_types = attr_type_names.keys() + attr_types.sort(key=str.lower) + for i,attr_type in enumerate(attr_types): + attr_type_name = w2lapp.gui.SchemaElementName(self.sid,self.form,self.dn,self._s,attr_type,ldap.schema.AttributeType) + attr_value_field_html = self[attr_type] + outf_lines.append('\n\n\n\n' % (attr_type_name,attr_value_field_html)) + outf_lines.append('
    \n%s\n\n%s\n
    ') + outf.write('\n'.join(outf_lines)) + return # fieldset_table() + def DetermineParentDN(command,dn): if command=='addform': @@ -272,8 +303,7 @@ pass else: if parent_search_result: - parent_entry = w2lapp.read.DisplayEntry(sid,form,ls,dn,schema,parent_search_result[0][1]) - parent_entry.sep = ', ' + parent_entry = w2lapp.read.DisplayEntry(sid,form,ls,dn,schema,parent_search_result[0][1],'fieldSep',0) for oc in parent_search_result[0][1].get('objectClass',[]): try: inputform_supentrytemplate[oc] @@ -294,41 +324,6 @@ return '' -def PrintInputFieldset( - outf,sid,form,dn,sub_schema, - attr_types_dict,ignore_attr_types_dict, - fieldset_title,entry,hidden=0 -): - outf_lines = [] - outf_lines.append("""
    - %s - - """ % (fieldset_title,fieldset_title,fieldset_title) - ) - seen_attr_type_oids = ldap.cidict.cidict() - attr_type_names = ldap.cidict.cidict() - for a in entry.keys(): - at_oid = entry._at2key(a)[0] - if not ignore_attr_types_dict.has_key(at_oid) and attr_types_dict.has_key(at_oid): - seen_attr_type_oids[at_oid] = None - attr_type_names[a.encode('ascii')] = None - for at_oid,at_se in attr_types_dict.items(): - if at_se and \ - not seen_attr_type_oids.has_key(at_oid) and \ - not ignore_attr_types_dict.has_key(at_oid) and \ - not w2lapp.schema.no_userapp_attr(sub_schema,at_oid): - attr_type_names[(at_se.names or (at_se.oid,))[0].encode('ascii')] = None - attr_types = attr_type_names.keys() - attr_types.sort(key=str.lower) - for attr_type in attr_types: - attr_type_name = w2lapp.gui.SchemaElementName(sid,form,dn,sub_schema,attr_type,ldap.schema.AttributeType) - attr_value_field_html = entry[attr_type] - outf_lines.append('\n\n\n\n' % (attr_type_name,attr_value_field_html)) - outf_lines.append('
    \n%s\n\n%s\n
    ') - outf.write('\n'.join(outf_lines)) - return # PrintInputFieldset() - - def ObjectClassForm( sid,outf,form,command,ls,sub_schema,dn,rdn, existing_object_classes,structural_object_class @@ -803,25 +798,24 @@ - %s """ % ( all_txtattrtypes_html, all_binattrtypes_html, w2lapp.cnf.misc.input_maxfilelen, - form.hiddenFieldHTML('input_currentformtype',input_formtype,u'') )) -def WriteLDIFField(outf,form,ls,sub_schema,dn,entry,required_attrs_dict,allowed_attrs_dict): +def WriteLDIFField(outf,form,ls,sub_schema,dn,entry): f = StringIO() ldif_writer = ldif.LDIFWriter(f) ldap_entry = {} for attr_type,attr_values in entry.items(): - ldap_entry[attr_type] = [ - attr_value - for attr_value in attr_values - ] + if not w2lapp.schema.no_userapp_attr(sub_schema,attr_type): + ldap_entry[attr_type] = [ + attr_value + for attr_value in attr_values + ] ldif_writer.unparse(dn.encode(ls.charset),ldap_entry) outf.write("""
    @@ -842,6 +836,7 @@ w2lapp.cnf.misc.ldif_maxbytes, ', '.join(w2lapp.cnf.misc.ldif_url_schemes)) ) + return # WriteLDIFField() def w2l_AddForm(sid,outf,command,form,ls,dn,Msg='',rdn_default='',entry=None,skip_oc_input=0): @@ -885,9 +880,12 @@ supentry_display_string = SupentryDisplayString(sid,form,ls,add_basedn,sub_schema,command) - input_formtype = form.getInputValue('input_formtype',[u'Template'])[0] - if not input_formtype in (u'Template',u'Table',u'LDIF'): - input_formtype = form.getInputValue('input_currentformtype',[u'Template'])[0] + input_formtype = form.getInputValue( + 'input_formtype', + form.getInputValue( + 'input_currentformtype',['Template'] + ) + )[0] # Check whether to fall back to table input mode if input_formtype==u'Template': @@ -975,19 +973,18 @@ elif input_formtype==u'Table': # Displaying input form as simple list - displayed_attrs = {} - PrintInputFieldset(outf,sid,form,dn,sub_schema,required_attrs_dict,displayed_attrs,'Required attributes',input_form_entry) - PrintInputFieldset(outf,sid,form,dn,sub_schema,allowed_attrs_dict,displayed_attrs,'Allowed attributes',input_form_entry) - WriteInputFormFooter(outf,form,sub_schema,entry,required_attrs_dict,allowed_attrs_dict,input_formtype) + input_form_entry.fieldset_table(outf,required_attrs_dict,'Required attributes') + input_form_entry.fieldset_table(outf,allowed_attrs_dict,'Allowed attributes') if nomatching_attrs_dict: - PrintInputFieldset(outf,sid,form,dn,sub_schema,nomatching_attrs_dict,displayed_attrs,'Attributes not matching schema',input_form_entry) + input_form_entry.fieldset_table(outf,nomatching_attrs_dict,'Attributes not matching schema') elif input_formtype==u'LDIF': - WriteLDIFField(outf,form,ls,sub_schema,dn,entry,required_attrs_dict,allowed_attrs_dict) - displayed_attrs = input_form_entry.keys() + WriteLDIFField(outf,form,ls,sub_schema,dn,entry) + outf.write(form.hiddenFieldHTML('input_currentformtype',input_formtype,u'')) outf.write('') w2lapp.gui.PrintFooter(outf,form) + return # w2l_AddForm() def w2l_ModifyForm(sid,outf,command,form,ls,dn,Msg='',entry=None,skip_oc_input=0,writeable_attr_oids=None): @@ -1045,9 +1042,12 @@ supentry_display_string = SupentryDisplayString(sid,form,ls,dn,sub_schema,command) - input_formtype = form.getInputValue('input_formtype',[u'Template'])[0] - if not input_formtype in (u'Template',u'Table',u'LDIF'): - input_formtype = form.getInputValue('input_currentformtype',[u'Template'])[0] + input_formtype = form.getInputValue( + 'input_formtype', + form.getInputValue( + 'input_currentformtype',['Template'] + ) + )[0] # Check whether to fall back to table input mode if input_formtype==u'Template': @@ -1118,25 +1118,24 @@ elif input_formtype=='Table': # Displaying rest of input form as simple list - displayed_attrs = {} - PrintInputFieldset(outf,sid,form,dn,sub_schema,required_attrs_dict,displayed_attrs,'Required attributes',input_form_entry) - PrintInputFieldset(outf,sid,form,dn,sub_schema,allowed_attrs_dict,displayed_attrs,'Allowed attributes',input_form_entry) + input_form_entry.fieldset_table(outf,required_attrs_dict,'Required attributes') + input_form_entry.fieldset_table(outf,allowed_attrs_dict,'Allowed attributes') if nomatching_attrs_dict: - PrintInputFieldset(outf,sid,form,dn,sub_schema,nomatching_attrs_dict,displayed_attrs,'Existing attributes not matching schema',input_form_entry) - WriteInputFormFooter(outf,form,sub_schema,entry,required_attrs_dict,allowed_attrs_dict,input_formtype) - + input_form_entry.fieldset_table(outf,nomatching_attrs_dict,'Existing attributes not matching schema') elif input_formtype=='LDIF': - WriteLDIFField(outf,form,ls,sub_schema,dn,entry,required_attrs_dict,allowed_attrs_dict) - displayed_attrs = input_form_entry.keys() + WriteLDIFField(outf,form,ls,sub_schema,dn,entry) assertion_filter = AssertionFilter(ls,entry) outf.write(""" %s + %s """ % ( - form.hiddenFieldHTML('in_assertion',assertion_filter,u'') + form.hiddenFieldHTML('in_assertion',assertion_filter,u''), + form.hiddenFieldHTML('input_currentformtype',unicode(input_formtype),u''), )) w2lapp.gui.PrintFooter(outf,form) + return # w2l_ModifyForm() diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/cnf.py web2ldap-1.1.43~dfsg/pylib/w2lapp/cnf.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/cnf.py 2012-05-23 20:11:45.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/cnf.py 2013-06-22 15:38:52.000000000 +0000 @@ -10,8 +10,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: cnf.py,v 1.48 2012/05/23 20:11:45 michael Exp $ """ import signal,ldapurl,w2lapp.schema,ldap,ldap.schema,ldapsession diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/connect.py web2ldap-1.1.43~dfsg/pylib/w2lapp/connect.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/connect.py 2012-05-25 16:48:55.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/connect.py 2013-06-22 15:38:52.000000000 +0000 @@ -10,8 +10,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: connect.py,v 1.41 2012/05/25 16:48:55 michael Exp $ """ # Modules shipped with web2ldap diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/conninfo.py web2ldap-1.1.43~dfsg/pylib/w2lapp/conninfo.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/conninfo.py 2012-06-01 21:32:49.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/conninfo.py 2013-06-23 14:39:04.000000000 +0000 @@ -10,8 +10,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: conninfo.py,v 1.117 2012/06/01 21:32:49 michael Exp $ """ import time,ldap,ldapsession,utctime,w2lapp.cnf,pyweblib.sslenv,ldaputil.base,w2lapp.core,w2lapp.gui,msgzip @@ -322,14 +320,15 @@

    SSL

    """ % ( w2lapp.core.guessClientAddr(env), - form.env.get('REMOTE_ADDR',''), - form.env.get('REMOTE_PORT',''), + form.utf2display(unicode(form.env.get('REMOTE_ADDR',''))), + form.utf2display(unicode(form.env.get('REMOTE_PORT',''))), form.env.get('SERVER_SIGNATURE',''), - form.accept_charset.upper(), + form.utf2display(unicode(form.accept_charset.upper())), str(compresslevel), cross_check_vars_html, form.utf2display(unicode(form.env.get('HTTP_USER_AGENT',''),form.accept_charset)), - form.browser_type or '',form.browser_version or '', + form.browser_type or '', + form.browser_version or '', ) ) ssl_valid_dn = w2lapp.cnf.GetParam(ls,'ssl_valid_dn','') diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/core.py web2ldap-1.1.43~dfsg/pylib/w2lapp/core.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/core.py 2012-04-20 12:58:39.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/core.py 2013-06-22 15:38:52.000000000 +0000 @@ -10,8 +10,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: core.py,v 1.92 2012/04/20 12:58:39 michael Exp $ """ import sys,os,time,traceback,ldap,ldif,w2lapp.cnf,w2lapp diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/dds.py web2ldap-1.1.43~dfsg/pylib/w2lapp/dds.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/dds.py 2012-11-16 22:19:18.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/dds.py 2013-06-22 15:38:52.000000000 +0000 @@ -10,8 +10,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: dds.py,v 1.4 2012/11/16 22:19:18 michael Exp $ """ import time,ldap,ldapsession,w2lapp.gui diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/delete.py web2ldap-1.1.43~dfsg/pylib/w2lapp/delete.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/delete.py 2012-06-20 17:45:50.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/delete.py 2013-07-29 19:01:25.000000000 +0000 @@ -10,8 +10,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: delete.py,v 1.60 2012/06/20 17:45:50 michael Exp $ """ import time,pyweblib.forms,ldap,ldap.async,ldapsession,ldaputil.base, \ @@ -156,6 +154,16 @@ else: scope = int(form.getInputValue('scope',[str(connLDAPUrl.scope or ldap.SCOPE_BASE)])[0]) + delete_scope_field = pyweblib.forms.Select( + 'scope',u'Scope of delete operation',1, + options=( + (str(ldap.SCOPE_BASE),'Only this entry'), + (str(ldap.SCOPE_ONELEVEL),'All entries below this entry (recursive)'), + (str(ldap.SCOPE_SUBTREE),'All entries including this entry (recursive)'), + ), + default=str(scope), + ) + # Generate a list of requested LDAPv3 extended controls to be sent along # with a modify or delete request delete_ctrl_oids = form.getInputValue('delete_ctrl',[]) @@ -323,7 +331,9 @@ else: hasSubordinates,numSubordinates,numAllSubordinates = ls.subOrdinates(dn) + if hasSubordinates: + if numSubordinates: numSubordinates_html = '

    Number of direct subordinates: %d

    ' % (numSubordinates) else: @@ -349,43 +359,43 @@ ) scope_input_html = """ -

    Delete entry %s. Are you sure?
    - %s%s +

    + Delete entry {text_dn}.
    + {text_num_sub_ordinates} + {text_num_all_sub_ordinates}

    - + - +
    Delete mode:%s
    Delete mode:{field_delete_scope}
    Use tree delete control: - +
    Additional controls:%s
    Additional controls:{field_delete_ctrl}

    Use recursive delete with extreme care! Might take some time.

    - """ % ( - dn_html, - numSubordinates_html,numAllSubordinates_html, - pyweblib.forms.Select( - 'scope',u'Mode of delete operation',1, - options=[ - (str(ldap.SCOPE_BASE),'Only this entry'), - (str(ldap.SCOPE_ONELEVEL),'All entries below this entry (recursive)'), - (str(ldap.SCOPE_SUBTREE),'All entries including this entry (recursive)'), - ], - default=str(scope) - ).inputHTML(), - ldapsession.CONTROL_TREEDELETE, - ' checked'*(ldapsession.CONTROL_TREEDELETE in ls.supportedControl and not 'OpenLDAProotDSE' in ls.rootDSE['objectClass']), - delete_ctrl_field.inputHTML(), + """.format( + text_dn=dn_html, + text_num_sub_ordinates=numSubordinates_html, + text_num_all_sub_ordinates=numAllSubordinates_html, + field_delete_scope=delete_scope_field.inputHTML(), + value_delete_ctrl_oid=ldapsession.CONTROL_TREEDELETE, + value_delete_ctrl_checked=' checked'*int( + ldapsession.CONTROL_TREEDELETE in ls.supportedControl and \ + not 'OpenLDAProotDSE' in ls.rootDSE.get('objectClass',[]) + ), + field_delete_ctrl=delete_ctrl_field.inputHTML(), ) else: scope_input_html = """ -

    Delete whole entry %s.

    - """ % ( - dn_html +

    Delete whole entry {text_dn}.

    + """.format( + text_dn=dn_html, ) # Output confirmation form @@ -397,17 +407,18 @@ ) outf.write("""
    - %s%s +{form_begin} + {text_scope_input}

    Are you sure?

    - %s + {field_hidden_dn}
    -""" % ( - form.beginFormHTML('delete',sid,'POST'), - scope_input_html, - form.hiddenFieldHTML('dn',dn,u''), +""".format( + form_begin=form.beginFormHTML('delete',sid,'POST'), + text_scope_input=scope_input_html, + field_hidden_dn=form.hiddenFieldHTML('dn',dn,u''), )) w2lapp.gui.PrintFooter(outf,form) diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/form.py web2ldap-1.1.43~dfsg/pylib/w2lapp/form.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/form.py 2012-12-17 20:36:45.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/form.py 2013-08-25 13:09:10.000000000 +0000 @@ -10,14 +10,12 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: form.py,v 1.121 2012/12/17 20:36:45 michael Exp $ """ import urllib,codecs,re,ldif,ldapurl,ldap.schema,msgzip,ldaputil.base, \ pyweblib.forms,ldapsession -import w2lapp.cnf,w2lapp.core,w2lapp.gui,w2lapp.passwd,w2lapp.searchform,w2lapp.ldapparams +import w2lapp.cnf,w2lapp.core,w2lapp.gui,w2lapp.passwd,w2lapp.searchform,w2lapp.ldapparams,w2lapp.session # OID description dictionary from configuration directory from ldapoidreg import oid as oid_desc_reg @@ -90,6 +88,13 @@ self.addCommandFields() def addGeneralFields(self): + self.addField(pyweblib.forms.Input( + 'delsid', + u'Old SID to be deleted', + w2lapp.session.session.session_id_len, + 1, + w2lapp.session.session.session_id_re.pattern + )) self.addField(pyweblib.forms.Input('who',u'Bind DN/AuthcID',1000,1,u'.*',size=40)) self.addField(pyweblib.forms.Input('cred',u'with Password',200,1,u'.*',size=15)) self.addField(pyweblib.forms.Select('login_authzid_prefix',u'SASL AuthzID',1,options=[('','- no prefix -'),('u:','user-ID'),('dn:','DN')],default='')) @@ -99,7 +104,11 @@ self.addField(pyweblib.forms.Input('ldapurl',u'LDAP Url',1024,1,'[ ]*ldap(|i|s)://.*',size=30)) self.addField(pyweblib.forms.Input('host',u'Host:Port',255,1,'(%s|[a-zA-Z0-9/._-]+)' % w2lapp.gui.host_pattern,size=30)) self.addField(DistinguishedNameInput('dn','Distinguished Name')) - self.addField(pyweblib.forms.Select('scope','Scope',1,options=[('0','Base'),('1','One level'),('2','Sub tree')],default='2')) + self.addField(pyweblib.forms.Select( + 'scope','Scope',1, + options=w2lapp.searchform.SEARCH_SCOPE_OPTIONS, + default=w2lapp.searchform.SEARCH_SCOPE_STR_SUBTREE), + ) self.addField(DistinguishedNameInput('login_search_root','Login search root')) self.addField(pyweblib.forms.Input('login_filterstr',u'Login search filter string',300,1,'.*')) self.addField(pyweblib.forms.Select( @@ -200,9 +209,9 @@ class Web2LDAPForm_searchform(Web2LDAPForm): def addCommandFields(self): - self.addField(pyweblib.forms.Select('search_submit',u'Search form submit button',1,options=[u'Search',u'More',u'Fewer',u'All Attrs'],default=None)) + self.addField(pyweblib.forms.Select('search_submit',u'',1,options=[u'Search',u'More',u'Fewer',u'All Attrs'],default=None)) + self.addField(pyweblib.forms.Input('search_submit',u'Search form submit button',6,1,'(Search|[+-][0-9]+)')) self.addField(pyweblib.forms.Select('searchform_mode',u'Search form mode',1,options=[(u'base',u'Base'),(u'adv',u'Advanced'),(u'exp',u'Expert')],default=u'base')) - self.addField(pyweblib.forms.Field('search_params',u'Number of search parameters',2,1,'[0-9]+')) self.addField(DistinguishedNameInput('search_root','Search root')) self.addField(pyweblib.forms.Input('filterstr',u'Search filter string',1200,1,'.*')) self.addField(pyweblib.forms.Input('searchform_template',u'Search form template name',60,w2lapp.cnf.misc.max_searchparams,u'[a-zA-Z0-9. ()-]+')) @@ -237,14 +246,15 @@ self.addField(InclOpAttrsCheckbox('search_opattrs',u'Request operational attributes',default="yes",checked=0)) self.addField(pyweblib.forms.Select('search_mode',u'Search Mode',1,options=[ur'(&%s)',ur'(|%s)'])) self.addField(pyweblib.forms.Input('search_attr',u'Attribute(s) to be searched',1000,w2lapp.cnf.misc.max_searchparams,ur'[\w,_;-]+')) + self.addField(pyweblib.forms.Input('search_mr',u'Matching Rule',1000,w2lapp.cnf.misc.max_searchparams,ur'[\w,_;-]+')) self.addField(pyweblib.forms.Select('search_option',u'Search option',w2lapp.cnf.misc.max_searchparams,options=w2lapp.searchform.search_options)) - self.addField(pyweblib.forms.Input('search_string',u'Search string',100,w2lapp.cnf.misc.max_searchparams,u'.*',size=50)) + self.addField(pyweblib.forms.Input('search_string',u'Search string',100,w2lapp.cnf.misc.max_searchparams,u'.*',size=60)) self.addField(pyweblib.forms.Input('search_attrs',u'Attributes to be read',1000,1,ur'[@*+0-9.\w,_;-]+')) class Web2LDAPForm_search(Web2LDAPForm_searchform): def addCommandFields(self): Web2LDAPForm_searchform.addCommandFields(self) - self.addField(pyweblib.forms.Input('filterstr',u'Search filter string',1200,1,u'.*')) + self.addField(pyweblib.forms.Input('filterstr',u'Search filter string',1200,20,'.*')) self.addField(DistinguishedNameInput('search_root','Search root')) self.addField(pyweblib.forms.Input('search_resminindex',u'Minimum index of search results',10,1,u'[0-9]+')) self.addField(pyweblib.forms.Input('search_resnumber',u'Number of results to display',3,1,u'[0-9]+')) @@ -318,16 +328,16 @@ class Web2LDAPForm_add(Web2LDAPForm_input): def addCommandFields(self): + Web2LDAPForm_input.addCommandFields(self) self.addField(pyweblib.forms.Input('add_rdn',u'RDN of new entry',255,1,u'.*',size=50)) self.addField(pyweblib.forms.Input('add_basedn',u'Base DN of new entry',1024,1,u'.*',size=50)) - Web2LDAPForm_input.addCommandFields(self) class Web2LDAPForm_modify(Web2LDAPForm_input): def addCommandFields(self): + Web2LDAPForm_input.addCommandFields(self) self.addField(AttributeType('in_oldattrtypes',u'Old attribute types',w2lapp.cnf.misc.input_maxattrs)) self.addField(AttributeType('in_wrtattroids',u'Writeable attribute types',w2lapp.cnf.misc.input_maxattrs)) self.addField(pyweblib.forms.Input('in_assertion',u'Assertion filter string',2000,1,'.*',required=1)) - Web2LDAPForm_input.addCommandFields(self) class Web2LDAPForm_dds(Web2LDAPForm): def addCommandFields(self): @@ -519,7 +529,7 @@ self,name,text, 512,1,u'[a-zA-Z0-9_.;*-]+', default=default, - required=0,size=25 + required=0,size=30 ) diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/groupadm.py web2ldap-1.1.43~dfsg/pylib/w2lapp/groupadm.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/groupadm.py 2012-02-27 16:35:44.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/groupadm.py 2013-06-22 15:38:52.000000000 +0000 @@ -10,8 +10,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: groupadm.py,v 1.79 2012/02/27 16:35:44 michael Exp $ """ import ldap,ldap.cidict,ldaputil.base, \ @@ -142,6 +140,9 @@ if 'groupadm_add' in form.inputFieldNames or \ 'groupadm_remove' in form.inputFieldNames: + ldaperror_entries = [] + successful_group_mods = [] + for action in ['add','remove']: for action_group_dn in form.getInputValue('groupadm_%s'%action,[]): group_dn = action_group_dn @@ -165,7 +166,50 @@ ) member_value = user_entry[user_entry_attrtype][0] modlist.append((ACTION2MODTYPE[action],group_member_attrtype,member_value)) - ls.modifyEntry(group_dn,modlist) + # Finally try to apply group membership modification(s) to single group entry + try: + ls.modifyEntry(group_dn,modlist) + except ldap.LDAPError,e: + ldaperror_entries.append((group_dn,modlist,w2lapp.gui.LDAPError2ErrMsg(e,form,ls.charset))) + else: + successful_group_mods.append((group_dn,modlist)) + + if successful_group_mods: + group_add_list = [ + (group_dn,modlist) + for group_dn,modlist in successful_group_mods + if modlist and modlist[0][0]==ldap.MOD_ADD + ] + group_remove_list = [ + (group_dn,modlist) + for group_dn,modlist in successful_group_mods + if modlist and modlist[0][0]==ldap.MOD_DELETE + ] + InfoMsg_list = ['

    Changed group membership

    '] + if group_add_list: + InfoMsg_list.append('

    Added to:

    ') + InfoMsg_list.extend([ + '%s
    ' % (form.utf2display(group_dn)) + for group_dn,modlist in group_add_list + ]) + if group_remove_list: + InfoMsg_list.append('

    Removed from:

    ') + InfoMsg_list.extend([ + '%s
    ' % (form.utf2display(group_dn)) + for group_dn,modlist in group_remove_list + ]) + InfoMsg = '\n'.join(InfoMsg_list) + + if ldaperror_entries: + ErrorMsg_list = [ErrorMsg] + ErrorMsg_list.extend([ + 'Error while modifying {group_dn}:
    {error_msg}'.format( + group_dn=form.utf2display(group_dn), + error_msg=error_msg + ) + for group_dn,modlist,error_msg in ldaperror_entries + ]) + ErrorMsg = '
    '.join(ErrorMsg_list) ################################################################# # Search for groups the entry is member of diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/gui.py web2ldap-1.1.43~dfsg/pylib/w2lapp/gui.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/gui.py 2013-02-08 18:40:10.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/gui.py 2013-09-01 02:35:53.000000000 +0000 @@ -10,13 +10,11 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: gui.py,v 1.276 2013/02/08 18:40:10 michael Exp $ """ -import os,urllib,ldap, \ +import os,urllib,ldap,ldapurl, \ ldaputil,pyweblib.forms,pyweblib.httphelper,msbase, \ - w2lapp.core,w2lapp.cnf,w2lapp.schema.syntaxes + w2lapp.core,w2lapp.cnf,w2lapp.schema.syntaxes,w2lapp.searchform from ldapurl import LDAPUrl,LDAPUrlExtension,isLDAPUrl from ldap.filter import escape_filter_chars @@ -110,6 +108,11 @@ unicode(e.args[0]['desc'],charset), unicode(e.args[0].get('info',''),charset) )) + except UnicodeDecodeError: + ErrMsg = u':\n'.join(( + unicode(e.args[0]['desc'],charset), + unicode(repr(e.args[0].get('info','')),charset) + )) except TypeError: try: ErrMsg = u':\n'.join(( @@ -129,7 +132,7 @@ # Add matchedDN to error message HTML if needed if matched_dn: - matched_dn_html = '
    Matched DN: %s' % (form.utf2display(matched_dn.decode(charset))) + matched_dn_html = '
    Matched DN: %s' % (form.utf2display(matched_dn)) else: matched_dn_html = '' @@ -139,6 +142,37 @@ ) +def ts2repr(time_divisors,ts_sep,ts_value): + rest = long(ts_value) + result = [] + for desc,divisor in time_divisors: + mult = rest / divisor + rest = rest % divisor + if mult>0: + result.append(u'%d %s' % (mult,desc)) + if rest==0: + break + return ts_sep.join(result) + + +def repr2ts(time_divisors,ts_sep,value): + l1 = [ v.strip().split(u' ') for v in value.split(ts_sep) ] + l2 = [ + (int(v),d.strip()) + for v,d in l1 + ] + time_divisors_dict = dict(time_divisors) + result = 0 + for value,desc in l2: + try: + result += value*time_divisors_dict[desc] + except KeyError: + raise ValueError + else: + del time_divisors_dict[desc] + return result + + def DisplayDN(sid,form,ls,dn,commandbutton=0,active_ldapurl=0,bindas_button=False): """Display a DN as LDAP URL with or without button""" assert type(dn)==UnicodeType, "Argument 'dn' must be UnicodeType" @@ -391,17 +425,29 @@ cl.append( form.applAnchor( 'search','Up',sid, - [ + ( ('dn',ParentDN(dn)), - ('scope',str(ldap.SCOPE_ONELEVEL)), - ], + ('scope',w2lapp.searchform.SEARCH_SCOPE_STR_ONELEVEL), + ('filterstr',u'(objectClass=*)'), + ), title=u'Go up one level', ) ) cl.extend(( - form.applAnchor('search','Down',sid,(('dn',dn),('scope',unicode(str(ldap.SCOPE_ONELEVEL)))),title=u'Descend into tree from here'), - form.applAnchor('searchform','Search',sid,[('dn',dn)],title=u'Enter search criteria in input form'), + form.applAnchor( + 'search','Down',sid, + ( + ('dn',dn), + ('scope',w2lapp.searchform.SEARCH_SCOPE_STR_ONELEVEL), + ('filterstr',u'(objectClass=*)'), + ), + title=u'Descend into tree from here', + ), + form.applAnchor('searchform','Search',sid, + (('dn',dn),), + title=u'Enter search criteria in input form', + ), )) if dn or ls.l.get_option(ldap.OPT_PROTOCOL_VERSION)>=ldap.VERSION3: @@ -551,16 +597,11 @@ # Ausdrucken eines HTML-Kopfes mit Titelzeile def PrintHeader(sid,outf,form,TitleMsg,link_css): - additional_http_header={ - 'Pragma':'no-cache', - 'Cache-Control':'no-store,no-cache,max-age=0,must-revalidate', - 'X-XSS-Protection':'0', - 'X-DNS-Prefetch-Control':'off', - 'X-Content-Type-Options':'nosniff', - 'X-FRAME-OPTIONS':'DENY', - } + additional_http_header = {} + additional_http_header.update(w2lapp.cnf.misc.http_headers) - if form.env.get('HTTPS','off')=='on': + if form.env.get('HTTPS','off')=='on' and \ + not 'Strict-Transport-Security' in additional_http_header: additional_http_header['Strict-Transport-Security']='max-age=15768000 ; includeSubDomains' pyweblib.httphelper.SendHeader( @@ -583,13 +624,54 @@ return # PrintHeader() +def URLRedirect( + outf, + form, + target_url, + refresh_time=0, + redirect_msg='Redirecting...', + link_text='Click here to manually follow redirect' +): + """ + Outputs HTML text with redirecting section. + """ + + additional_http_header = {} + additional_http_header.update(w2lapp.cnf.misc.http_headers) + + if form.env.get('HTTPS','off')=='on' and \ + not 'Strict-Transport-Security' in additional_http_header: + additional_http_header['Strict-Transport-Security']='max-age=15768000 ; includeSubDomains' + + pyweblib.httphelper.SendHeader(outf,additional_header=additional_http_header) + + # Write out stub body with just a short redirect HTML snippet + outf.write(""" + + + + + +

    {redirect_msg}

    + {link_text} + + + """.format( + refresh_time = refresh_time, + target_url = target_url, + redirect_msg = redirect_msg, + link_text = link_text, + ) + ) + return # URLRedirect() + # Ausdrucken eines HTML-Endes def PrintFooter(f,form): f.write('\n\n') f.flush() -def SearchRootField(form,ls,dn,name='dn',text=u'Search Root',default=None): +def SearchRootField(form,ls,dn,name='dn',text=u'Search Root',default=None,search_root_searchurl=None): """Prepare input field for search root""" def sortkey_func(s): @@ -602,7 +684,28 @@ else: dn_select_list = [] dn_select_list = msbase.union(ls.namingContexts,dn_select_list,ignorecase=1) + if search_root_searchurl: + slu = ldapurl.LDAPUrl(search_root_searchurl.encode(ls.charset)) + try: + ldap_result = ls.l.search_s( + slu.dn, + slu.scope, + slu.filterstr, + attrlist=['1.1'], + ) + except ldap.LDAPError: + pass + else: + dn_select_list = msbase.union( + [ + ls.uc_decode(ldap_dn)[0] + for ldap_dn,ldap_enty in ldap_result + ], + dn_select_list, + ignorecase=1 + ) dn_select_list.append((u'',u'- World -')) + dn_select_list = list(set(dn_select_list)) dn_select_list.sort(key=sortkey_func) srf = pyweblib.forms.Select( name,text,1, diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/handler.py web2ldap-1.1.43~dfsg/pylib/w2lapp/handler.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/handler.py 2013-02-13 19:34:13.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/handler.py 2013-08-25 13:11:10.000000000 +0000 @@ -9,8 +9,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: handler.py,v 1.312 2013/02/13 19:34:13 michael Exp $ """ NON_INTERACTIVE_LOGIN_MECHS = set(['EXTERNAL','GSSAPI']) @@ -189,7 +187,7 @@ # Explicitly remove old session session.deleteSession(sid) # Redirect to start page to avoid people bookmarking disconnect URL - pyweblib.httphelper.URLRedirect(outf,form.script_name,0,'Disconnect...') + w2lapp.gui.URLRedirect(outf,form,form.script_name,0,redirect_msg='Disconnecting...') return elif command=='': # New connect => remove old session if necessary @@ -273,6 +271,13 @@ # Extract the connection parameters from form fields form.getInputFields(ignoreEmptyFields=0) + try: + del_sid = form.field['delsid'].value[0] + except IndexError,e: + pass + else: + session.deleteSession(del_sid) + if 'ldapurl' in form.inputFieldNames: # One form parameter with LDAP URL ldap_url_input = form.field['ldapurl'].value[0] @@ -567,6 +572,33 @@ who=who,relogin=1 ) + except ldapsession.PWD_EXPIRATION_WARNING,e: + # Setup what's required to the case command=='passwd' + ls.setDN(dn or e.who) + form.addField(pyweblib.forms.Select('passwd_scheme',u'Password hash scheme',1,options=w2lapp.passwd.available_hashtypes,default=w2lapp.passwd.available_hashtypes[-1])) + form.addField(pyweblib.forms.Checkbox('passwd_ntpasswordsync',u'Sync ntPassword for Samba',1,default="yes",checked=1)) + form.addField(pyweblib.forms.Checkbox('passwd_settimesync',u'Sync password setting times',1,default="yes",checked=1)) + # Directly generate the change password form + w2lapp.passwd.PasswdForm( + sid,outf,command,form,ls,dn,None, + None,e.who.decode(ls.charset),None, + 'Password change needed', + form.utf2display( + u'Password will expire in %s!' % ( + w2lapp.gui.ts2repr( + ( + (u'weeks',604800), + (u'days',86400), + (u'hours',3600), + (u'mins',60), + (u'secs',1), + ), + u' ', + e.timeBeforeExpiration, + ) + )), + ) + except ldapsession.PasswordPolicyException,e: # Setup what's required to the case command=='passwd' ls.setDN(dn or e.who) diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/ldapparams.py web2ldap-1.1.43~dfsg/pylib/w2lapp/ldapparams.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/ldapparams.py 2012-02-29 17:08:42.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/ldapparams.py 2013-06-22 15:38:52.000000000 +0000 @@ -10,8 +10,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: ldapparams.py,v 1.20 2012/02/29 17:08:42 michael Exp $ """ import time,ldap,ldapsession,w2lapp.cnf,pyweblib.sslenv,w2lapp.core,w2lapp.gui,msgzip, \ diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/locate.py web2ldap-1.1.43~dfsg/pylib/w2lapp/locate.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/locate.py 2012-06-13 09:49:29.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/locate.py 2013-08-13 21:11:42.000000000 +0000 @@ -10,8 +10,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: locate.py,v 1.45 2012/06/13 09:49:29 michael Exp $ """ import re,socket,ldap @@ -21,7 +19,8 @@ except ImportError: DNS = None -from ldapurl import LDAPUrl +from ldaputil.extldapurl import ExtendedLDAPUrl +from ldapurl import LDAPUrlExtension,LDAPUrlExtensions # Modules shipped with web2ldap import ldaputil.base,ldaputil.dns,w2lapp.core,w2lapp.gui,w2lapp.schema.syntaxes @@ -78,7 +77,7 @@ if locate_domain: - dns_list = locate_domain.split(u'.') + dns_list = locate_domain.lower().split(u'.') for dns_index in range(len(dns_list),0,-1): @@ -90,6 +89,19 @@ form.utf2display(dns_name.decode('ascii')), )) + search_base = ldaputil.dns.dnsdomain2dcdn(dns_name) + if dns_name.endswith('de-mail-test.de') or dns_name.endswith('de-mail.de'): + search_base = ','.join((search_base,'cn=de-mail')) + lu_extensions = LDAPUrlExtensions({ + 'x-saslmech':LDAPUrlExtension( + critical=0, + extype='x-saslmech', + exvalue='EXTERNAL' + ) + }) + else: + lu_extensions = None + outf_lines.append('

    Found SRV RRs

    \n') # Search for a SRV RR of dns_name try: @@ -101,6 +113,7 @@ except (DNS.Error,socket.error),e: pass + # Display SRV search results for url_scheme,srv_result in ( ('ldap',ldap_srv_result), @@ -118,11 +131,12 @@ form.utf2display(hostname.decode('ascii')) )) else: - ldap_url = LDAPUrl( + ldap_url = ExtendedLDAPUrl( urlscheme=url_scheme, hostport='%s:%d' % (hostname,port), - dn=ldaputil.dns.dnsdomain2dcdn(dns_name), - scope=ldap.SCOPE_BASE + dn=search_base, + scope=ldap.SCOPE_BASE, + extensions=lu_extensions ) outf_lines.append("""

    IP address found for host name %s: %s

    @@ -141,11 +155,13 @@ ) if locate_name_type==LOCATE_NAME_RFC822: - ldap_url = LDAPUrl( + ldap_url = ExtendedLDAPUrl( + urlscheme=url_scheme, hostport='%s:%d' % (hostname,port), - dn=ldaputil.dns.dnsdomain2dcdn(dns_name), + dn=search_base, scope=ldap.SCOPE_SUBTREE, filterstr='(mail=%s)' % (locate_name), + extensions=lu_extensions ) outf_lines.append(""" %s @@ -168,9 +184,9 @@ except socket.error: pass else: - ldap_url = LDAPUrl( + ldap_url = ExtendedLDAPUrl( hostport=alias_name, - dn=ldaputil.dns.dnsdomain2dcdn(dns_name), + dn=search_base, scope=ldap.SCOPE_BASE ) outf_lines.append(""" diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/login.py web2ldap-1.1.43~dfsg/pylib/w2lapp/login.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/login.py 2012-04-20 19:07:36.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/login.py 2013-06-24 17:29:41.000000000 +0000 @@ -10,8 +10,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: login.py,v 1.66 2012/04/20 19:07:36 michael Exp $ """ import w2lapp.core,w2lapp.gui,w2lapp.cnf @@ -93,13 +91,14 @@

    %s

    - %s\n%s\n%s\n%s\n%s\n%s\n%s\n%s + %s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s """ % ( form.utf2display(title_msg), login_msg_html, - form.beginFormHTML(command,sid,'POST',None), + form.beginFormHTML(command,None,'POST',None), form.hiddenFieldHTML('ldapurl',ls.uri.decode('ascii'),u''), form.hiddenFieldHTML('dn',dn,u''), + form.hiddenFieldHTML('delsid',sid.decode('ascii'),u''), scope_hidden_field, filterstr_hidden_field, login_fields, @@ -110,7 +109,8 @@ form.hiddenInputFields( outf=outf, ignoreFieldNames=[ - 'sid','ldapurl','host','who','cred','dn','scope','filterstr','search_attrs', + 'sid','delsid', + 'ldapurl','host','who','cred','dn','scope','filterstr','search_attrs', 'login_mech','login_authzid','login_authzid_prefix','login_realm', 'login_search_root','login_filterstr' ] diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/modify.py web2ldap-1.1.43~dfsg/pylib/w2lapp/modify.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/modify.py 2012-04-18 20:00:15.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/modify.py 2013-08-30 17:13:19.000000000 +0000 @@ -10,8 +10,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: modify.py,v 1.111 2012/04/18 20:00:15 michael Exp $ """ import ldap,ldif,ldap.schema, \ @@ -104,14 +102,14 @@ sub_schema = ls.retrieveSubSchema(dn,w2lapp.cnf.GetParam(ls,'_schema',None)) - new_entry,invalid_attrs,in_binattrs = GetEntryfromInputForm(form,ls,dn,sub_schema) - in_wrtattroids = form.getInputValue('in_wrtattroids',[]) if in_wrtattroids==['nonePseudoValue;x-web2ldap-None']: writeable_attr_oids = None else: writeable_attr_oids = set([ a.encode(ls.charset) for a in in_wrtattroids ]) + new_entry,invalid_attrs,in_binattrs = GetEntryfromInputForm(form,ls,dn,sub_schema) + # Check if the user just switched input type form if 'input_formtype' in form.inputFieldNames: input_addattrtypes = form.getInputValue('input_addattrtype',[]) diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/monitor.py web2ldap-1.1.43~dfsg/pylib/w2lapp/monitor.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/monitor.py 2012-12-16 15:53:30.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/monitor.py 2013-06-22 15:38:52.000000000 +0000 @@ -10,8 +10,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: monitor.py,v 1.30 2012/12/16 15:53:30 michael Exp $ """ import time,threading,utctime,web2ldapcnf.misc,web2ldapcnf.monitor,w2lapp.core,w2lapp.gui diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/passwd.py web2ldap-1.1.43~dfsg/pylib/w2lapp/passwd.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/passwd.py 2012-12-12 21:11:24.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/passwd.py 2013-06-24 15:33:06.000000000 +0000 @@ -10,8 +10,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: passwd.py,v 1.104 2012/12/12 21:11:24 michael Exp $ """ import time,string,binascii,random,hashlib,ldap,ldaputil.base,ldaputil.passwd, \ @@ -189,7 +187,7 @@ ] form.field['passwd_scheme'].options = default_hashtypes - nthash_available = all_attrs_dict.has_key('1.3.6.1.4.1.7165.2.1.2') or all_attrs_dict.has_key('1.3.6.1.4.1.7165.2.1.25') + nthash_available = all_attrs_dict.has_key('1.3.6.1.4.1.7165.2.1.25') show_clientside_pw_fields = passwd_action=='setuserpassword' and not unicode_pwd_avail passwd_template_str = w2lapp.gui.ReadTemplate(form,ls,'passwd_template',u'password form') @@ -280,11 +278,21 @@ password_attr_types_msg = '' + passwd_modlist = w2lapp.cnf.GetParam(ls,'passwd_modlist',[]) + + # Extend with appropriate user-must-change-password-after-reset attribute + if passwd_forcechange: + # draft-behera-password-policy + if sub_schema.sed[AttributeType].has_key('1.3.6.1.4.1.42.2.27.8.1.22'): + passwd_modlist.append((ldap.MOD_REPLACE,'pwdReset','TRUE')) + # MS AD + elif all_attrs_dict.has_key('1.2.840.113556.1.4.96'): + passwd_modlist.append((ldap.MOD_REPLACE,'pwdLastSet','0')) + if not passwd_action: raise w2lapp.core.ErrorExit(u'No password action chosen.') - elif passwd_action=='passwdextop': #------------------------------------------------------- @@ -306,10 +314,8 @@ ) return else: - if passwd_forcechange: - # Check for draft-behera-password-policy - if sub_schema.sed[AttributeType].has_key('1.3.6.1.4.1.42.2.27.8.1.22'): - ls.modifyEntry(passwd_who,[(ldap.MOD_REPLACE,'pwdReset','TRUE')]) + if passwd_modlist: + ls.modifyEntry(passwd_who,passwd_modlist) if no_passwd_input: password_attr_types_msg = 'Generated password set by the server: %s' % (form.utf2display(passwd_input)) else: @@ -321,8 +327,6 @@ # Modify password via Modify Request #------------------------------------------------------- - modlist = [] - all_attrs_dict = GetAllAllowedAttributes(sub_schema,user_objectclasses) if not all_attrs_dict.has_key('2.5.4.35'): @@ -333,7 +337,7 @@ if user_objectclasses and \ not userpassword_class.lower() in user_objectclasses and \ sub_schema.get_inheritedattr(ldap.schema.ObjectClass,userpassword_class,'kind')==2: - modlist.append((ldap.MOD_ADD,'objectClass',userpassword_class)) + passwd_modlist.append((ldap.MOD_ADD,'objectClass',userpassword_class)) break except KeyError: pass @@ -368,12 +372,12 @@ old_passwd_value = userPassword.encodePassword(old_password,'') if OwnPwdChange(ls,passwd_who) and old_password: - modlist.extend(( + passwd_modlist.extend(( (ldap.MOD_DELETE,passwd_attr_type,[old_passwd_value]), (ldap.MOD_ADD,passwd_attr_type,[new_passwd_value]), )) else: - modlist.append( + passwd_modlist.append( (ldap.MOD_REPLACE,passwd_attr_type,[new_passwd_value]), ) @@ -382,39 +386,20 @@ pwd_change_timestamp = time.time() if passwd_settimesync and all_attrs_dict.has_key('1.3.6.1.1.1.1.5'): - modlist.append((ldap.MOD_REPLACE,'shadowLastChange',str(int(pwd_change_timestamp/86400)))) - - if passwd_forcechange: - # draft-behera-password-policy - if sub_schema.sed[AttributeType].has_key('1.3.6.1.4.1.42.2.27.8.1.22'): - modlist.append((ldap.MOD_REPLACE,'pwdReset','TRUE')) - # MS AD - elif all_attrs_dict.has_key('1.2.840.113556.1.4.96'): - modlist.append((ldap.MOD_REPLACE,'pwdLastSet','0')) + passwd_modlist.append((ldap.MOD_REPLACE,'shadowLastChange',str(int(pwd_change_timestamp/86400)))) passwd_ntpasswordsync = form.getInputValue('passwd_ntpasswordsync',['no'])[0]=='yes' # Samba password synchronization if requested - if passwd_ntpasswordsync: - - if all_attrs_dict.has_key('1.3.6.1.4.1.7165.2.1.2'): - modlist.append((ldap.MOD_REPLACE,'ntPassword',NtPasswordHash(passwd_input))) - - if all_attrs_dict.has_key('1.3.6.1.4.1.7165.2.1.25'): - modlist.append((ldap.MOD_REPLACE,'sambaNTPassword',NtPasswordHash(passwd_input))) - - if passwd_settimesync and passwd_ntpasswordsync: - - if all_attrs_dict.has_key('1.3.6.1.4.1.7165.2.1.3'): - modlist.append((ldap.MOD_REPLACE,'pwdLastSet',str(int(pwd_change_timestamp)))) - - if all_attrs_dict.has_key('1.3.6.1.4.1.7165.2.1.27'): - modlist.append((ldap.MOD_REPLACE,'sambaPwdLastSet',str(int(pwd_change_timestamp)))) + if passwd_ntpasswordsync and all_attrs_dict.has_key('1.3.6.1.4.1.7165.2.1.25'): + passwd_modlist.append((ldap.MOD_REPLACE,'sambaNTPassword',NtPasswordHash(passwd_input))) + if passwd_settimesync and all_attrs_dict.has_key('1.3.6.1.4.1.7165.2.1.27'): + passwd_modlist.append((ldap.MOD_REPLACE,'sambaPwdLastSet',str(int(pwd_change_timestamp)))) password_attr_types_msg = 'Password-related attributes set: %s' % (', '.join( [ - '%s' % (attr_type) - for mod, attr_type, attr_values in modlist + form.utf2display(unicode(attr_type)) + for mod, attr_type, attr_values in passwd_modlist ] )) if no_passwd_input: @@ -422,7 +407,7 @@ # Modify password try: - ls.modifyEntry(passwd_who,modlist) + ls.modifyEntry(passwd_who,passwd_modlist) except (ldap.CONSTRAINT_VIOLATION,ldap.UNWILLING_TO_PERFORM),e: PasswdForm( sid,outf,command,form,ls,dn,sub_schema, diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/read.py web2ldap-1.1.43~dfsg/pylib/w2lapp/read.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/read.py 2013-01-02 17:47:47.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/read.py 2013-08-25 13:14:45.000000000 +0000 @@ -10,8 +10,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: read.py,v 1.174 2013/01/02 17:47:47 michael Exp $ """ import pyweblib.forms,ldap.schema,ldaputil.schema,pyweblib.httphelper, \ @@ -48,7 +46,6 @@ except IOError: outf.write('

    I/O error during reading template file for object class %s.

    ' % oc) else: - display_entry.sep = '
    ' try: template_attr_oid_set = set([ sub_schema.getoid(ldap.schema.AttributeType,attr_type_name) @@ -110,15 +107,17 @@ class DisplayEntry(ldaputil.schema.Entry): - def __init__(self,sid,form,ls,dn,schema,entry): - ldaputil.schema.Entry.__init__(self,schema,None,entry) - self.entry = ldaputil.schema.Entry(schema,None,entry) + def __init__(self,sid,form,ls,dn,schema,entry,sep_attr,commandbutton): + assert type(dn)==type(u'') + ldaputil.schema.Entry.__init__(self,schema,dn.encode(ls.charset),entry) + self.entry = ldaputil.schema.Entry(schema,dn.encode(ls.charset),entry) self.sid = sid self.form = form self.ls = ls self.dn = dn - self.sep = None self.invalid_attrs = set() + self.sep_attr = sep_attr + self.commandbutton = commandbutton def __getitem__(self,nameoroid): oid = self._at2key(nameoroid)[0] @@ -132,7 +131,7 @@ for i in range(len(values)): attr_instance = syntax_se(self.sid,self.form,self.ls,self.dn,self._s,nameoroid,values[i],self.entry) try: - attr_value_html = attr_instance.displayValue(valueindex=i,commandbutton=1) + attr_value_html = attr_instance.displayValue(valueindex=i,commandbutton=self.commandbutton) except UnicodeError: # Fall back to hex-dump output attr_instance = w2lapp.schema.syntaxes.OctetString(self.sid,self.form,self.ls,self.dn,self._s,nameoroid,values[i],self.entry) @@ -143,10 +142,11 @@ attr_value_html = '%s' % (attr_value_html) self.invalid_attrs.add(nameoroid) result.append(attr_value_html) - if self.sep is None: - return result + if self.sep_attr!=None: + value_sep = getattr(attr_instance,self.sep_attr) + return value_sep.join(result) else: - return self.sep.join(result) + return result def getOperationAttrsTemplate(ls,accept_language): @@ -304,12 +304,13 @@ if search_result: entry.update(search_result[0][1]) - display_entry = DisplayEntry(sid,form,ls,dn,sub_schema,entry) + display_entry = DisplayEntry(sid,form,ls,dn,sub_schema,entry,'readSep',1) # Save session into database mainly for storing LDAPSession cache session.storeSession(sid,ls) - if len(wanted_attrs)==1: + if len(wanted_attrs)==1 and \ + not wanted_attrs[0] in ('*','+'): # Display a single binary attribute either with a registered # viewer or just by sending the data blob with appropriate MIME-type @@ -445,10 +446,12 @@ else: nomatching_attrs.append(a) + display_entry.sep_attr = None PrintAttrList(sid,outf,ls,form,dn,sub_schema,display_entry,required_attrs,'Required Attributes') PrintAttrList(sid,outf,ls,form,dn,sub_schema,display_entry,allowed_attrs,'Allowed Attributes') PrintAttrList(sid,outf,ls,form,dn,sub_schema,display_entry,collective_attrs,'Collective Attributes') PrintAttrList(sid,outf,ls,form,dn,sub_schema,display_entry,nomatching_attrs,'Various Attributes') + display_entry.sep_attr = 'readSep' # Display operational attributes with template as footer if read_output==u'template': diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/referral.py web2ldap-1.1.43~dfsg/pylib/w2lapp/referral.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/referral.py 2012-04-20 19:23:46.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/referral.py 2013-06-22 15:38:52.000000000 +0000 @@ -10,8 +10,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: referral.py,v 1.46 2012/04/20 19:23:46 michael Exp $ """ import ldaputil.base,w2lapp.core,w2lapp.gui,w2lapp.cnf diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/rename.py web2ldap-1.1.43~dfsg/pylib/w2lapp/rename.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/rename.py 2012-04-20 19:16:00.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/rename.py 2013-08-24 18:17:11.000000000 +0000 @@ -10,8 +10,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: rename.py,v 1.39 2012/04/20 19:16:00 michael Exp $ """ import ldap,ldapurl,pyweblib.forms,ldaputil.base, \ @@ -142,7 +140,7 @@ # Determine LDAP search filter for building a select list for new superior DN # based on governing structure rule - dit_structure_ruleids = entry.get_possible_dit_structure_rules(dn) + dit_structure_ruleids = entry.get_possible_dit_structure_rules(dn.encode(ls.charset)) for dit_structure_ruleid in dit_structure_ruleids: sup_structural_ruleids,sup_structural_oc = sub_schema.get_superior_structural_oc_names(dit_structure_ruleid) if sup_structural_oc: diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/__init__.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/__init__.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/__init__.py 2012-01-30 13:32:50.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/__init__.py 2013-08-31 23:44:39.000000000 +0000 @@ -11,8 +11,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: __init__.py,v 1.40 2012/01/30 13:32:50 michael Exp $ """ import sys,ldap,ldap.schema,ldaputil.schema,msbase @@ -26,21 +24,21 @@ }) # OIDs of syntaxes and attribute types which need ;binary -NEEDS_BINARY_TAG = { +NEEDS_BINARY_TAG = set(( # attribute types - '2.5.4.37':None, # caCertificate - '2.5.4.36':None, # userCertificate - '2.5.4.40':None, # crossCertificatePair - '2.5.4.52':None, # supportedAlgorithms - '2.5.4.38':None, # authorityRevocationList - '2.5.4.39':None, # certificateRevocationList - '2.5.4.53':None, # deltaRevocationList + '2.5.4.37', # caCertificate + '2.5.4.36', # userCertificate + '2.5.4.40', # crossCertificatePair + '2.5.4.52', # supportedAlgorithms + '2.5.4.38', # authorityRevocationList + '2.5.4.39', # certificateRevocationList + '2.5.4.53', # deltaRevocationList # LDAP syntaxes - '1.3.6.1.4.1.1466.115.121.1.8':None, # Certificate - '1.3.6.1.4.1.1466.115.121.1.10':None, # Certificate Pair - '1.3.6.1.4.1.1466.115.121.1.49':None, # Supported Algorithm - '1.3.6.1.4.1.1466.115.121.1.9':None, # Certificate List -} + '1.3.6.1.4.1.1466.115.121.1.8', # Certificate + '1.3.6.1.4.1.1466.115.121.1.9', # Certificate List + '1.3.6.1.4.1.1466.115.121.1.10', # Certificate Pair + '1.3.6.1.4.1.1466.115.121.1.49', # Supported Algorithm +)) def no_userapp_attr(schema,attr_type_name): """ diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/__init__.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/__init__.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/__init__.py 2009-08-18 23:44:31.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/__init__.py 2013-06-22 15:51:05.000000000 +0000 @@ -1,7 +1,4 @@ # -*- coding: utf-8 -*- """ Package for various plugin modules - -$Id: __init__.py,v 1.2 2009/08/18 23:44:31 michael Exp $ """ - diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/acp133.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/acp133.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/acp133.py 2012-12-12 21:11:24.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/acp133.py 2013-06-22 15:38:52.000000000 +0000 @@ -4,8 +4,6 @@ (see draft-dally-acp133-and-ldap) Currently untested! - -$Id: acp133.py,v 1.7 2012/12/12 21:11:24 michael Exp $ """ diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/activedirectory.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/activedirectory.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/activedirectory.py 2012-06-01 20:48:26.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/activedirectory.py 2013-07-15 08:25:49.000000000 +0000 @@ -1,11 +1,9 @@ # -*- coding: utf-8 -*- """ web2ldap plugin classes for Active Directory (for some information see draft-armijo-ldap-syntax) - -$Id: activedirectory.py,v 1.48 2012/06/01 20:48:26 michael Exp $ """ -import time,utctime,struct,pyweblib,ldap.cidict,w2lapp.cnf,mspki.util +import time,utctime,struct,uuid,pyweblib,ldap.cidict,w2lapp.cnf,w2lapp.searchform,mspki.util from w2lapp.gui import DisplayDN @@ -196,11 +194,10 @@ 'searchform','»',self._sid, [ ('dn',self._dn), - ('filterstr', '(objectSid=%s)' % ( - self._form.utf2display(sddl_str) - ) - ), - ('searchform_mode','exp'), + ('searchform_mode',u'adv'), + ('search_attr',u'objectSid'), + ('search_option',w2lapp.searchform.SEARCH_OPT_IS_EQUAL), + ('search_string',sddl_str), ], title=u'Search by SID', ) @@ -599,6 +596,35 @@ desc = 'Object-Security-Descriptor' +class MsAdGUID(OctetString): + oid = 'MsAdGUID-oid' + desc = 'GUID in Active Directory' + + def sanitizeInput(self,attrValue): + try: + object_guid_uuid = uuid.UUID(attrValue.replace(':','')) + except ValueError: + return OctetString.sanitizeInput(self,attrValue) + else: + return object_guid_uuid.bytes + + def displayValue(self,valueindex=0,commandbutton=0): + object_guid_uuid = uuid.UUID(bytes=self.attrValue) + return '{%s}
    %s' % ( + str(object_guid_uuid), + OctetString.displayValue(self,valueindex=0,commandbutton=0), + ) + +syntax_registry.registerAttrType( + MsAdGUID.oid,[ + '1.2.840.113556.1.4.2', # objectGUID + '1.2.840.113556.1.4.1224', # parentGUID + '1.2.840.113556.1.4.340', # rightsGuid + '1.2.840.113556.1.4.362', # siteGUID + ] +) + + class Interval(MicrosoftLargeInteger): oid = 'Interval-oid' desc = 'Large integer with timestamp expressed as 100 nanoseconds since 1601-01-01 00:00' @@ -758,6 +784,23 @@ ) +class MsDSSupportedEncryptionTypes(BitArrayInteger): + oid = 'MsDSSupportedEncryptionTypes-oid' + flag_desc_table = ( + (u'KERB_ENCTYPE_DES_CBC_CRC',0x00000001), + (u'KERB_ENCTYPE_DES_CBC_MD5',0x00000002), + (u'KERB_ENCTYPE_RC4_HMAC_MD5',0x00000004), + (u'KERB_ENCTYPE_AES128_CTS_HMAC_SHA1_96',0x00000008), + (u'KERB_ENCTYPE_AES256_CTS_HMAC_SHA1_96',0x00000010), + ) + +syntax_registry.registerAttrType( + MsDSSupportedEncryptionTypes.oid,[ + '1.2.840.113556.1.4.1963', # msDS-SupportedEncryptionTypes + ] +) + + # Register all syntax classes in this module for symbol_name in dir(): syntax_registry.registerSyntaxClass(eval(symbol_name)) diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/apple.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/apple.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/apple.py 2011-01-06 12:07:31.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/apple.py 2013-07-15 08:25:49.000000000 +0000 @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- """ web2ldap plugin classes for attributes defined in apple.schema - -$Id: apple.py,v 1.4 2011/01/06 12:07:31 michael Exp $ """ from w2lapp.schema.syntaxes import XmlValue,UUID,DynamicValueSelectList,syntax_registry @@ -27,11 +25,10 @@ 'searchform','»',self._sid, ( ('dn',self._dn), - ( - 'filterstr', - '(apple-generateduid=%s)' % (value_disp) - ), - ('searchform_mode','exp'), + ('searchform_mode',u'adv'), + ('search_attr',u'apple-generateduid'), + ('search_option',w2lapp.searchform.SEARCH_OPT_IS_EQUAL), + ('search_string',value_disp), ), title=u'Search entry by UUID', ) diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/asn1objects.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/asn1objects.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/asn1objects.py 2009-08-18 23:44:31.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/asn1objects.py 2013-08-31 23:44:39.000000000 +0000 @@ -1,24 +1,18 @@ # -*- coding: utf-8 -*- """ web2ldap plugin classes for ASN.1 objects - -$Id: asn1objects.py,v 1.2 2009/08/18 23:44:31 michael Exp $ """ -from w2lapp.schema.syntaxes import syntax_registry +from w2lapp.schema.syntaxes import ASN1Object,syntax_registry + -try: - from w2lapp.schema.syntaxes import ASN1Object -except ImportError: - pass -else: - syntax_registry.registerAttrType( - ASN1Object.oid,[ - '1.3.6.1.4.1.8301.3.6.1.1', # signatureRenewal - '1.3.6.1.4.1.8301.3.6.1.2', # signatureRenewals - '0.2.262.1.10.7.124', # signatureRenewals - ] - ) +syntax_registry.registerAttrType( + ASN1Object.oid,[ + '1.3.6.1.4.1.8301.3.6.1.1', # signatureRenewal + '1.3.6.1.4.1.8301.3.6.1.2', # signatureRenewals + '0.2.262.1.10.7.124', # signatureRenewals + ] +) # Register all syntax classes in this module diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/dds.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/dds.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/dds.py 2011-11-29 13:36:43.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/dds.py 2013-06-22 15:38:52.000000000 +0000 @@ -1,24 +1,22 @@ # -*- coding: utf-8 -*- """ web2ldap plugin classes dynamic entries (see RFC 2589) - -$Id: dds.py,v 1.1 2011/11/29 13:36:43 michael Exp $ """ import time,utctime,ldap.cidict,ldapurl from w2lapp.schema.syntaxes import LDAPSyntax,DirectoryString, \ - Integer,DistinguishedName,GeneralizedTime,syntax_registry + Integer,Timespan,DistinguishedName,GeneralizedTime,syntax_registry -class EntryTTL(Integer): +class EntryTTL(Timespan): oid = 'EntryTTL-oid' desc = 'Time-to-live of dynamic entry' def displayValue(self,valueindex=0,commandbutton=0): expiration_time = time.time()+int(self.attrValue) - return '%s seconds, expires %s' % ( - Integer.displayValue(self,valueindex,commandbutton), + return '%s, expires %s' % ( + Timespan.displayValue(self,valueindex,commandbutton), utctime.strftimeiso8601(time.gmtime(expiration_time)), ) diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/demail.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/demail.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/demail.py 2012-04-24 16:48:59.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/demail.py 2013-06-22 15:38:52.000000000 +0000 @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- """ web2ldap plugin classes for attributes defined for DE-Mail - -$Id: demail.py,v 1.1 2012/04/24 16:48:59 michael Exp $ """ import os.path,web2ldapcnf diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/dhcp.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/dhcp.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/dhcp.py 2013-02-08 18:50:11.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/dhcp.py 2013-06-22 15:38:52.000000000 +0000 @@ -3,8 +3,6 @@ web2ldap plugin classes for attributes defined for DHCP service See http://tools.ietf.org/draft/draft-ietf-dhc-ldap-schema/ - -$Id: dhcp.py,v 1.17 2013/02/08 18:50:11 michael Exp $ """ import re diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/dirx.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/dirx.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/dirx.py 2011-10-17 17:57:59.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/dirx.py 2013-06-22 15:38:52.000000000 +0000 @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- """ web2ldap plugin classes for Siemens DirX - -$Id: dirx.py,v 1.3 2011/10/17 17:57:59 michael Exp $ """ from w2lapp.schema.syntaxes import DirectoryString,DistinguishedName,syntax_registry diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/dyngroup.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/dyngroup.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/dyngroup.py 2013-02-14 08:54:01.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/dyngroup.py 2013-06-22 15:38:52.000000000 +0000 @@ -1,7 +1,5 @@ """ web2ldap plugin classes for attributes defined for so-called dynamic groups - -$Id: dyngroup.py,v 1.3 2013/02/14 08:54:01 michael Exp $ """ import ldap,ldapurl,ldaputil.base diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/edirectory.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/edirectory.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/edirectory.py 2012-12-12 21:11:24.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/edirectory.py 2013-08-31 23:44:39.000000000 +0000 @@ -2,8 +2,6 @@ """ web2ldap plugin classes for Novell eDirectory/DirXML (see draft-sermersheim-nds-ldap-schema) - -$Id: edirectory.py,v 1.35 2012/12/12 21:11:24 michael Exp $ """ import uuid,ldap.filter @@ -13,9 +11,10 @@ from pyweblib.forms import escapeHTML from w2lapp.schema.syntaxes import DirectoryString,Integer,OctetString, \ - PostalAddress,PrintableString,Certificate,CertificateRevocationList, \ + PostalAddress,PrintableString, \ MultilineText,OID,SelectList,DynamicDNSelectList,NullTerminatedDirectoryString, \ Binary,BitArrayInteger,XmlValue,PreformattedMultilineText,syntax_registry +from w2lapp.schema.plugins.x509 import Certificate,CertificateList from w2lapp.gui import DisplayDN @@ -396,7 +395,7 @@ ) syntax_registry.registerAttrType( - CertificateRevocationList.oid,[ + CertificateList.oid,[ '2.16.840.1.113719.1.48.4.1.34', # certificateRevocationList in Novell eDirectory ] ) diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/eduperson.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/eduperson.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/eduperson.py 2009-08-18 23:44:31.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/eduperson.py 2013-06-22 15:38:52.000000000 +0000 @@ -3,8 +3,6 @@ web2ldap plugin classes for attributes defined eduPerson See http://middleware.internet2.edu/eduperson/ - -$Id: eduperson.py,v 1.4 2009/08/18 23:44:31 michael Exp $ """ import re diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/entrust.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/entrust.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/entrust.py 2009-12-13 12:47:25.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/entrust.py 2013-06-22 15:38:52.000000000 +0000 @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- """ web2ldap plugin classes for Entrust PKI - -$Id: entrust.py,v 1.3 2009/12/13 12:47:25 michael Exp $ """ from w2lapp.schema.syntaxes import Binary,syntax_registry diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/exchange.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/exchange.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/exchange.py 2009-08-18 23:44:31.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/exchange.py 2013-06-22 15:38:52.000000000 +0000 @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- """ web2ldap plugin classes for MS Exchange 5.5 - -$Id: exchange.py,v 1.2 2009/08/18 23:44:31 michael Exp $ """ from w2lapp.gui import DisplayDN diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/freeradius.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/freeradius.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/freeradius.py 1970-01-01 00:00:00.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/freeradius.py 2013-06-22 15:38:52.000000000 +0000 @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +""" +web2ldap plugin classes for FreeRADIUS/LDAP schema +""" + +from w2lapp.schema.syntaxes import DynamicDNSelectList,syntax_registry + + +class RadiusProfileDN(DynamicDNSelectList): + oid = 'RadiusProfileDN-oid' + desc = 'DN of a radius profile entry with real data' + ldap_url = 'ldap:///_??sub?(&(objectClass=radiusprofile)(!(radiusProfileDn=*)))' + +syntax_registry.registerAttrType( + RadiusProfileDN.oid,[ + '1.3.6.1.4.1.3317.4.3.1.49' , # radiusProfileDn + ] +) + + +# Register all syntax classes in this module +for name in dir(): + syntax_registry.registerSyntaxClass(eval(name)) diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/ibmds.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/ibmds.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/ibmds.py 2009-08-18 23:44:31.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/ibmds.py 2013-06-22 15:38:52.000000000 +0000 @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- """ web2ldap plugin classes for IBM Tivoliy Directory Server - -$Id: ibmds.py,v 1.2 2009/08/18 23:44:31 michael Exp $ """ from w2lapp.gui import DisplayDN diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/krb5.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/krb5.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/krb5.py 2012-12-12 21:11:24.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/krb5.py 2013-06-22 15:38:52.000000000 +0000 @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- """ web2ldap plugin classes for Kerberos (see krb5-kdc.schema) - -$Id: krb5.py,v 1.10 2012/12/12 21:11:24 michael Exp $ """ from w2lapp.schema.syntaxes import \ diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/ldapns.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/ldapns.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/ldapns.py 2009-08-18 23:44:31.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/ldapns.py 2013-06-22 15:38:52.000000000 +0000 @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- """ web2ldap plugin classes for LDAP-based naming service (ldapns.schema) - -$Id: ldapns.py,v 1.3 2009/08/18 23:44:31 michael Exp $ """ from w2lapp.schema.syntaxes import LDAPSyntax,SelectList,syntax_registry diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/lotusdomino.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/lotusdomino.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/lotusdomino.py 2012-05-26 14:58:42.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/lotusdomino.py 2013-09-01 01:59:16.000000000 +0000 @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- """ web2ldap plugin classes for PGP key server - -$Id: lotusdomino.py,v 1.11 2012/05/26 14:58:42 michael Exp $ """ import re @@ -30,7 +28,7 @@ def displayValue(self,valueindex=0,commandbutton=0): lines = [ self._form.utf2display(l) - for l in self._split_lines(self.attrValue) + for l in self._split_lines(self.attrValue.decode('ascii')) ] return '%s' % '
    '.join(lines) diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/msperson.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/msperson.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/msperson.py 2012-04-24 16:49:47.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/msperson.py 2013-06-22 15:38:52.000000000 +0000 @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- """ web2ldap plugin classes for attributes defined for msPerson - -$Id: msperson.py,v 1.15 2012/04/24 16:49:47 michael Exp $ """ import re,os.path,datetime, \ diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/mssfu30.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/mssfu30.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/mssfu30.py 2012-03-21 22:48:52.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/mssfu30.py 2013-06-22 15:38:52.000000000 +0000 @@ -2,8 +2,6 @@ """ web2ldap plugin classes for schema elements defined for MS Identity Management for Unix (formerly known as MS Services for Unix) - -$Id: mssfu30.py,v 1.4 2012/03/21 22:48:52 michael Exp $ """ from w2lapp.schema.syntaxes import DynamicValueSelectList,syntax_registry diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/nis.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/nis.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/nis.py 2013-02-08 18:50:11.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/nis.py 2013-07-15 08:25:49.000000000 +0000 @@ -1,11 +1,9 @@ # -*- coding: utf-8 -*- """ web2ldap plugin classes for schema elements defined in RFC2307 - -$Id: nis.py,v 1.26 2013/02/08 18:50:11 michael Exp $ """ -import re,pyweblib.forms,ldap.schema,ldaputil.schema +import re,pyweblib.forms,ldap.schema,ldaputil.schema,w2lapp.searchform from w2lapp.schema.syntaxes import SelectList,IA5String,IntegerRange, \ IPHostAddress,IPNetworkAddress,IPServicePortNumber,MacAddress, \ @@ -50,20 +48,23 @@ return r[0] if 'posixGroup' in ocs: title = u'Search group members' - filterstr_template = '(&(|(objectClass=posixAccount)(objectClass=shadowAccount))(gidNumber=%s))' + searchform_params = [ + ('dn',self._dn), + ('searchform_mode',u'adv'), + ('search_attr',u'objectClass'), + ('search_option',w2lapp.searchform.SEARCH_OPT_IS_EQUAL), + ('search_string',u'posixGroup'), + ('search_attr',u'gidNumber'), + ('search_option',w2lapp.searchform.SEARCH_OPT_IS_EQUAL), + ('search_string',self._ls.uc_decode(self.attrValue)[0]), + ] else: title = None - filterstr_template = None - if title and filterstr_template: + searchform_params = None + if title and searchform_params: r.append(self._form.applAnchor( 'searchform','»',self._sid, - [ - ('dn',self._dn), - ('filterstr', filterstr_template % ( - escape_filter_chars(self._ls.uc_decode(self.attrValue)[0]) - )), - ('searchform_mode','exp'), - ], + searchform_params, title=title, )) return ' '.join(r) diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/opends.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/opends.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/opends.py 2012-11-16 23:06:19.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/opends.py 2013-08-31 23:44:39.000000000 +0000 @@ -1,14 +1,12 @@ # -*- coding: utf-8 -*- """ web2ldap plugin classes for OpenDS and OpenDJ - -$Id: opends.py,v 1.29 2012/11/16 23:06:19 michael Exp $ """ import re,mspki.util,ldap,ldap.cidict,w2lapp.schema -from w2lapp.schema.syntaxes import LDAPSyntax,DirectoryString,OctetString,SelectList,DynamicDNSelectList,MultilineText,Certificate,BindDN,syntax_registry - +from w2lapp.schema.syntaxes import LDAPSyntax,DirectoryString,OctetString,SelectList,DynamicDNSelectList,MultilineText,BindDN,syntax_registry +from w2lapp.schema.plugins.x509 import Certificate from ldaputil.base import explode_dn,rdn_dict diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/openldap.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/openldap.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/openldap.py 2012-05-26 14:58:42.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/openldap.py 2013-09-01 00:26:22.000000000 +0000 @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- """ web2ldap plugin classes for OpenLDAP - -$Id: openldap.py,v 1.22 2012/05/26 14:58:42 michael Exp $ """ from w2lapp.schema.syntaxes import \ @@ -23,10 +21,33 @@ # slapo-syncprov #--------------------------------------------------------------------------- +# see http://www.openldap.org/faq/data/cache/1145.html +class CSN_SID(IA5String): + oid = '1.3.6.1.4.1.4203.666.11.2.4' + desc = 'change sequence number SID (CSN SID)' + minLen = 3 + maxLen = 3 + reObj = re.compile('^[a-fA-F0-9]{3}$') + + +# see http://www.openldap.org/faq/data/cache/1145.html +class CSN(IA5String): + oid = '1.3.6.1.4.1.4203.666.11.2.1' + desc = 'change sequence number (CSN)' + minLen = 40 + maxLen = 40 + reObj = re.compile('^[0-9]{14}\\.[0-9]{6}Z#[a-fA-F0-9]{6}#[a-fA-F0-9]{3}#[a-fA-F0-9]{6}$') + -class EntryCSN(DirectoryString): - oid = '1.3.6.1.4.1.4203.666.1.7' - desc = 'OpenLDAP EntryCSN' +syntax_registry.registerAttrType( + CSN.oid,[ + '1.3.6.1.4.1.4203.666.1.25', # contextCSN + '1.3.6.1.4.1.4203.666.1.7', # entryCSN + '1.3.6.1.4.1.4203.666.1.13', # namingCSN + # also register by name in case OpenLDAP was built without -DSLAP_SCHEMA_EXPOSE + 'contextCSN','entryCSN','namingCSN', + ] +) #--------------------------------------------------------------------------- @@ -268,9 +289,13 @@ except (KeyError,ValueError,IndexError): pass else: + try: + decoded_control_value = ber_decoder.decode(ctrl_value) + except: + decoded_control_value = ctrl_value result_lines.append('controlValue %s' % ( self._form.utf2display( - repr(ber_decoder.decode(ctrl_value)).decode('ascii') + repr(decoded_control_value).decode('ascii') ).replace('\n','
    ') )) return '
    '.join(result_lines) @@ -315,6 +340,16 @@ #--------------------------------------------------------------------------- +class Authz(DirectoryString): + oid = '1.3.6.1.4.1.4203.666.2.7' + desc = 'OpenLDAP authz' + + +class OpenLDAPACI(DirectoryString): + oid = '1.3.6.1.4.1.4203.666.2.1' + desc = 'OpenLDAP ACI' + + # Register all syntax classes in this module for symbol_name in dir(): syntax_registry.registerSyntaxClass(eval(symbol_name)) diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/opensshlpk.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/opensshlpk.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/opensshlpk.py 2012-05-02 18:27:11.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/opensshlpk.py 2013-06-22 15:38:52.000000000 +0000 @@ -2,8 +2,6 @@ """ web2ldap plugin classes for OpenSSH-LPK (see http://code.google.com/p/openssh-lpk/) - -$Id: opensshlpk.py,v 1.2 2012/05/02 18:27:11 michael Exp $ """ import re @@ -22,6 +20,7 @@ syntax_registry.registerAttrType( SshPublicKey.oid,[ '1.3.6.1.4.1.24552.500.1.1.1.13', # sshPublicKey + '2.16.840.1.113730.3.8.11.31', # ipaSshPubKey ] ) diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/pgpkeysrv.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/pgpkeysrv.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/pgpkeysrv.py 2013-01-12 21:43:59.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/pgpkeysrv.py 2013-06-22 15:38:52.000000000 +0000 @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- """ web2ldap plugin classes for PGP key server - -$Id: pgpkeysrv.py,v 1.7 2013/01/12 21:43:59 michael Exp $ """ import re diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/pilotperson.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/pilotperson.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/pilotperson.py 2009-08-18 23:44:31.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/pilotperson.py 2013-06-22 15:38:52.000000000 +0000 @@ -3,8 +3,6 @@ web2ldap plugin classes for attributes defined for pilotPerson see also RFC1274 - -$Id: pilotperson.py,v 1.4 2009/08/18 23:44:31 michael Exp $ """ from w2lapp.schema.syntaxes import SelectList,syntax_registry diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/pkcschema.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/pkcschema.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/pkcschema.py 2012-12-06 18:38:21.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/pkcschema.py 2013-06-22 15:38:52.000000000 +0000 @@ -4,8 +4,6 @@ See also: http://tools.ietf.org/draft/draft-ietf-pkix-ldap-pkc-schema - -$Id: pkcschema.py,v 1.5 2012/12/06 18:38:21 michael Exp $ """ from w2lapp.schema.syntaxes import DistinguishedName,SelectList,DynamicValueSelectList,syntax_registry diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/posixautogen.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/posixautogen.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/posixautogen.py 2012-12-12 21:11:24.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/posixautogen.py 2013-06-22 15:38:52.000000000 +0000 @@ -3,8 +3,6 @@ Status: Experimental => you have to understand what it internally does when enabling it! - -$Id: posixautogen.py,v 1.7 2012/12/12 21:11:24 michael Exp $ """ import ldap diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/ppolicy.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/ppolicy.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/ppolicy.py 2012-05-26 14:58:42.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/ppolicy.py 2013-07-17 17:07:07.000000000 +0000 @@ -1,15 +1,16 @@ # -*- coding: utf-8 -*- """ web2ldap plugin classes for attributes defined in draft-behera-ldap-password-policy - -$Id: ppolicy.py,v 1.10 2012/05/26 14:58:42 michael Exp $ """ -import pyweblib.forms +import time,datetime,pyweblib.forms,utctime,w2lapp.gui,w2lapp.searchform -from w2lapp.schema.syntaxes import SelectList,DynamicDNSelectList,syntax_registry -from w2lapp.schema.plugins.quirks import UserPassword +from calendar import timegm +from w2lapp.schema.syntaxes import SelectList,DynamicDNSelectList,Timespan,GeneralizedTime,syntax_registry +from w2lapp.schema.plugins.quirks import UserPassword +from ldap.filter import escape_filter_chars +from ldap import LDAPError class PwdCheckQuality(SelectList): oid = 'PwdCheckQuality-oid' @@ -56,6 +57,133 @@ ) +class PwdMaxAge(Timespan): + oid = 'PwdMaxAge-oid' + desc = 'pwdPolicy entry: Maximum age of user password' + link_text = 'Search expired' + title_text = u'Search for entries with this password policy and expired password' + + def _search_timestamp(self,diff_secs): + return unicode(time.strftime('%Y%m%d%H%M%SZ',time.gmtime(time.time()-diff_secs))) + + def _timespan_search_params(self): + return ( + ('search_attr','pwdChangedTime'), + ('search_option',w2lapp.searchform.SEARCH_OPT_LE_THAN), + ('search_string',self._search_timestamp(int(self.attrValue.strip()))), + ) + + def displayValue(self,valueindex=0,commandbutton=0): + ts_dv = Timespan.displayValue(self,valueindex,commandbutton) + # Possibly display a link + ocs = self._entry.object_class_oid_set() + if not commandbutton or not 'pwdPolicy' in ocs: + return ts_dv + try: + ts_search_params = self._timespan_search_params() + except ValueError,KeyError: + return ts_dv + search_link = self._form.applAnchor( + 'searchform',self.link_text,self._sid, + ( + ('dn',self._dn), + ('searchform_mode','adv'), + ('search_attr','pwdPolicySubentry'), + ('search_option',w2lapp.searchform.SEARCH_OPT_IS_EQUAL), + ('search_string',self._dn), + ) + ts_search_params, + title=self.title_text, + ) + return ' '.join((ts_dv,search_link)) + +syntax_registry.registerAttrType( + PwdMaxAge.oid,[ + '1.3.6.1.4.1.42.2.27.8.1.3', # pwdMaxAge + ] +) + + +class PwdExpireWarning(PwdMaxAge): + oid = 'PwdExpireWarning-oid' + desc = 'pwdPolicy entry: Password warning period' + link_text = 'Search soon to expire' + title_text = u'Search for entries with this password policy and soon to expire password' + + def _timespan_search_params(self): + pwd_expire_warning = int(self.attrValue.strip()) + pwd_max_age = int(self._entry['pwdMaxAge'][0].strip()) + warn_timestamp = pwd_max_age-pwd_expire_warning + return ( + ('search_attr','pwdChangedTime'), + ('search_option',w2lapp.searchform.SEARCH_OPT_GE_THAN), + ('search_string',self._search_timestamp(pwd_max_age)), + ('search_attr','pwdChangedTime'), + ('search_option',w2lapp.searchform.SEARCH_OPT_LE_THAN), + ('search_string',self._search_timestamp(warn_timestamp)), + ) + +syntax_registry.registerAttrType( + PwdExpireWarning.oid,[ + '1.3.6.1.4.1.42.2.27.8.1.7', # pwdExpireWarning + ] +) + + +class PwdChangedTime(GeneralizedTime): + oid = 'PwdChangedTime-oid' + desc = 'user entry: Last password change time' + time_divisors = ( + (u'weeks',604800), + (u'days',86400), + (u'hours',3600), + (u'mins',60), + (u'secs',1), + ) + + def displayValue(self,valueindex=0,commandbutton=0): + gt_disp_html = GeneralizedTime.displayValue(self,valueindex,commandbutton) + try: + pwd_changed_timestamp = timegm(utctime.strptime(self.attrValue)) + except ValueError: + return gt_disp_html + try: + pwd_policy_subentry_dn = self._entry['pwdPolicySubentry'][0].decode(self._ls.charset) + except KeyError: + return gt_disp_html + try: + _,pwd_policy_entry = self._ls.readEntry(pwd_policy_subentry_dn,attrtype_list=['pwdMaxAge','pwdExpireWarning'])[0] + except (LDAPError,TypeError,IndexError),e: + return gt_disp_html + try: + pwd_max_age = int(pwd_policy_entry['pwdMaxAge'][0]) + except KeyError: + expire_msg = 'will never expire' + except ValueError: + return gt_disp_html + else: + if pwd_max_age: + current_time = time.time() + expire_timestamp = pwd_changed_timestamp+pwd_max_age + expired_since = current_time - expire_timestamp + expire_msg = '%s %s / %s' % ( + { + True:'expired since', + False:'will expire', + }[expired_since>0], + utctime.strftimeiso8601(time.gmtime(expire_timestamp)), + self._form.utf2display(w2lapp.gui.ts2repr(Timespan.time_divisors,u' ',abs(expired_since))), + ) + else: + expire_msg = 'will never expire' + return '
    '.join((gt_disp_html,expire_msg)) + +syntax_registry.registerAttrType( + PwdChangedTime.oid,[ + '1.3.6.1.4.1.42.2.27.8.1.16', # pwdChangedTime + ] +) + + syntax_registry.registerAttrType( UserPassword.oid,[ '1.3.6.1.4.1.42.2.27.8.1.20', # pwdHistory @@ -63,6 +191,13 @@ ) +syntax_registry.registerAttrType( + Timespan.oid,[ + '1.3.6.1.4.1.42.2.27.8.1.2', # pwdMinAge + ] +) + + # Register all syntax classes in this module for name in dir(): syntax_registry.registerSyntaxClass(eval(name)) diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/quirks.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/quirks.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/quirks.py 2011-11-03 19:44:12.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/quirks.py 2013-09-01 02:01:55.000000000 +0000 @@ -3,13 +3,11 @@ Special syntax and attribute type registrations for enforcing standard-compliant behaviour even if current subschema of a server is errornous or could not be retrieved. - -$Id: quirks.py,v 1.8 2011/11/03 19:44:12 michael Exp $ """ from w2lapp.schema.syntaxes import syntax_registry,OID,RFC822Address, \ JPEGImage,PhotoG3Fax,Audio,Uri,Boolean,PostalAddress, \ - LDAPUrl,Certificate,CACertificate,CertificateRevocationList,UTCTime, \ + LDAPUrl,UTCTime, \ DNSDomain,DomainComponent,CountryString,Binary,DistinguishedName, \ DirectoryString,OctetString @@ -33,7 +31,6 @@ '2.16.840.1.113730.3.1.30', # mgrpRFC822MailMember '2.16.840.1.113730.3.1.47', # mailRoutingAddress '1.2.840.113549.1.9.1', # email, emailAddress, pkcs9email - '2.16.840.1.113678.2.2.2.2.15', # Domino/LDAP: MailAddress ] ) @@ -85,31 +82,6 @@ ) syntax_registry.registerAttrType( - Certificate.oid,[ - '2.5.4.36', # userCertificate - 'userCertificate','userCertificate;binary', - ] -) - -syntax_registry.registerAttrType( - CACertificate.oid,[ - '2.5.4.37', # cACertificate - 'cACertificate','cACertificate;binary', - ] -) - -syntax_registry.registerAttrType( - CertificateRevocationList.oid,[ - '2.5.4.38', # authorityRevocationList - '2.5.4.39', # certificateRevocationList - '2.5.4.53', # deltaRevocationList - 'authorityRevocationList','authorityRevocationList;binary', - 'certificateRevocationList','certificateRevocationList;binary', - 'deltaRevocationList','deltaRevocationList;binary', - ] -) - -syntax_registry.registerAttrType( UTCTime.oid,[ '2.5.18.1', # createTimestamp '2.5.18.2', # modifyTimestamp diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/samba.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/samba.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/samba.py 2013-01-15 17:52:55.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/samba.py 2013-06-22 15:38:52.000000000 +0000 @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- """ web2ldap plugin classes for Samba 3 - -$Id: samba.py,v 1.23 2013/01/15 17:52:55 michael Exp $ """ import ldap,time,string,re,utctime diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/schac.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/schac.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/schac.py 2012-02-29 19:50:16.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/schac.py 2013-06-22 15:38:52.000000000 +0000 @@ -3,8 +3,6 @@ web2ldap plugin classes for attributes defined in SCHAC See http://www.terena.org/activities/tf-emc2/schac.html - -$Id: schac.py,v 1.11 2012/02/29 19:50:16 michael Exp $ """ import re,datetime diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/subentries.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/subentries.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/subentries.py 2012-05-26 14:58:42.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/subentries.py 2013-09-01 00:31:55.000000000 +0000 @@ -1,11 +1,14 @@ # -*- coding: utf-8 -*- """ web2ldap plugin classes for attributes defined for subentries (see RFC 3672) - -$Id: subentries.py,v 1.4 2012/05/26 14:58:42 michael Exp $ """ -from w2lapp.schema.syntaxes import LDAPSyntax,SelectList,syntax_registry +from w2lapp.schema.syntaxes import LDAPSyntax,GSER,SelectList,syntax_registry + + +class SubtreeSpecification(GSER): + oid = '1.3.6.1.4.1.1466.115.121.1.45' + desc = 'SubtreeSpecification' class AdministrativeRole(SelectList): diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/sudoers.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/sudoers.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/sudoers.py 2013-02-08 19:37:02.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/sudoers.py 2013-06-22 15:38:52.000000000 +0000 @@ -2,8 +2,6 @@ """ web2ldap plugin classes for sudo-ldap (see http://www.sudo.ws/sudoers.ldap.man.html) - -$Id: sudoers.py,v 1.1 2013/02/08 19:37:02 michael Exp $ """ diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/vchupwdpolicy.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/vchupwdpolicy.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/vchupwdpolicy.py 2009-08-18 23:44:31.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/vchupwdpolicy.py 2013-06-22 15:38:52.000000000 +0000 @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- """ web2ldap plugin classes for attributes defined in draft-vchu-ldap-pwd-policy - -$Id: vchupwdpolicy.py,v 1.2 2009/08/18 23:44:31 michael Exp $ """ from w2lapp.schema.syntaxes import OnOffFlag,syntax_registry diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/vpim.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/vpim.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/vpim.py 2012-12-12 21:11:24.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/vpim.py 2013-06-22 15:38:52.000000000 +0000 @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- """ web2ldap plugin classes for attributes defined in VPIM (see RFC 4237) - -$Id: vpim.py,v 1.6 2012/12/12 21:11:24 michael Exp $ """ from w2lapp.schema.syntaxes import LDAPSyntax,IA5String,SelectList,RFC822Address,syntax_registry diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/x500dsa.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/x500dsa.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/x500dsa.py 2009-08-18 23:44:31.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/x500dsa.py 2013-06-22 15:38:52.000000000 +0000 @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- """ web2ldap plugin classes for X.500 DSAs - -$Id: x500dsa.py,v 1.2 2009/08/18 23:44:31 michael Exp $ """ from w2lapp.schema.syntaxes import OctetString,syntax_registry diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/x509.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/x509.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/plugins/x509.py 1970-01-01 00:00:00.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/plugins/x509.py 2013-08-31 23:44:39.000000000 +0000 @@ -0,0 +1,207 @@ +# -*- coding: utf-8 -*- +""" +web2ldap plugin classes for +GSER-based LDAP syntaxes defined in +http://tools.ietf.org/html/rfc4523 + +At this time this is mainly a stub module. +Currently untested! +""" + +import mspki.util + +from w2lapp.schema.syntaxes import ASN1Object,Binary,GSER,syntax_registry + +from ldap.dn import explode_dn + + +class CertificateSimpleClass(Binary): + oid = '1.3.6.1.4.1.1466.115.121.1.8' + desc = 'X.509 Certificate' + mimeType = 'application/pkix-cert' + fileExt = 'cer' + + def sanitizeInput(self,attrValue): + try: + return mspki.util.pem2der(attrValue) + except (ValueError,IndexError): + return attrValue + + def getMimeType(self): + if self._form.browser_type in ['Mozilla','Opera']: + return 'application/x-x509-email-cert' + return self.mimeType + + def displayValue(self,valueindex=0,commandbutton=0): + return '%d bytes | %s' % ( + len(self.attrValue), + self._form.applAnchor( + 'read','View/Load',self._sid, + [ + ('dn',self._dn), + ('read_attr',self.attrType), + ('read_attrindex',str(valueindex)), + ('read_attrmode','view'), + ] + ) + ) + + +try: + import M2Crypto +except ImportError: + Certificate = CertificateSimpleClass +else: + + class CertificateM2Class(CertificateSimpleClass): + cert_display_template = """ +
    +
    Issuer:
    +
    {cert_issuer_dn}
    +
    Subject
    +
    {cert_subject_dn}
    +
    Serial No.
    +
    {cert_serial_number_dec} ({cert_serial_number_hex})
    +
    Validity period
    +
    from {cert_not_before} until {cert_not_after}
    +
    + """ + + def displayValue(self,valueindex=0,commandbutton=0): + links_html = CertificateSimpleClass.displayValue(self,valueindex,commandbutton) + try: + x509 = M2Crypto.X509.load_cert_string(self.attrValue,M2Crypto.X509.FORMAT_DER) + except M2Crypto.X509.X509Error: + cert_html = '' + else: + cert_issuer_dn = ','.join( + explode_dn(x509.get_issuer().as_text(flags=M2Crypto.m2.XN_FLAG_RFC2253)) + ).decode('utf-8') + cert_subject_dn = ','.join( + explode_dn(x509.get_subject().as_text(flags=M2Crypto.m2.XN_FLAG_RFC2253)) + ).decode('utf-8') + cert_serial_number = int(x509.get_serial_number()) + try: + cert_not_before = x509.get_not_before().get_datetime() + except (ValueError,NameError): + cert_not_before = 'ValueError' + else: + cert_not_before = cert_not_before.strftime('%Y-%m-%dT%H-%M-%S %Z') + try: + cert_not_after = x509.get_not_after().get_datetime() + except (ValueError,NameError): + cert_not_after = 'ValueError' + else: + cert_not_after = cert_not_after.strftime('%Y-%m-%dT%H-%M-%S %Z') + cert_html = self.cert_display_template.format( + cert_issuer_dn = self._form.utf2display(cert_issuer_dn), + cert_subject_dn = self._form.utf2display(cert_subject_dn), + cert_serial_number_dec = str(cert_serial_number), + cert_serial_number_hex = hex(cert_serial_number), + cert_not_before = cert_not_before, + cert_not_after = cert_not_after, + ) + return ''.join((cert_html,links_html)) + + Certificate = CertificateM2Class + + +class CACertificate(Certificate): + oid = 'CACertificate-oid' + desc = 'X.509 CA Certificate' + mimeType = 'application/x-x509-ca-cert' + + def getMimeType(self): + return self.mimeType + + +class CertificateList(CertificateSimpleClass): + oid = '1.3.6.1.4.1.1466.115.121.1.9' + desc = 'Certificate Revocation List' + mimeType = 'application/pkix-crl' + fileExt = 'crl' + + def getMimeType(self): + if self._form.browser_type in ['Mozilla','Opera']: + return 'application/x-pkcs7-crl' + return self.mimeType + + +class CertificatePair(ASN1Object): + oid = '1.3.6.1.4.1.1466.115.121.1.10' + desc = 'X.509 Certificate Pair' + mimeType = 'application/pkix-cert' + fileExt = 'cer' + + +class SupportedAlgorithm(ASN1Object): + oid = '1.3.6.1.4.1.1466.115.121.1.49' + desc = 'X.509 Supported Algorithm' + + +class X509CertificateExactAssertion(GSER): + oid = '1.3.6.1.1.15.1' + desc = 'X.509 Certificate Exact Assertion' + + +class X509CertificateAssertion(GSER): + oid = '1.3.6.1.1.15.2' + desc = 'X.509 Certificate Assertion' + + +class X509CertificatePairExactAssertion(GSER): + oid = '1.3.6.1.1.15.3' + desc = 'X.509 Certificate Pair Exact Assertion' + + +class X509CertificatePairAssertion(GSER): + oid = '1.3.6.1.1.15.4' + desc = 'X.509 Certificate Pair Assertion' + + +class X509CertificateListExactAssertion(GSER): + oid = '1.3.6.1.1.15.5' + desc = 'X.509 Certificate List Exact Assertion' + + +class X509CertificateListAssertion(GSER): + oid = '1.3.6.1.1.15.6' + desc = 'X.509 Certificate List Assertion' + + +class X509AlgorithmIdentifier(GSER): + oid = '1.3.6.1.1.15.7' + desc = 'X.509 Algorithm Identifier' + + +# Hard-coded registration of some attribute types + +syntax_registry.registerAttrType( + Certificate.oid,[ + '2.5.4.36', # userCertificate + 'userCertificate','userCertificate;binary', + ] +) + +syntax_registry.registerAttrType( + CACertificate.oid,[ + '2.5.4.37', # cACertificate + 'cACertificate','cACertificate;binary', + ] +) + +syntax_registry.registerAttrType( + CertificateList.oid,[ + '2.5.4.38', # authorityRevocationList + '2.5.4.39', # certificateRevocationList + '2.5.4.53', # deltaRevocationList + 'authorityRevocationList','authorityRevocationList;binary', + 'certificateRevocationList','certificateRevocationList;binary', + 'deltaRevocationList','deltaRevocationList;binary', + ] +) + + +# Register all syntax classes in this module +for symbol_name in dir(): + syntax_registry.registerSyntaxClass(eval(symbol_name)) diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/syntaxes.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/syntaxes.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/syntaxes.py 2013-02-16 16:38:07.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/syntaxes.py 2013-08-31 23:44:39.000000000 +0000 @@ -10,11 +10,9 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: syntaxes.py,v 1.285 2013/02/16 16:38:07 michael Exp $ """ -import re,imghdr,sndhdr,urllib,datetime,time,utctime,ldap,ldapurl,pyweblib.forms, \ +import re,imghdr,sndhdr,urllib,uuid,datetime,time,utctime,ldap,ldapurl,pyweblib.forms, \ ldaputil.base,ldap.schema,xml.etree.ElementTree, \ w2lapp.viewer,w2lapp.form,w2lapp.gui,mspki.util,w2lapp.cnf,ldaputil.schema @@ -22,8 +20,6 @@ from ldaputil.base import is_dn -from ldap.dn import explode_dn - try: from netaddr import IPAddress,IPNetwork except ImportError: @@ -112,6 +108,9 @@ fileExt = 'bin' editable = 1 reObj = None + searchSep = '
    ' + readSep = '
    ' + fieldSep = '
    ' def __init__(self,sid,form,ls,dn,schema,attrType,attrValue,entry=None): self.attrType = attrType @@ -248,13 +247,6 @@ ) -class CertificatePair(Binary): - oid = '1.3.6.1.4.1.1466.115.121.1.10' - desc = 'X.509 Certificate Pair' - mimeType = 'application/pkix-cert' - fileExt = 'cer' - - class AttributeCertificate(Binary): oid = '1.3.6.1.4.1.4203.666.11.10.2.1' desc = 'X.509 Attribute Certificate' @@ -262,130 +254,6 @@ fileExt = 'cer' -class CertificateSimpleClass(Binary): - oid = '1.3.6.1.4.1.1466.115.121.1.8' - desc = 'X.509 Certificate' - mimeType = 'application/pkix-cert' - fileExt = 'cer' - pemBeginText = '-----BEGIN CERTIFICATE-----' - pemEndText = '-----END CERTIFICATE-----' - - def sanitizeInput(self,attrValue): - pem_begin_pos = attrValue.find(self.pemBeginText) - if pem_begin_pos>=0: - pem_end_pos = attrValue.find(self.pemEndText,pem_begin_pos+len(self.pemBeginText)) - if pem_end_pos>=0: - return attrValue[pem_begin_pos+len(self.pemBeginText):pem_end_pos].strip().decode('base64') - else: - return attrValue - else: - return attrValue - - def getMimeType(self): - if self._form.browser_type in ['Mozilla','Opera']: - return 'application/x-x509-email-cert' - return self.mimeType - - def displayValue(self,valueindex=0,commandbutton=0): - return '%d bytes | %s' % ( - len(self.attrValue), - self._form.applAnchor( - 'read','View/Load',self._sid, - [ - ('dn',self._dn), - ('read_attr',self.attrType), - ('read_attrindex',str(valueindex)), - ('read_attrmode','view'), - ] - ) - ) - - -try: - import M2Crypto -except ImportError: - Certificate = CertificateSimpleClass -else: - - class CertificateM2Class(CertificateSimpleClass): - cert_display_template = """ -
    -
    Issuer:
    -
    {cert_issuer_dn}
    -
    Subject
    -
    {cert_subject_dn}
    -
    Serial No.
    -
    {cert_serial_number_dec} ({cert_serial_number_hex})
    -
    Validity period
    -
    from {cert_not_before} until {cert_not_after}
    -
    - """ - - def displayValue(self,valueindex=0,commandbutton=0): - links_html = CertificateSimpleClass.displayValue(self,valueindex,commandbutton) - try: - x509 = M2Crypto.X509.load_cert_string(self.attrValue,M2Crypto.X509.FORMAT_DER) - except: - cert_html = '' - raise - else: - cert_issuer_dn = ','.join( - explode_dn(x509.get_issuer().as_text(flags=M2Crypto.m2.XN_FLAG_RFC2253)) - ).decode('utf-8') - cert_subject_dn = ','.join( - explode_dn(x509.get_subject().as_text(flags=M2Crypto.m2.XN_FLAG_RFC2253)) - ).decode('utf-8') - cert_serial_number = int(x509.get_serial_number()) - try: - cert_not_before = x509.get_not_before().get_datetime() - except (ValueError,NameError): - cert_not_before = 'ValueError' - else: - cert_not_before = cert_not_before.strftime('%Y-%m-%dT%H-%M-%S %Z') - try: - cert_not_after = x509.get_not_after().get_datetime() - except (ValueError,NameError): - cert_not_after = 'ValueError' - else: - cert_not_after = cert_not_after.strftime('%Y-%m-%dT%H-%M-%S %Z') - cert_html = self.cert_display_template.format( - cert_issuer_dn = self._form.utf2display(cert_issuer_dn), - cert_subject_dn = self._form.utf2display(cert_subject_dn), - cert_serial_number_dec = str(cert_serial_number), - cert_serial_number_hex = hex(cert_serial_number), - cert_not_before = cert_not_before, - cert_not_after = cert_not_after, - ) - return ''.join((cert_html,links_html)) - - Certificate = CertificateM2Class - - -class CACertificate(Certificate): - oid = 'CACertificate-oid' - desc = 'X.509 CA Certificate' - mimeType = 'application/x-x509-ca-cert' - pemBeginText = '-----BEGIN TRUSTED CERTIFICATE-----' - pemEndText = '-----END TRUSTED CERTIFICATE-----' - - def getMimeType(self): - return self.mimeType - - -class CertificateRevocationList(CertificateSimpleClass): - oid = '1.3.6.1.4.1.1466.115.121.1.9' - desc = 'Certificate Revocation List' - mimeType = 'application/pkix-crl' - fileExt = 'crl' - pemBeginText = '-----BEGIN X509 CRL-----' - pemEndText = '-----END X509 CRL-----' - - def getMimeType(self): - if self._form.browser_type in ['Mozilla','Opera']: - return 'application/x-pkcs7-crl' - return self.mimeType - - class DirectoryString(LDAPSyntax): oid = '1.3.6.1.4.1.1466.115.121.1.15' desc = 'Directory String' @@ -735,7 +603,7 @@ imageFormat = None def _validate(self,attrValue): - return imghdr.test_jpeg(attrValue,None)==self.imageFormat.lower() + return imghdr.what(None,attrValue)==self.imageFormat.lower() def sanitizeInput(self,attrValue): if not self._validate(attrValue) and PILImage: @@ -1110,6 +978,48 @@ return Integer.displayValue(self,valueindex,commandbutton) +class Timespan(Integer): + oid = 'Timespan-oid' + desc = 'Time span in seconds' + time_divisors = ( + (u'weeks',604800), + (u'days',86400), + (u'hours',3600), + (u'mins',60), + (u'secs',1), + ) + sep = u',' + + def sanitizeInput(self,attrValue): + if attrValue: + try: + result = str(w2lapp.gui.repr2ts(self.time_divisors,self.sep,attrValue)) + except ValueError: + result = Integer.sanitizeInput(self,attrValue) + else: + result = attrValue + return result + + def formValue(self): + if not self.attrValue: + return self.attrValue + try: + result = w2lapp.gui.ts2repr(self.time_divisors,self.sep,int(self.attrValue)) + except ValueError: + result = Integer.formValue(self) + return result + + def displayValue(self,valueindex=0,commandbutton=0): + try: + result = self._form.utf2display('%s (%s)' % ( + w2lapp.gui.ts2repr(self.time_divisors,self.sep,int(self.attrValue)), + Integer.displayValue(self,valueindex,commandbutton) + )) + except ValueError: + result = Integer.displayValue(self,valueindex,commandbutton) + return result + + class SelectList(DirectoryString): """ Base class for dictionary based select lists which @@ -1367,7 +1277,7 @@ def _readReferencedEntry(self,dn): try: ldap_result = self._ls.readEntry( - dn, + dn.decode(self._ls.charset), attrtype_list=self.lu_obj.attrs, search_filter=self.lu_obj.filterstr or '(objectClass=*)', ) @@ -1522,11 +1432,22 @@ ) +class GSER(DirectoryString): + oid = 'GSER-oid' + desc = 'GSER syntax (see RFC 3641)' + + class UUID(IA5String): oid = '1.3.6.1.1.16.1' desc = 'UUID' reObj = re.compile('^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$') + def sanitizeInput(self,attrValue): + try: + return str(uuid.UUID(attrValue.replace(':',''))) + except ValueError: + return attrValue + class DNSDomain(IA5String): oid = 'DNSDomain-oid' @@ -1535,7 +1456,7 @@ def sanitizeInput(self,attrValue): return '.'.join([ - dc.encode('idna') + dc.lower().encode('idna') for dc in attrValue.decode(self._form.accept_charset).split(u'.') ]) @@ -1626,9 +1547,11 @@ try: # Try to import optional module pisces from pisces import asn1 + except ImportError: - # Well, silently ignore and don't do anything - pass + # Fall-back class is Binary + ASN1Object = Binary + else: class ASN1Object(Binary): @@ -1655,7 +1578,7 @@ pisces_oid = asn1.OID(tuple(map(int,attrValue.split('.')))) desc = mspki.asn1helper.GetOIDDescription( pisces_oid, - w2lapp.viewer.oids, + mspki.asn1helper.oids, includeoid=1 ) except ValueError: diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/viewer.py web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/viewer.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/schema/viewer.py 2012-12-31 17:04:30.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/schema/viewer.py 2013-06-27 19:46:41.000000000 +0000 @@ -10,8 +10,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: viewer.py,v 1.112 2012/12/31 17:04:30 michael Exp $ """ import types,ldap,msbase,w2lapp.gui @@ -162,7 +160,7 @@ ]) else: value_output = ', '.join(displayNameOrOIDList(sid,form,dn,self.s,class_attr_value_list,se_class)) - outf_lines.append('
    %s
    \n

    \n%s\n

    \n' % (text,value_output)) + outf_lines.append('
    %s
    \n
    \n%s\n
    \n' % (text,value_output)) return outf_lines # displayDetails() def display(self,sid,outf,form,ls,dn): @@ -385,6 +383,20 @@ )) ################################################################### + # Display DIT content rules which reference attributes of this type + ################################################################### + attr_type_ref_list = [] + for oc_oid,object_class_se in self.s.sed[ObjectClass].items(): + object_class_se = self.s.get_obj(ObjectClass,oc_oid) + for dcr_at in object_class_se.must+object_class_se.may: + if dcr_at==at_oid or dcr_at in self.sei.names: + attr_type_ref_list.append(oc_oid) + if attr_type_ref_list: + outf_lines.append('
    Directly referencing object classes:
    \n
    \n%s\n
    \n' % ( + ', '.join(displayNameOrOIDList(sid,form,dn,self.s,attr_type_ref_list,ObjectClass)) + )) + + ################################################################### # Display object classes which may contain attributes of this type ################################################################### all_object_classes = self.s.sed[ObjectClass].keys() @@ -394,10 +406,24 @@ if must.has_key(at_oid) or may.has_key(at_oid): attr_type_ref_list.append(oc_oid) if attr_type_ref_list: - outf_lines.append('
    Referencing object classes:
    \n
    \n%s\n
    \n' % ( + outf_lines.append('
    Usable in these object classes:
    \n
    \n%s\n
    \n' % ( ', '.join(displayNameOrOIDList(sid,form,dn,self.s,attr_type_ref_list,ObjectClass)) )) + ################################################################### + # Display DIT content rules which reference attributes of this type + ################################################################### + attr_type_ref_list = [] + for dcr_oid,dit_content_rule_se in self.s.sed[DITContentRule].items(): + dit_content_rule_se = self.s.get_obj(DITContentRule,dcr_oid) + for dcr_at in dit_content_rule_se.must+dit_content_rule_se.may+dit_content_rule_se.nots: + if dcr_at==at_oid or dcr_at in self.sei.names: + attr_type_ref_list.append(dcr_oid) + if attr_type_ref_list: + outf_lines.append('
    Referencing DIT content rules:
    \n
    \n%s\n
    \n' % ( + ', '.join(displayNameOrOIDList(sid,form,dn,self.s,attr_type_ref_list,DITContentRule)) + )) + ######################################################################## # Display name forms which uses this attribute type for naming an entry ######################################################################## @@ -642,20 +668,22 @@ def OIDInputForm(form,sid,dn,oid=None): + oid_input_field_html = w2lapp.form.OIDInput( + 'oid', + u'OID or descriptive name of schema element', + default=oid + ).inputHTML(oid) + oid_class_select_html = form.field['oid_class'].inputHTML('') return form.formHTML( 'oid','Search',sid,'GET', [('dn',dn)], - extrastr=w2lapp.form.OIDInput( - 'oid', - u'OID or descriptive name of schema element', - default=oid - ).inputHTML(oid) + extrastr='\n'.join((oid_input_field_html,oid_class_select_html)), ) def DisplayAllSchemaelements(sid,outf,form,ls,dn,schema,se_classes,se_list): se_list = se_list or [] - se_classes = filter(None,se_classes or []) + se_classes = filter(None,se_classes or []) or SCHEMA_CLASS_MAPPING.values() w2lapp.gui.TopSection( sid,outf,form,ls,dn,'Schema elements', @@ -690,9 +718,11 @@ schema_elements = oid_dict[schema_class] if not schema_elements: continue - outf.write('

    %s

    \n' % (SCHEMA_VIEWER_CLASS[schema_class].type_desc)) - outf.write('

    found %d

    \n' % (len(schema_elements))) - outf.write(', '.join(displayNameOrOIDList(sid,form,dn,schema,schema_elements,schema_class))) + outf.write('

    %s

    \n

    found %d

    \n%s\n' % ( + SCHEMA_VIEWER_CLASS[schema_class].type_desc, + len(schema_elements), + ',\n '.join(displayNameOrOIDList(sid,form,dn,schema,schema_elements,schema_class)), + )) else: outf.write("""

    Hints:

      @@ -720,11 +750,15 @@ # Get input parameter from form input oid = form.getInputValue('oid',[None])[0] - se_class = SCHEMA_CLASS_MAPPING.get(form.getInputValue('oid_class',[''])[0].strip(),None) + se_classes = [ + SCHEMA_CLASS_MAPPING[se_name.strip()] + for se_name in form.getInputValue('oid_class',[]) + if se_name + ] - if oid is None: + if not oid or oid=='*': # Display entry page of schema browser - DisplayAllSchemaelements(sid,outf,form,ls,dn,sub_schema,[se_class],None) + DisplayAllSchemaelements(sid,outf,form,ls,dn,sub_schema,se_classes,None) return else: @@ -747,21 +781,21 @@ else: cmp_method = None - if se_class and cmp_method is None: + if len(se_classes)==1 and cmp_method is None: # Display a single schema element referenced by OID and class - se_list = [sub_schema.get_obj(se_class,oid,None)] + se_list = [sub_schema.get_obj(se_classes[0],oid,None)] else: # Search schema element by OID se_list = [] if cmp_method is None: # No wildcard search => just try to look up directly via name or OID - for schema_element_type in SCHEMA_VIEWER_CLASS.keys(): + for schema_element_type in se_classes or SCHEMA_VIEWER_CLASS.keys(): se = sub_schema.get_obj(schema_element_type,oid,None) if not se is None: se_list.append(se) else: # Do a wildcard search - for schema_element_type in SCHEMA_VIEWER_CLASS.keys(): + for schema_element_type in se_classes or SCHEMA_VIEWER_CLASS.keys(): for se in sub_schema.sed[schema_element_type].values(): try: se_id = se.oid diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/search.py web2ldap-1.1.43~dfsg/pylib/w2lapp/search.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/search.py 2013-01-02 17:47:47.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/search.py 2013-07-16 20:21:32.000000000 +0000 @@ -10,8 +10,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: search.py,v 1.221 2013/01/02 17:47:47 michael Exp $ """ import time,csv,urllib,ldap,ldap.schema.models,ldap.async,dsml, \ @@ -20,9 +18,14 @@ from ldapurl import LDAPUrl +from ldaputil.base import escape_ldap_filter_chars from msbase import GrabKeys from w2lapp.schema.syntaxes import syntax_registry from ldaputil.controls import SearchNoOpControl +from types import StringType,UnicodeType +from ldapsession import LDAPLimitErrors + +SEARCH_NOOP_TIMEOUT = 5.0 SizeLimitMsg = """

      @@ -39,6 +42,7 @@ ldap.RES_SEARCH_REFERENCE:None } + class excel_semicolon(csv.excel): """Describe the usual properties of Excel-generated TAB-delimited files.""" delimiter = ';' @@ -166,76 +170,78 @@ sid,outf,command,form,ls,dn, searchform_mode='adv', Msg='', - filterstr='', - scope=ldap.SCOPE_SUBTREE + filterstr=u'', + scope=scope ) return # This should speed up things utf2display = form.utf2display - # Hmm, this retrieves sub schema sub entry for the search root. - # Theoretically it could be different for all search results. - # But what the hey... - sub_schema = ls.retrieveSubSchema(dn,w2lapp.cnf.GetParam(ls,'_schema',None)) - search_output = form.getInputValue('search_output',['table'])[0] search_opattrs = form.getInputValue('search_opattrs',['no'])[0]=='yes' search_root = form.getInputValue('search_root',[dn])[0] + # Hmm, this retrieves sub schema sub entry for the search root. + # Theoretically it could be different for all search results. + # But what the hey... + sub_schema = ls.retrieveSubSchema(search_root,w2lapp.cnf.GetParam(ls,'_schema',None)) + if scope==None: scope = ldap.SCOPE_SUBTREE + search_filter = form.getInputValue('filterstr',[filterstr]) + if ('search_option' in form.inputFieldNames) and \ ('search_attr' in form.inputFieldNames) and \ ('search_string' in form.inputFieldNames): search_mode = form.getInputValue('search_mode',[ur'(&%s)'])[0] search_option = form.getInputValue('search_option',[]) search_attr = form.getInputValue('search_attr',[]) + search_mr = form.getInputValue('search_mr',[None]*len(search_attr)) search_string = form.getInputValue('search_string',[]) - if (len(search_option)==len(search_attr)==len(search_string)): + if (len(search_option)==len(search_attr)==len(search_mr)==len(search_string)): # Get search mode # Build LDAP search filter from input data of advanced search form - search_filter = [] - for i in range(len(form.field['search_option'].value)): - search_string,search_option,search_attr = \ - form.field['search_string'].value[i], \ - form.field['search_option'].value[i], \ - form.field['search_attr'].value[i] - if search_option==r'(%s=*)': - search_filter.append(search_option % (search_attr)) - elif search_string: - for attr_type in search_attr.split(','): - if not '*' in search_option: - # If an exact assertion value is needed we can normalize via plugin class - attr_instance = syntax_registry.attrInstance(None,form,ls,dn,sub_schema,attr_type,None,entry=None) - search_string = attr_instance.sanitizeInput(search_string) - search_filter.append(search_option % ( - attr_type,ldap.filter.escape_filter_chars(search_string) - )) - if len(search_filter)==1: - filterstr = u''.join(search_filter) - elif len(search_filter)>1: - filterstr = search_mode % (u''.join(search_filter)) - else: - w2lapp.searchform.w2l_SearchForm( - sid,outf,command,form,ls,dn, - searchform_mode='adv', - Msg='Empty search form data.', - filterstr='', - scope=ldap.SCOPE_SUBTREE - ) - return + for i in range(len(search_attr)): + if search_option[i]==w2lapp.searchform.SEARCH_OPT_EXISTS: + search_filter.append(search_option.format(at=search_attr[i])) + elif search_string[i]: + if not '*' in search_option[i]: + # If an exact assertion value is needed we can normalize via plugin class + attr_instance = syntax_registry.attrInstance( + None,form,ls,dn,sub_schema,search_attr[i],None,entry=None + ) + search_string[i] = attr_instance.sanitizeInput(search_string[i]) + if search_mr[i]: + search_mr_string = ':%s:' % (search_mr[i]) + else: + search_mr_string = '' + search_filter.append(search_option[i] % ( + ''.join((search_attr[i],search_mr_string)), + escape_ldap_filter_chars(search_string[i]) + )) else: raise w2lapp.core.ErrorExit(u'Invalid search form data.') - else: - filterstr = form.getInputValue( - 'filterstr',[filterstr or u'(objectClass=*)'] - )[0] - search_resminindex = int( - form.getInputValue('search_resminindex',['0'])[0] - ) + # Wipe out all nullable search_filter list items + search_filter = filter(None,search_filter) + + if not search_filter: + w2lapp.searchform.w2l_SearchForm( + sid,outf,command,form,ls,dn, + searchform_mode={True:'adv',False:'exp'}['search_attr' in form.inputFieldNames], + Msg='Empty search values.', + filterstr=u'', + scope=scope + ) + return + elif len(search_filter)==1: + filterstr = search_filter[0] + elif len(search_filter)>1: + filterstr = search_mode % (u''.join(search_filter)) + + search_resminindex = int(form.getInputValue('search_resminindex',['0'])[0]) search_resnumber = int( form.getInputValue( 'search_resnumber', @@ -370,7 +376,10 @@ # Give the user a chance to edit his bad search filter w2lapp.searchform.w2l_SearchForm( sid,outf,command,form,ls,dn,searchform_mode='exp', - Msg=w2lapp.gui.LDAPError2ErrMsg(e,form,charset=ls.charset), + Msg=' '.join(( + w2lapp.gui.LDAPError2ErrMsg(e,form,charset=ls.charset), + form.utf2display(filterstr2), + )), filterstr=filterstr, scope=scope ) @@ -396,21 +405,15 @@ # Retrieve the overall number of search results by resending the # search request without size limit but with the SearchNoOpControl attached if SearchNoOpControl.controlType in ls.rootDSE.get('supportedControl',[]): - msg_id = ls.l.search_ext( - search_root.encode(ls.charset), - scope, - filterstr=filterstr2.encode(ls.charset), - attrlist=['1.1'], - serverctrls=[SearchNoOpControl()], - ) - _,_,_,search_response_ctrls = ls.l.result3(msg_id,all=1) - noop_srch_ctrl = [ - c - for c in search_response_ctrls - if c.controlType==SearchNoOpControl.controlType - ] - if noop_srch_ctrl: - _,num_all_search_results,num_all_search_continuations = noop_srch_ctrl[0].resultCode,noop_srch_ctrl[0].numSearchResults,noop_srch_ctrl[0].numSearchContinuations + try: + num_all_search_results,num_all_search_continuations = ls.l.noop_search_st( + search_root.encode(ls.charset), + scope, + filterstr=filterstr2.encode(ls.charset), + timeout=SEARCH_NOOP_TIMEOUT, + ) + except LDAPLimitErrors,e: + pass except (ldap.FILTER_ERROR,ldap.INAPPROPRIATE_MATCHING),e: # Give the user a chance to edit his bad search filter w2lapp.searchform.w2l_SearchForm( @@ -695,14 +698,7 @@ tableentry_attrs = template_attrs.intersection(entry.data.keys()) if tableentry_attrs: # Output entry with the help of pre-defined templates - tableentry = msbase.CaseinsensitiveStringKeyDict(default='') - for attr in tableentry_attrs: - tableentry[attr] = [] - for value in entry[attr]: - tableentry[attr].append( - w2lapp.gui.DataStr(sid,form,ls,dn,sub_schema,attr,value,commandbutton=0) - ) - tableentry[attr] = ', '.join(tableentry[attr]) + tableentry = w2lapp.read.DisplayEntry(sid,form,ls,dn,sub_schema,entry,'searchSep',0) tdlist = [] for oc in tdtemplate_oc: tdlist.append(search_tdtemplate[oc] % tableentry) @@ -775,8 +771,12 @@ command_table.append(form.applAnchor( 'search','Down',sid, - [('dn',dn),('scope',str(ldap.SCOPE_ONELEVEL))], - title=u'\r\n'.join(down_title_list) + ( + ('dn',dn), + ('scope',w2lapp.searchform.SEARCH_SCOPE_STR_ONELEVEL), + ('filterstr',u'(objectClass=*)'), + ), + title=u'\r\n'.join(down_title_list), )) else: diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/searchform.py web2ldap-1.1.43~dfsg/pylib/w2lapp/searchform.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/searchform.py 2012-04-07 13:51:58.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/searchform.py 2013-08-27 20:52:51.000000000 +0000 @@ -10,8 +10,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: searchform.py,v 1.62 2012/04/07 13:51:58 michael Exp $ """ import types,ldap,pyweblib.forms,w2lapp.core,w2lapp.gui,w2lapp.cnf @@ -22,33 +20,48 @@ 'exp':'Expert', } +SEARCH_OPT_CONTAINS = ur'(%s=*%s*)' +SEARCH_OPT_EXISTS = ur'(%s=*)' +SEARCH_OPT_DOESNT_CONTAIN = ur'(!(%s=*%s*))' +SEARCH_OPT_IS_EQUAL = ur'(%s=%s)' +SEARCH_OPT_IS_NOT = ur'(!(%s=%s))' +SEARCH_OPT_BEGINS_WITH = ur'(%s=%s*)' +SEARCH_OPT_ENDS_WITH = ur'(%s=*%s)' +SEARCH_OPT_SOUNDS_LIKE = ur'(%s~=%s)' +SEARCH_OPT_GE_THAN = ur'(%s>=%s)' +SEARCH_OPT_LE_THAN = ur'(%s<=%s)' + search_options = ( - (r'(%s=*%s*)',u'contains'), - (r'(%s=*)',u'exists'), - (r'(!(%s=*%s*))',u"doesn't contain"), - (r'(%s=%s)',u'is'), - (r'(!(%s=%s))',u'is not'), - (r'(%s=%s*)',u'begins with'), - (r'(%s=*%s)',u'ends with'), - (r'(%s~=%s)',u'sounds like'), - (r'(%s>=%s)',u'greater equal than'), - (r'(%s<=%s)',u'lesser equal than') + (SEARCH_OPT_CONTAINS,u'contains'), + (SEARCH_OPT_EXISTS,u'exists'), + (SEARCH_OPT_DOESNT_CONTAIN,u"doesn't contain"), + (SEARCH_OPT_IS_EQUAL,u'is'), + (SEARCH_OPT_IS_NOT,u'is not'), + (SEARCH_OPT_BEGINS_WITH,u'begins with'), + (SEARCH_OPT_ENDS_WITH,u'ends with'), + (SEARCH_OPT_SOUNDS_LIKE,u'sounds like'), + (SEARCH_OPT_GE_THAN,u'greater equal than'), + (SEARCH_OPT_LE_THAN,u'lesser equal than') ) +SEARCH_SCOPE_STR_BASE = u'0' +SEARCH_SCOPE_STR_ONELEVEL = u'1' +SEARCH_SCOPE_STR_SUBTREE = u'2' + +SEARCH_SCOPE_OPTIONS = ( + (SEARCH_SCOPE_STR_BASE,u'Base'), + (SEARCH_SCOPE_STR_ONELEVEL,u'One level'), + (SEARCH_SCOPE_STR_SUBTREE,u'Sub tree'), +) -def SearchForm_exp(sid,outf,command,form,ls,dn,sub_schema,Msg,filterstr=''): +def SearchForm_exp(sid,outf,command,form,ls,dn,sub_schema,filterstr=''): """Output expert search form""" # expert search form for using LDAP filters filterstr = form.getInputValue('filterstr',[filterstr])[0] result = """

      - Search filter parameters -
      -
      LDAP filter string
      -
      - -
      -
      + LDAP filter string +
      """ % ( w2lapp.cnf.GetParam(ls,'searchform_filterstr_size',90), @@ -57,7 +70,7 @@ return result # SearchForm_exp() -def SearchForm_base(sid,outf,command,form,ls,dn,sub_schema,Msg): +def SearchForm_base(sid,outf,command,form,ls,dn,sub_schema): """ Output basic search form based on a HTML template configured with host-specific configuration parameter searchform_template @@ -71,26 +84,32 @@ return template_str # SearchForm_base() -def SearchForm_adv(sid,outf,command,form,ls,dn,sub_schema,Msg): +def SearchForm_adv(sid,outf,command,form,ls,dn,sub_schema): """advanced search form with select lists""" - search_submit = form.getInputValue('search_submit',[u'Search'])[0] + search_submit = form.getInputValue('search_submit',[u''])[0] - old_rows = int(form.getInputValue('search_params',['1'])[0]) - rows = old_rows + {'More':1,'Fewer':-1}.get(search_submit,0) - # Enforce upper/lower bounds - rows = min(max(1,rows),w2lapp.cnf.misc.max_searchparams) - - # More and Fewer-Buttons - if rows1: - fewer_button = '' - else: - fewer_button = '' + if not len(search_option_list)==len(search_attr_list)==len(search_string_list): + raise w2lapp.core.ErrorExit(u'Invalid search form data.') search_mode = form.getInputValue('search_mode',[ur'(&%s)'])[0] @@ -101,63 +120,74 @@ default=search_mode ) search_mode_select.setCharset(form.accept_charset) - search_attrs = [ - unicode(attr_type) - for attr_type in w2lapp.cnf.GetParam(ls,'search_attrs',('cn','mail','uid','o')) - ] - search_option_list = form.getInputValue('search_option',[]) - search_attr_list = form.getInputValue('search_attr',[]) - search_string_list = form.getInputValue('search_string',[]) + mr_list = [u''] + mr_list.extend(sorted([unicode(mr) for mr in sub_schema.name2oid[ldap.schema.MatchingRule].keys()])) search_attr_options = [] - for attr_type in search_attrs: + for attr_type in w2lapp.cnf.GetParam(ls,'search_attrs',[]) or sub_schema.sed[ldap.schema.AttributeType].keys(): attr_type_se = sub_schema.get_obj(ldap.schema.AttributeType,attr_type) - if attr_type_se and attr_type_se.desc: - search_attr_options.append((attr_type,attr_type,attr_type_se.desc)) + if attr_type_se: + if attr_type_se.names: + attr_type_name = unicode(attr_type_se.names[0],ls.charset) + else: + attr_type_name = unicode(attr_type) + if attr_type_se.desc: + attr_type_desc = unicode(attr_type_se.desc,ls.charset) + else: + attr_type_desc = None + search_attr_options.append(( + attr_type_name, + attr_type_name, + attr_type_desc + )) else: search_attr_options.append((attr_type,attr_type,None)) search_attr_options.sort() + search_attrs = [ attr_type for attr_type,_,_ in search_attr_options ] + # Create a select field instance for attribute type name search_attr_select = pyweblib.forms.Select( 'search_attr',u'Search attribute type', w2lapp.cnf.misc.max_searchparams, - options=search_attr_options + options=sorted(list(set(search_attr_options+filter(None,search_attr_list)))), ) search_attr_select.setCharset(form.accept_charset) + # Create a select field instance for matching rule name + search_mr_select = pyweblib.forms.Select( + 'search_mr',u'Search attribute type', + w2lapp.cnf.misc.max_searchparams, + options=mr_list, + ) + search_mr_select.setCharset(form.accept_charset) + search_fields_html_list = [] # Output a row of the search form - for i in range(rows): - try: - search_attr_default = search_attr_list[i] - search_option_default = search_option_list[i] - search_string_default = search_string_list[i] - except IndexError: - search_attr_default = search_attrs[i % len(search_attrs)] - search_option_default = u'' - search_string_default = u'' + for i in range(len(search_attr_list)): search_fields_html_list.append('\n'.join(( - search_attr_select.inputHTML(default=search_attr_default).encode('ascii'), - form.field['search_option'].inputHTML(default=search_option_default), - form.field['search_string'].inputHTML(default=search_string_default), - '
      ' + '\n', + '' % (i), + '' % (i), + '\n', + search_attr_select.inputHTML(default=search_attr_list[i]), + search_mr_select.inputHTML(default=search_mr_list[i]), + form.field['search_option'].inputHTML(default=search_option_list[i]), + '\n', + form.field['search_string'].inputHTML(default=search_string_list[i]), + '', ))) # Eigentliches Suchformular ausgeben result = """ - %s
      Search filter parameters -

      %s %s search parameters

      Match %s of the following.
      - %s + %s
      """ % ( - form.hiddenFieldHTML('search_params',unicode(rows),u''), - more_button,fewer_button, search_mode_select.inputHTML(), '\n'.join(search_fields_html_list), ) @@ -183,7 +213,11 @@ searchform_mode = form.getInputValue('searchform_mode',[searchform_mode])[0] search_root = form.getInputValue('search_root',[search_root or ls.getSearchRoot(dn)])[0] - search_root_field = w2lapp.gui.SearchRootField(form,ls,dn,name='search_root') + search_root_field = w2lapp.gui.SearchRootField( + form,ls,dn, + name='search_root', + search_root_searchurl=w2lapp.cnf.GetParam(ls,'searchform_search_root_url',None) + ) search_root_field.setDefault(search_root) ContextMenuList = [ @@ -219,13 +253,20 @@ if searchform_mode == 'base': # base search form with fixed input fields - inner_searchform_html = SearchForm_base(sid,outf,command,form,ls,dn,sub_schema,Msg) + try: + inner_searchform_html = SearchForm_base(sid,outf,command,form,ls,dn,sub_schema) + except IOError: + msg_html = '\n'.join(( + msg_html, + '

      I/O error while loading search form template!

      ' + )) + inner_searchform_html = SearchForm_adv(sid,outf,command,form,ls,dn,sub_schema) elif searchform_mode == 'exp': # expert search form with single filter input field - inner_searchform_html = SearchForm_exp(sid,outf,command,form,ls,dn,sub_schema,Msg,filterstr) + inner_searchform_html = SearchForm_exp(sid,outf,command,form,ls,dn,sub_schema,filterstr) elif searchform_mode == 'adv': # base search form with fixed input fields - inner_searchform_html = SearchForm_adv(sid,outf,command,form,ls,dn,sub_schema,Msg) + inner_searchform_html = SearchForm_adv(sid,outf,command,form,ls,dn,sub_schema) searchoptions_template_filename = w2lapp.gui.GetVariantFilename( w2lapp.cnf.GetParam(ls,'searchoptions_template',None), @@ -241,31 +282,36 @@ ) outf.write(""" -
      - %s +
      + {msg_html} + {form_search_html}

      - %s - %s - %s - %s - + {inner_searchform_html} + {form_dn_html} + {searchoptions_template_str} +
      - """ % ( - form.beginFormHTML('search',sid,'GET'), - msg_html, - inner_searchform_html, - form.hiddenFieldHTML('dn',dn,u''), - searchoptions_template_str.format( + """.format( + form_search_html=form.beginFormHTML('search',sid,'GET'), + msg_html=msg_html, + inner_searchform_html=inner_searchform_html, + form_dn_html=form.hiddenFieldHTML('dn',dn,u''), + searchoptions_template_str=searchoptions_template_str.format( search_root_field.inputHTML(), - form.field['scope'].inputHTML(default=form.getInputValue('scope',[unicode(scope)])[0]), - form.field['search_resnumber'].inputHTML(default=unicode(w2lapp.cnf.GetParam(ls,'search_resultsperpage',10))), - form.field['search_lastmod'].inputHTML(default=form.getInputValue('search_lastmod',[unicode(-1)])[0]), + form.field['scope'].inputHTML( + default=form.getInputValue('scope',[unicode(scope)])[0] + ), + form.field['search_resnumber'].inputHTML( + default=unicode(w2lapp.cnf.GetParam(ls,'search_resultsperpage',10)) + ), + form.field['search_lastmod'].inputHTML( + default=form.getInputValue('search_lastmod',[unicode(-1)])[0] + ), form.utf2display(form.getInputValue('search_attrs',[''])[0]), ), )) w2lapp.gui.PrintFooter(outf,form) - diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/session.py web2ldap-1.1.43~dfsg/pylib/w2lapp/session.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/session.py 2010-12-20 08:24:08.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/session.py 2013-06-22 15:38:52.000000000 +0000 @@ -10,8 +10,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: session.py,v 1.6 2010/12/20 08:24:08 michael Exp $ """ import sys,time,\ diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/srvrr.py web2ldap-1.1.43~dfsg/pylib/w2lapp/srvrr.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/srvrr.py 2011-05-18 09:22:19.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/srvrr.py 2013-06-22 15:38:52.000000000 +0000 @@ -10,8 +10,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: srvrr.py,v 1.7 2011/05/18 09:22:19 michael Exp $ """ import pyweblib.forms,w2lapp.gui diff -Nru web2ldap-1.1.31~dfsg/pylib/w2lapp/viewer.py web2ldap-1.1.43~dfsg/pylib/w2lapp/viewer.py --- web2ldap-1.1.31~dfsg/pylib/w2lapp/viewer.py 2013-02-05 20:12:26.000000000 +0000 +++ web2ldap-1.1.43~dfsg/pylib/w2lapp/viewer.py 2013-08-31 23:44:39.000000000 +0000 @@ -10,8 +10,6 @@ This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) - -$Id: viewer.py,v 1.47 2013/02/05 20:12:26 michael Exp $ """ import hashlib,binascii,sndhdr, \ @@ -85,13 +83,15 @@ except ImportError: try: - import M2Crypto + import M2Crypto,M2Crypto.X509 except ImportError: CRLDisplayer = None CertificateDisplayer = None else: + CertificateParserError = M2Crypto.X509.X509Error + class M2CertificateDisplayer: def __init__(self,buf): @@ -117,11 +117,14 @@ else: +# CertificateParserError = ValueError + CertificateParserError = None + # Get OID dictionary try: - oids = asn1helper.ParseCfg(w2lapp.cnf.misc.dumpasn1cfg) + asn1helper.oids = asn1helper.ParseCfg(w2lapp.cnf.misc.dumpasn1cfg) except IOError: - oids = {} + asn1helper.oids = {} class PiscesCRLDisplayer(x509v3.CRL): @@ -153,24 +156,6 @@ ), ] ) - - revokedCertificates = self.revokedCertificates() - if revokedCertificates: - revokedCertificates_str = """ - - %s -
      Serial NumberRevocation date
      - """ % '\n'.join( - [ - '%d%s\n' % ( - i[0],i[1] - ) - for i in revokedCertificates - ] - ) - else: - revokedCertificates_str = '

      No revoked certificates.

      ' - # Get the extensions as string-keyed dict but with # numeric string representation of OIDs extensions = self.crlExtensions() @@ -189,32 +174,53 @@ ) ) else: - extensions_html_list = ['No extensions.'] + extensions_html_list = ['No CRL extensions.'] + # Display a table of revoked certificates + revokedCertificates = self.revokedCertificates() + if revokedCertificates: + revokedCertificates_tr_items = [] + for i in revokedCertificates: + userCertificate,revocationDate,crlEntryExtensions = i + if crlEntryExtensions!=None: + crlEntryExtensions_html = x509v3.htmlize(crlEntryExtensions) + else: + crlEntryExtensions_html = '' + revokedCertificates_tr_items.append( + '%d%s%s\n' % ( + userCertificate,revocationDate,crlEntryExtensions_html + ) + ) + revokedCertificates_str = """ + + %s +
      Serial NumberRevocation dateExtensions
      + """ % ('\n'.join(revokedCertificates_tr_items)) + else: + revokedCertificates_str = '

      No revoked certificates.

      ' outf.write(""" +

      X.509 CRL attributes

      -
      This CRL was issued by:
      +
      This CRL was issued by:
      %s
      -
      CRL Version:
      +
      CRL Version:
      %d
      -
      This CRL is valid from %s until %s.
      -
      Signature Algorithm:
      -
      %s
      -
      Revoked certificates: %d
      +
      This CRL is valid from %s until %s.
      +
      Signature Algorithm:
      %s
      - CRL extensions:
      -
      - %s -
      +

      X.509v3 CRL extensions

      + %s +

      %d revoked certificates

      + %s """ % ( - self.issuer().__html__(oids,form.accept_charset), + self.issuer().html(asn1helper.oids,form.accept_charset), self.version(), self.thisUpdate(), self.nextUpdate(), - asn1helper.GetOIDDescription(self.signatureAlgorithm(),oids), + asn1helper.GetOIDDescription(self.signatureAlgorithm(),asn1helper.oids), + '\n'.join(extensions_html_list), len(revokedCertificates), revokedCertificates_str, - '\n'.join(extensions_html_list), )) @@ -269,7 +275,7 @@ '
      %s (%s)
      %s
      ' % ( e.extnValue.__class__.__name__, str(e.extnId), - e.extnValue.__html__(nsBaseUrl,hex(self.serialNumber())[2:-1]) + e.extnValue.html(nsBaseUrl,hex(self.serialNumber())[2:-1]) ) ) else: @@ -284,36 +290,24 @@ extensions_html_list = ['No extensions.'] outf.write(""" - - - - - - - - -
      +

      X.509 certificate attributes:

      -
      This certificate belongs to:
      +
      This certificate belongs to:
      %s
      -
      -
      -
      -
      This certificate was issued by:
      +
      This certificate was issued by:
      %s
      -
      -
      -
      -
      Certificate Version:
      +
      Certificate Version:
      %d
      -
      Serial Number:
      +
      Serial Number:
      %s
      -
      Validity Period:
      +
      Validity Period:
      not before
      %s
      not after
      %s
      -
      Fingerprint:
      +
      Fingerprint:
      MD5
      %s
      @@ -321,19 +315,16 @@
      SHA-256
      %s
      -
      Signature Algorithm:
      +
      Signature Algorithm:
      %s
      - X.509v3 certificate extensions: +

      X.509v3 certificate extensions:

      %s
      -
      """ % ( - self.subject().__html__(oids,form.accept_charset), - self.issuer().__html__(oids,form.accept_charset), + self.subject().html(asn1helper.oids,form.accept_charset), + self.issuer().html(asn1helper.oids,form.accept_charset), self.version(), self.serialNumber(), notBefore, @@ -341,7 +332,7 @@ self.fingerprint('md5'), self.fingerprint('sha1'), self.fingerprint('sha256'), - asn1helper.GetOIDDescription(self.signatureAlgorithm(),oids), + asn1helper.GetOIDDescription(self.signatureAlgorithm(),asn1helper.oids), '\n'.join(extensions_html_list), )) @@ -349,28 +340,41 @@ CertificateDisplayer = PiscesCertificateDisplayer -def DisplayX509Certificate_base64(sid,outf,command,form,dn,attr,entry,index=None): +def DisplayX509Certificate(sid,outf,command,form,dn,attr,entry,index=None): """Display a base64-encoded X.509 certificate attribute""" - outf.write('

      %s

      ' % (attr)) - for index in range(len(entry[attr])): - CertificateDisplayer(x509_prep(entry[attr][index])).htmlDetailView( - sid,outf,form,dn,attr,index, - ) - return None + outf.write('

      %s

      ' % (unicode(attr,'ascii'))) + attr_value_count = len(entry[attr]) + for i in range(attr_value_count): + if attr_value_count>1: + outf.write('

      %d. / %d

      ' % (i+1,attr_value_count)) + try: + CertificateDisplayer(x509_prep(entry[attr][i])).htmlDetailView( + sid,outf,form,dn,attr,index, + ) + except CertificateParserError: + outf.write('

      Error parsing certificate.

      ') + return # DisplayX509Certificate() -def DisplayCRL_base64(sid,outf,command,form,dn,attr,entry,index=None): +def DisplayCRL(sid,outf,command,form,dn,attr,entry,index=None): """Display a base64-encoded CRL attribute""" - outf.write('

      %s

      ' % (attr)) - for i in range(len(entry[attr])): - CRLDisplayer(x509_prep(entry[attr][index])).htmlDetailView( - sid,outf,form,dn,attr,i, - ) - return None + outf.write('

      %s

      ' % (unicode(attr,'ascii'))) + attr_value_count = len(entry[attr]) + for i in range(attr_value_count): + if attr_value_count>1: + outf.write('

      %d. / %d

      ' % (i+1,attr_value_count)) + try: + CRLDisplayer(x509_prep(entry[attr][index])).htmlDetailView( + sid,outf,form,dn,attr,i, + ) + except CertificateParserError: + outf.write('

      Error parsing CRL.

      ') + return # DisplayCRL() + # register viewer functions by syntax OID if CertificateDisplayer: - viewer_func['1.3.6.1.4.1.1466.115.121.1.8'] = DisplayX509Certificate_base64 - viewer_func['CACertificate-oid'] = DisplayX509Certificate_base64 + viewer_func['1.3.6.1.4.1.1466.115.121.1.8'] = DisplayX509Certificate + viewer_func['CACertificate-oid'] = DisplayX509Certificate if CRLDisplayer: - viewer_func['1.3.6.1.4.1.1466.115.121.1.9'] = DisplayCRL_base64 + viewer_func['1.3.6.1.4.1.1466.115.121.1.9'] = DisplayCRL diff -Nru web2ldap-1.1.31~dfsg/sbin/checkinst.py web2ldap-1.1.43~dfsg/sbin/checkinst.py --- web2ldap-1.1.31~dfsg/sbin/checkinst.py 2012-12-21 16:56:00.000000000 +0000 +++ web2ldap-1.1.43~dfsg/sbin/checkinst.py 2013-06-22 15:51:05.000000000 +0000 @@ -3,13 +3,12 @@ """ This script checks all the prerequisites for running a particular release version of web2ldap. - -$Id: checkinst.py,v 1.35 2012/12/21 16:56:00 michael Exp $ """ import sys,os,imp,socket,pprint +from distutils.version import StrictVersion -MINIMUM_PYTHON_VERSION = '2.6' +MINIMUM_PYTHON_VERSION = (2,6,0) print '*** Checking installation prerequisites for web2ldap ***' @@ -25,8 +24,11 @@ print 'sys.prefix',repr(sys.prefix) print 'sys.exec_prefix',repr(sys.exec_prefix) print 'sys.version',repr(sys.version) -if sys.version < MINIMUM_PYTHON_VERSION: - print 'Python %s.x or newer is required! Detected %s.' % (MINIMUM_PYTHON_VERSION,repr(sys.version)) +minimum_major,minimum_minor,minimum_micro = MINIMUM_PYTHON_VERSION +if sys.version_info.major > minimum_major: + print 'Python 3 not supported.' +if not (sys.version_info.major==minimum_major and sys.version_info.minor>=minimum_minor): + print 'Python %s or newer is required! Detected %s.' % ('.'.join(map(str,MINIMUM_PYTHON_VERSION)),repr(sys.version)) print 'sys.platform',repr(sys.platform) print 'os.name',repr(os.name) @@ -95,7 +97,7 @@ version = modules[m].__version__ except AttributeError: version = 'unspecified' - if min_version!=None and version!='unspecified' and version