Re: pypi download links (e.g. for ansible)

2016-05-09 Thread Michael Ströder
Steven D'Aprano wrote:
> On Mon, 9 May 2016 08:00 pm, Michael Strc3b6der wrote:
> 
>> HI!
>>
>> Deep-links for downloading a specific version from PyPI seemed to work
>> like this:
>>
>> $ wget
>> https://pypi.python.org/packages/source/a/ansible/ansible-2.0.1.0.tar.gz
>> [..]
>> Saving to: ‘ansible-2.0.1.0.tar.gz’
>>
>> But this recent version does not work:
>>
>> $ wget
>> https://pypi.python.org/packages/source/a/ansible/ansible-2.0.2.0.tar.gz
>> [..]
>> HTTP request sent, awaiting response... 404 Not Found
> 
> 
> Do you have a question, or are you just sharing?
> 
> The Download button for 2.0.2.0 links to:
> 
> https://pypi.python.org/packages/b3/0e/5f3ee8884866a3d5e3b8ba86e9caa85ecdec75adabac8924b1c122339e7f/ansible-2.0.2.0.tar.gz

Yes, but in .spec files of openSUSE RPMs the more readable links above are used
and I'd like to keep it that way. And openSUSE build service checks whether it's
downloadable. It works for ansible-2.0.1.0 but not for 2.0.2.0.

Ciao, Michael.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: pypi download links (e.g. for ansible)

2016-05-09 Thread Michael Ströder
harirammano...@gmail.com wrote:
> On Monday, May 9, 2016 at 3:30:31 PM UTC+5:30, Michael Ströder wrote:
>> HI!
>>
>> Deep-links for downloading a specific version from PyPI seemed to work like 
>> this:
>>
>> $ wget 
>> https://pypi.python.org/packages/source/a/ansible/ansible-2.0.1.0.tar.gz
>> [..]
>> Saving to: 'ansible-2.0.1.0.tar.gz'
>>
>> But this recent version does not work:
>>
>> $ wget 
>> https://pypi.python.org/packages/source/a/ansible/ansible-2.0.2.0.tar.gz
>> [..]
>> HTTP request sent, awaiting response... 404 Not Found
> 
> how its working for you, for me it says ssl connection error,if i do wget 
> from linux as root user.

On my Linux installation the usually Mozilla web browser CA cert bundle is
installed.

Ciao, Michael.

-- 
https://mail.python.org/mailman/listinfo/python-list


pypi download links (e.g. for ansible)

2016-05-09 Thread Michael Ströder
HI!

Deep-links for downloading a specific version from PyPI seemed to work like 
this:

$ wget https://pypi.python.org/packages/source/a/ansible/ansible-2.0.1.0.tar.gz
[..]
Saving to: ‘ansible-2.0.1.0.tar.gz’

But this recent version does not work:

$ wget https://pypi.python.org/packages/source/a/ansible/ansible-2.0.2.0.tar.gz
[..]
HTTP request sent, awaiting response... 404 Not Found

Ciao, Michael.
-- 
https://mail.python.org/mailman/listinfo/python-list


pylint -> ImportError: No module named lazy_object_proxy

2016-02-10 Thread Michael Ströder
HI!

Hmm, I've used pylint before but my current installation gives me an 
ImportError:

$ pylint
Traceback (most recent call last):
  File "/usr/bin/pylint", line 3, in 
run_pylint()
  File "/usr/lib/python2.7/site-packages/pylint/__init__.py", line 22, in 
run_pylint
from pylint.lint import Run
  File "/usr/lib/python2.7/site-packages/pylint/lint.py", line 44, in 
import astroid
  File "/usr/lib/python2.7/site-packages/astroid/__init__.py", line 54, in 

from astroid.nodes import *
  File "/usr/lib/python2.7/site-packages/astroid/nodes.py", line 39, in 
from astroid.node_classes import (
  File "/usr/lib/python2.7/site-packages/astroid/node_classes.py", line 24, in

import lazy_object_proxy
ImportError: No module named lazy_object_proxy

Can anybody here give me a hint what's missing?
six, astroid and tk modules are installed.
Any more dependencies?

Ciao, Michael.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: pylint -> ImportError: No module named lazy_object_proxy

2016-02-10 Thread Michael Ströder
Peter Otten wrote:
> Michael Ströder wrote:
> 
>> HI!
>>
>> Hmm, I've used pylint before but my current installation gives me an
>> ImportError:
>>
>> $ pylint
>> [..]
>> ImportError: No module named lazy_object_proxy
>>
>> Can anybody here give me a hint what's missing?
>> six, astroid and tk modules are installed.
>> Any more dependencies?
> 
> How about the dependencies' dependencies? Grepping through the astroid 
> source finds
> 
> ../astroid/__pkginfo__.py:install_requires = ['six', 'lazy_object_proxy', 
> 'wrapt']

Ah, overlooked this. Thanks.

> But doesn't pip care of these?

Yes, likely, but...

I've added new openSUSE packages python-lazy_object_proxy and python-wrapt which
hopefully will appear in devel:languages:python repo soon.

Ciao, Michael.

-- 
https://mail.python.org/mailman/listinfo/python-list


ANN: python-ldap 2.4.25

2016-01-19 Thread Michael Ströder
Find a new release of python-ldap:

  https://pypi.python.org/pypi/python-ldap/2.4.25

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAP URLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Checksums:

md5sum python-ldap-2.4.25.tar.gz
21523bf21dbe566e0259030f66f7a487

sha1sum python-ldap-2.4.25.tar.gz
fa058ef9d77e4081d260c4972f6f2a5d4c45f36b

sha256sum python-ldap-2.4.25.tar.gz
62d00dbc86f3f9b21beacd9b826e8f9895f900637a60a6d4e7ab59a1cdc64e56

Ciao, Michael.


Released 2.4.25 2016-01-18

Changes since 2.4.23:
(2.4.24 is missing because of foolish pypi version madness)

Lib/
* Fix for attrlist=None regression introduced in 2.4.23
  by ref count patch


Released 2.4.23 2016-01-17

Changes since 2.4.22:

Modules/
* Ref count issue in attrs_from_List() was fixed
  (thanks to Elmir Jagudin)

-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


ANN: python-ldap 2.4.23

2016-01-17 Thread Michael Ströder
Find a new release of python-ldap:

  https://pypi.python.org/pypi/python-ldap/2.4.23

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAP URLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Checksums:

md5sum python-ldap-2.4.23.tar.gz
3a53d482fd628500ceebe7eca7ace34c

sha1sum python-ldap-2.4.23.tar.gz
39d3f1004e414369d623ea68fd21fee3517355bf

sha256sum python-ldap-2.4.23.tar.gz
7f0406bd7acbdde6ff9ba91b3c9aefb22864d24c3fb35a92baf2e3ab6bf251a4

Ciao, Michael.


Released 2.4.23 2016-01-17

Changes since 2.4.22:

Modules/
* Ref count issue in attrs_from_List() was fixed
  (thanks to Elmir Jagudin)
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


JOSE modules

2015-11-17 Thread Michael Ströder
HI!

It seems there are already three modules for implementing JOSE (see RFC
7515..7520). :-/

Anyone here who has practical experience with any of them (with Python 2.7.x
and preferrably with elliptic curves)?

Ciao, Michael.

pyjwkest
https://pypi.python.org/pypi/pyjwkest

JWCrypto
https://pypi.python.org/pypi/jwcrypto
http://jwcrypto.readthedocs.org/en/stable/index.html

python-jose
https://pypi.python.org/pypi/python-jose
-- 
https://mail.python.org/mailman/listinfo/python-list


ANN: python-ldap 2.4.22

2015-10-26 Thread Michael Ströder
Find a new release of python-ldap:

  https://pypi.python.org/pypi/python-ldap/2.4.22

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAP URLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Checksums:

$ md5sum python-ldap-2.4.22.tar.gz
dd7aa79c9c484833f57703484cbff275
$ sha1sum python-ldap-2.4.22.tar.gz
18379e464f807e71513d3bf43fb0d06cc6e57242
$ sha256sum python-ldap-2.4.22.tar.gz
9ef5872a95292f3ffe507aa09c805d7e1558b08159da0a81ba9dd04910be50b7

Ciao, Michael.


Released 2.4.22 2015-10-25

Changes since 2.4.21:

Lib/
* LDIFParser now also accepts value-spec without a space
  after the colon.
* Added key-word argument authz_id to LDAPObject methods
  sasl_non_interactive_bind_s(), sasl_external_bind_s() and
  sasl_gssapi_bind_s()
* Hmmpf! Added missing self to LDAPObject.fileno().
* ReconnectLDAPObject.sasl_bind_s() now correctly uses
  generic wrapper arguments *args,**kwargs
* Correct method name LDIFParser.handle_modify()
* Corrected __all__ in modules ldap.controls.pwdpolicy and
  ldap.controls.openldap

Doc/
* Started missing docs for sub-module ldap.sasl.

--
Michael Ströder
E-Mail: mich...@stroeder.com
http://www.stroeder.com
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


Re: reg multiple login python

2015-10-01 Thread Michael Ströder
harirammanohar...@gmail.com wrote:
> I have checked fabric tutorial and examples, it didn't sound that using fab
> we can do/push the thing at same time in all servers.

What does that mean?

Since the posting's subject contains "login" are you trying to minimize the
number of authentications needed? I had this discussion in project using OTP.

Ciao, Michael.

-- 
https://mail.python.org/mailman/listinfo/python-list


ANN: python-ldap 2.4.21

2015-09-26 Thread Michael Ströder
Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.21

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAP URLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Checksums:

$ md5sum python-ldap-2.4.21.tar.gz
1ce26617e066f412fd5ba95bfba4ba5a
$ sha1sum python-ldap-2.4.21.tar.gz
35ed5913d804f14e952bec414c569e140feb889d
$ sha256sum python-ldap-2.4.21.tar.gz
2a3ce606465d2d5fbd0a620516b6648ffd85c343d9305d49a2a1f7d338b8bbd4

Ciao, Michael.


Released 2.4.21 2015-09-25

Changes since 2.4.20:

Lib/
* LDAPObject.read_s() now returns None instead of raising
  ldap.NO_SUCH_OBJECT in case the search operation returned emtpy result.
* ldap.resiter.ResultProcessor.allresults() now takes new key-word
  argument add_ctrls which is internally passed to LDAPObject.result4()
  and lets the method also return response control along with the search
  results.
* Added ldap.controls.deref implementing support for dereference control

Tests/
* Unit tests for module ldif (thanks to Petr Viktorin)

--
Michael Ströder
E-Mail: mich...@stroeder.com
http://www.stroeder.com
-- 
https://mail.python.org/mailman/listinfo/python-list


ANN: python-ldap 2.4.21

2015-09-26 Thread Michael Ströder
Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.21

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAP URLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Checksums:

$ md5sum python-ldap-2.4.21.tar.gz
1ce26617e066f412fd5ba95bfba4ba5a
$ sha1sum python-ldap-2.4.21.tar.gz
35ed5913d804f14e952bec414c569e140feb889d
$ sha256sum python-ldap-2.4.21.tar.gz
2a3ce606465d2d5fbd0a620516b6648ffd85c343d9305d49a2a1f7d338b8bbd4

Ciao, Michael.


Released 2.4.21 2015-09-25

Changes since 2.4.20:

Lib/
* LDAPObject.read_s() now returns None instead of raising
  ldap.NO_SUCH_OBJECT in case the search operation returned emtpy result.
* ldap.resiter.ResultProcessor.allresults() now takes new key-word
  argument add_ctrls which is internally passed to LDAPObject.result4()
  and lets the method also return response control along with the search
  results.
* Added ldap.controls.deref implementing support for dereference control

Tests/
* Unit tests for module ldif (thanks to Petr Viktorin)

--
Michael Ströder
E-Mail: mich...@stroeder.com
http://www.stroeder.com
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


Re: Lightwight socket IO wrapper

2015-09-21 Thread Michael Ströder
Marko Rauhamaa wrote:
> I recommend using socket.TCP_CORK with socket.TCP_NODELAY where they are
> available (Linux).

If these options are not available are both option constants also not
available? Or does the implementation have to look into sys.platform?

Ciao, Michael.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Lightwight socket IO wrapper

2015-09-21 Thread Michael Ströder
Marko Rauhamaa wrote:
> Michael Ströder <mich...@stroeder.com>:
> 
>> Marko Rauhamaa wrote:
>>> I recommend using socket.TCP_CORK with socket.TCP_NODELAY where they
>>> are available (Linux).
>>
>> If these options are not available are both option constants also not
>> available? Or does the implementation have to look into sys.platform?
> 
>>>> import socket
>>>> 'TCP_CORK' in dir(socket)
>True

On which platform was this done?

To rephrase myquestion:
How to automagically detect whether TCP_CORK is really available on a platform?

'TCP_CORK' in dir(socket)
or catch AttributeError

sys.platform=='linux2'
hoping that Linux 2.1 or prior is not around anymore...

...

Ciao, Michael.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: problem with netCDF4 OpenDAP

2015-08-14 Thread Michael Ströder
Tom P wrote:
   yes the file does appear to be there, I can download it and I can open and
 read the URL using urllib. Since there are a whole bunch of files in the
 directory, I really need MFDataset, but according to the documentation that
 doesn't work with URLs. Maybe the solution really is to D/L them all into a
 temporary folder and use MFDataset.

Not sure about the size and other aspects of your deployment. But the safest
way to backup an OpenLDAP database is to export it to a single LDIF file
because this can be done while slapd is running and it's guaranteed that the
LDIF contains only data of finished transactions.

Ciao, Michael.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Authenticate users using command line tool against AD in python

2015-07-31 Thread Michael Ströder
Prasad Katti wrote:
 On Tuesday, July 28, 2015 at 12:56:29 AM UTC-7, Michael Ströder wrote:
 Prasad Katti wrote:
 I am writing a command line tool in python to generate one time
 passwords/tokens. The command line tool will have certain sub-commands like
 --generate-token and --list-all-tokens for example. I want to restrict
 access to certain sub-commands. In this case, when user tries to generate a
 new token, I want him/her to authenticate against AD server first.

 This does not sound secure:
 The user can easily use a modified copy of your script.

 I have looked at python-ldap and I am even able to bind to the AD server.
 In my application I have a function

 def authenticate_user(username, password): pass

 which gets username and plain-text password. How do I use the LDAPObject 
 instance to validate these credentials?

 You probably want to use

 http://www.python-ldap.org/doc/html/ldap.html#ldap.LDAPObject.simple_bind_s

 Check whether password is non-zero before because most LDAP servers consider
 an empty password as anon simple bind even if the bind-DN is set.
 
 Thank you for the reply. I ended up using simple_bind_s to authenticate
 users. But apparently it transmits plain-text password over the wire which
 can be easily sniffed using a packed sniffer. So I am looking at the
 start_tls_s method right now.

Yes, use TLS if the server supports it. Make sure to the option for CA
certificate. See Demo/initialize.py in the source distribution tar.gz.

 About your other comment; How could I make it more secure?

If you want something to be inaccessible for a user you have to spread the
functionality across separate components which communicate with each other. In
this communication you can implement authorization based on sufficiently
secure authentication.

Ciao, Michael.


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Authenticate users using command line tool against AD in python

2015-07-28 Thread Michael Ströder
Prasad Katti wrote:
 I am writing a command line tool in python to generate one time
 passwords/tokens. The command line tool will have certain sub-commands like
 --generate-token and --list-all-tokens for example. I want to restrict
 access to certain sub-commands. In this case, when user tries to generate a
 new token, I want him/her to authenticate against AD server first.

This does not sound secure:
The user can easily use a modified copy of your script.

 I have looked at python-ldap and I am even able to bind to the AD server.
 In my application I have a function
 
 def authenticate_user(username, password): pass
 
 which gets username and plain-text password. How do I use the LDAPObject 
 instance to validate these credentials?

You probably want to use

http://www.python-ldap.org/doc/html/ldap.html#ldap.LDAPObject.simple_bind_s

Check whether password is non-zero before because most LDAP servers consider
an empty password as anon simple bind even if the bind-DN is set.

Ciao, Michael.

-- 
https://mail.python.org/mailman/listinfo/python-list


ANN: python-ldap 2.4.20

2015-07-07 Thread Michael Ströder
Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.20

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAP URLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Checksums:

$ md5sum python-ldap-2.4.20.tar.gz
f98ecd0581766a43954ba0f218053032
$ sha1sum python-ldap-2.4.20.tar.gz
3051f2b53ce73a60b852b7f4e994e4b14b7de7b4
$ sha256sum python-ldap-2.4.20.tar.gz
4b8891539a3171d993cf7896b632ff088a4c707ae85ac3c77db1454f7949f3e2

Ciao, Michael.


Released 2.4.20 2015-07-07

Changes since 2.4.19:

* New wrapping of OpenLDAP's function ldap_sasl_bind_s() allows
  to intercept the SASL handshake (thanks to René Kijewski)

Modules/
* Added exceptions ldap.VLV_ERROR, ldap.X_PROXY_AUTHZ_FAILURE and
  ldap.AUTH_METHOD_NOT_SUPPORTED

Lib/
* Abandoned old syntax when raising ValueError in modules ldif and
  ldapurl, more information in some exceptions.
* ldap.ldapobject.LDAPObject:
  New convenience methods for SASL GSSAPI or EXTERNAL binds
* Refactored parts in ldif.LDIFParser:
  - New class attributes line_counter and byte_counter contain
amount of LDIF data read so far
  - Renamed some internally used methods
  - Added support for parsing change records currently limited to
changetype: modify
  - New separate methods parse_entry_records() (also called by parse())
and parse_change_records()
  - Stricter order checking of dn:, changetype:, etc.
  - Removed non-existent 'AttrTypeandValueLDIF' from ldif.__all__
* New mix-in class ldap.controls.openldap.SearchNoOpMixIn
  adds convience method noop_search_st() to LDAPObject class
* Added new modules which implement the control classes
  for Virtual List View (see draft-ietf-ldapext-ldapv3-vlv) and
  Server-side Sorting (see RFC 2891) (thanks to Benjamin Dauvergne)
  Note: This is still experimental! Even the API can change later.


-- 
https://mail.python.org/mailman/listinfo/python-list


ANN: python-ldap 2.4.20

2015-07-07 Thread Michael Ströder
Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.20

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAP URLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Checksums:

$ md5sum python-ldap-2.4.20.tar.gz
f98ecd0581766a43954ba0f218053032
$ sha1sum python-ldap-2.4.20.tar.gz
3051f2b53ce73a60b852b7f4e994e4b14b7de7b4
$ sha256sum python-ldap-2.4.20.tar.gz
4b8891539a3171d993cf7896b632ff088a4c707ae85ac3c77db1454f7949f3e2

Ciao, Michael.


Released 2.4.20 2015-07-07

Changes since 2.4.19:

* New wrapping of OpenLDAP's function ldap_sasl_bind_s() allows
  to intercept the SASL handshake (thanks to René Kijewski)

Modules/
* Added exceptions ldap.VLV_ERROR, ldap.X_PROXY_AUTHZ_FAILURE and
  ldap.AUTH_METHOD_NOT_SUPPORTED

Lib/
* Abandoned old syntax when raising ValueError in modules ldif and
  ldapurl, more information in some exceptions.
* ldap.ldapobject.LDAPObject:
  New convenience methods for SASL GSSAPI or EXTERNAL binds
* Refactored parts in ldif.LDIFParser:
  - New class attributes line_counter and byte_counter contain
amount of LDIF data read so far
  - Renamed some internally used methods
  - Added support for parsing change records currently limited to
changetype: modify
  - New separate methods parse_entry_records() (also called by parse())
and parse_change_records()
  - Stricter order checking of dn:, changetype:, etc.
  - Removed non-existent 'AttrTypeandValueLDIF' from ldif.__all__
* New mix-in class ldap.controls.openldap.SearchNoOpMixIn
  adds convience method noop_search_st() to LDAPObject class
* Added new modules which implement the control classes
  for Virtual List View (see draft-ietf-ldapext-ldapv3-vlv) and
  Server-side Sorting (see RFC 2891) (thanks to Benjamin Dauvergne)
  Note: This is still experimental! Even the API can change later.


-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


Re: Check for running DHCP daemon?

2015-01-24 Thread Michael Ströder
Chris Angelico wrote:
 On Sat, Jan 24, 2015 at 9:38 AM,  sohcahto...@gmail.com wrote:
 Secondly, even if you find a module, keep in mind that the module probably 
 won't stay in Python land.  It will probably call an external utility itself.

 If you REALLY wanted to check it without calling an external utility, you 
 could connect to port 67 and see what happens, but that could cause problems.
 
 We're talking UDP here, so there's no connect to concept. You have
 to send a packet and listen for a reply,

If I'd want to implement a serious DHCP monitoring I'd use a DHCP module and
try to renew a certain monitoring lease. With that approach you'd also see
whether the DHCP server does something meaningful.

Ciao, Michael.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Case-insensitive sorting of strings (Python newbie)

2015-01-23 Thread Michael Ströder
John Sampson wrote:
 I notice that the string method 'lower' seems to convert some strings (input
 from a text file) to Unicode but not others.
 This messes up sorting if it is used on arguments of 'sorted' since Unicode
 strings come before ordinary ones.

I doubt that. Can you provide a short example?

 Is there a better way of case-insensitive sorting of strings in a list? Is it
 necessary to convert strings read from a plaintext file
 to Unicode? If so, how? This is Python 2.7.8.

Well, if you have non-ASCII chars for many Unicode characters str.lower()
won't give reasonable results. So binary strings containing an encoding of
Unicode character entities should be decoded to Unicode strings first.

Ciao, Michael.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Hello World

2015-01-18 Thread Michael Ströder
Chris Angelico wrote:
 Want security?
 Push the encryption and authentication down to a lower layer, and save
 yourself the trouble.

Yes. And now for the next level: How to prevent unauthorized machines to
connect to your network…

Ciao, Michael.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Hello World

2015-01-18 Thread Michael Ströder
Chris Angelico wrote:
 On Mon, Jan 19, 2015 at 12:35 AM, Michael Ströder mich...@stroeder.com 
 wrote:
 Chris Angelico wrote:
 Want security?
 Push the encryption and authentication down to a lower layer, and save
 yourself the trouble.

 Yes. And now for the next level: How to prevent unauthorized machines to
 connect to your network…
 
 Extremely difficult, and in many cases quite unnecessary. No, you let
 them on the network, and then make sure that won't hurt you more than
 you're prepared to accept.

Somewhat true…

 For instance, someone could join my wifi
 network - all they need is the WPA2 PSK, which is well known around
 the place - and use/abuse our internet connection; but they couldn't
 access my PostgreSQL databases, because the firewall doesn't permit
 access to port 5432.

…but your firewall relies on authenticity of IP addresses. Fail!

Ciao, Michael.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Hello World

2015-01-18 Thread Michael Ströder
Steven D'Aprano wrote:
 Mark Lawrence wrote:
 
 Bah humbug, this has reminded me of doing secure work whereby each
 individual had two passwords, both of which had to be changed every
 thirty days, and rules were enforced so you couldn't just increment the
 number at the end of a word or similar.
 
 I hate and despise systems that force you to arbitrarily change a good
 strong password after N days for no good reason.
 
 The utterly bad reason often given by people who don't understand
 probability is that if hackers try to guess your password by brute-force,
 changing the password regularly will make it harder for them. That's simply
 wrong, and is based on a misunderstanding of probability.

But there's a probability  0 that one of the systems where an admin has to
use his/her password was hacked and that passwords gets stolen there. It's
hard to find out in case of skilled hackers.

= have more than one account for different security areas and have password
aging in place.

Ciao, Michael.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Hello World

2015-01-18 Thread Michael Ströder
Michael Torrie wrote:
 Like many of you I use a password manager these days.  It's pretty
 slick.  But really it shows the absurdity of the situation.  Instead of
 passwords we should all just use private/public keypairs and store the
 private keys in a digital wallet.  Forget this password garbage with
 it's 50-70 bits of entropy.  Let's go for 2048-bit keys and be done with
 it, if we're going to require the use of password managers.

Yes, and that's easy e.g. with SSH. And in theory it's easy with SSL/TLS. But
support for client certs in browsers really suck (try to change the login once
you've chosen a client cert without closing the browser).

Ciao, Michael.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Hello World

2015-01-18 Thread Michael Ströder
Marko Rauhamaa wrote:
 I believe in a
 physical, government-issue object

Did you forget the smiley? Or where were you during the last 1,5 years?

Ciao, Michael.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Hello World

2015-01-18 Thread Michael Ströder
Marko Rauhamaa wrote:
 Michael Ströder mich...@stroeder.com:
 
 Marko Rauhamaa wrote:
 I believe in a
 physical, government-issue object
 
 Did you forget the smiley? Or where were you during the last 1,5 years?
 
 You can juggle the issues all you want. In the end, there's no escaping
 the governments' underwriting role. The TLS chain of trust we have
 today is a joke and can be spoofed easily not only by governments but
 really by anybody.

That's why I'm internally using my own private CA and limit the trust stores
of various services to this CA.

 Authentication is still separate from privacy,

Not true because there's no authorization without authentication.

Ciao, Michael.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Hello World

2015-01-17 Thread Michael Ströder
alb...@spenarnc.xs4all.nl (Albert van der Horst) wrote:
 In article h9gqob-c3e@esprimo.zbmc.eu,  c...@isbd.net wrote:
 Michael Torrie torr...@gmail.com wrote:
 On 01/17/2015 07:51 AM, Albert van der Horst wrote:
 In article mailman.17471.1420721626.18130.python-l...@python.org,
 Chris Angelico  ros...@gmail.com wrote:
 SNIP

 But sure. If you want to cut out complication, dispense with user
 accounts altogether and run everything as root. That's WAY simpler!

 I didn't except this strawman argument from you.
 Of course you need a distinction between doing system things as
 root, and working as a normal user. You just don't need sudo.

 I just don't see the distinction.  What's the difference between having
 to type in a root password and having to type in your own administrative
 user password?  Guess we're all just struggling to understand your logic
 here.

 One big distinction is that you need to know two passwords to get root
 access if there's a real root account as opposed to using sudo.  This
 only applies of course if direct root login isn't allowed (via ssh or
 whatever).
 
 The other is that if a dozen users have sudo possibility, one compromised
 password compromises the whole system.

Hmm, but it's much worse if a dozen users have to know the root password. With
this they can circumvent sudo completely (e.g. going over IPMI console).

 Compare that to
 Dear administrator, I've to do this. Can I have the root password.
 Sure here it is Looks over users shoulder. Are you ready?
 Make sure he's logged out. Uses random generator for a new password.

This process does not work for dozens of admins maintaining thousands of
machines. Especially when something goes wrong in the night shift and has to
be fixed quickly.

 If there is something, anything, change the root password and check
 the disk for suid-root files.

Better require public key authc for SSH access and the user's own (one-time)
password for sudo. If your security requirements are really high mandate going
through a SSH gateway / jumphost.

 Security requires one thing: attention. And effort. So two things:
 attention and effort. And simplicity. So three things: attention,
 effort and simplicity.

Yes.

 sudo makes administrators careless, lazy and it is not simple at all.

Admins must have separate accounts with separate credentials for
administrative work and must be careful when using an administrative account.

Ciao, Michael.

-- 
https://mail.python.org/mailman/listinfo/python-list


ANN: python-ldap 2.4.19

2015-01-11 Thread Michael Ströder
Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.19

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAP URLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.


Released 2.4.19 2015-01-10

Changes since 2.4.18:

Lib/
* Fixed missing ReconnectLDAPObject._reconnect_lock when pickling
  (see SF#64, thanks to Dan O'Reilly)
* Added ldap.controls.pagedresults which is pure Python implementation of
  Simple Paged Results Control (see RFC 2696) and delivers the correct
  result size

-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


ANN: python-ldap 2.4.19

2015-01-11 Thread Michael Ströder
Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.19

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAP URLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.


Released 2.4.19 2015-01-10

Changes since 2.4.18:

Lib/
* Fixed missing ReconnectLDAPObject._reconnect_lock when pickling
  (see SF#64, thanks to Dan O'Reilly)
* Added ldap.controls.pagedresults which is pure Python implementation of
  Simple Paged Results Control (see RFC 2696) and delivers the correct
  result size

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Hello World

2015-01-08 Thread Michael Ströder
Chris Angelico wrote:
 With sudo, you get MUCH finer control.

But it's very hard, almost impossible, to really implement fine-grained
control with sudo. Too many programs provide shell exits.

Well, it's off-topic here.
How about taking this to news:comp.security.unix ?

Ciao, Michael.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: smptplib problem SMTPRecipientsRefused for emails with ! exclamation mark in local portion of email

2014-12-17 Thread Michael Ströder
Radomir Wojcik wrote:
 No need to do more troubleshooting, need to update the config. Found that 
 exim default config denies these so nothing to do with smptlib indeed:
 
 What this statement is doing is to accept unconditionally all recipients in 
 messages that are submitted by SMTP from local processes using the standard 
 input and output (that is, not using TCP/IP). A number of MUAs operate in 
 this manner.
 
 denymessage   = Restricted characters in address
 domains   = +local_domains
 local_parts   = ^[.] : ^.*[@%!/|]
 
 denymessage   = Restricted characters in address
 domains   = !+local_domains
 local_parts   = ^[./|] : ^.*[@%!] : ^.*/\\.\\./
 These statements are concerned with local parts that contain any of the 
 characters @, %, !, /, |, or dots in unusual places. Although these 
 characters are entirely legal in local parts (in the case of @ and leading 
 dots, only if correctly quoted), they do not commonly occur in Internet mail 
 addresses.
 
 http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_default_configuration_file.html

You should really think about why these chars were excluded in the
configuration: The reason is that those they are special in shells.

And many SMTP deployments have pretty naive (shell) scripts or software with
shell exits. So allowing those chars can cause more or less big security
risks. For this reason it's likely that you will end in spam filters / black
lists etc. because systems may assume you want to do some harm.

So I would really rethink the requirements.

Your mileage may vary. But you have been warned.

Ciao, Michael.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: netaddr value back to IP

2014-11-14 Thread Michael Ströder
Noah wrote:
 I am trying to get a value back to IP using the netaddr python module.
 How do I get the value 'ip' back to IP format?  how is it done?
 
  snip 
 
 print IPNetwork(v4_peer_ip).value
 ip = IPNetwork(v4_peer_ip).value + 1
 print ip
 
 --- snip ---

 ip=netaddr.IPAddress('192.168.71.20')
 ip+=1
 str(ip)
'192.168.71.21'

Ciao, Michael.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: asyncio: setting file permissions of a Unix socket?

2014-10-27 Thread Michael Ströder
Martin wrote:
 I'm using the asyncio.Protocol interface to build a server which binds
 to a unix socket file.  I want other system users to connect to the
 unix socket, so to communicate with the server.
 
 Where should I set the permissions of the file?

You should start the demon with a strict umask and set the permissions after
the socket is created.

Deriving from SocketServer.UnixStreamServer I'm overriding the server_bind()
method:

class MyServer(SocketServer.UnixStreamServer):
[..]
  def server_bind(self):
Override server_bind to set socket options.
self.socket.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
self.socket.settimeout(SOCKET_TIMEOUT)
try:
  os.unlink(self.server_address)
except OSError:
  if os.path.exists(self.server_address):
raise
SocketServer.UnixStreamServer.server_bind(self)
os.chmod(self.server_address,int(SOCKET_PERMISSIONS,8))
return # server_bind()

Ciao, Michael.

-- 
https://mail.python.org/mailman/listinfo/python-list


ANN: python-ldap 2.4.18

2014-10-09 Thread Michael Ströder
Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.18

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAP URLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.


Released 2.4.18 2014-10-09

Changes since 2.4.17:

Lib/
* Fixed raising exception in LDAPObject.read_s() when reading
  an entry returns empty search result

-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


ANN: python-ldap 2.4.18

2014-10-09 Thread Michael Ströder
Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.18

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAP URLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.


Released 2.4.18 2014-10-09

Changes since 2.4.17:

Lib/
* Fixed raising exception in LDAPObject.read_s() when reading
  an entry returns empty search result

-- 
https://mail.python.org/mailman/listinfo/python-list


ANN: python-ldap 2.4.17

2014-09-27 Thread Michael Ströder
Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.17

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAP URLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.


Released 2.4.17 2014-09-27

Changes since 2.4.16:

Lib/
* New hook syncrepl_refreshdone() in ldap.syncrepl.SyncReplConsumer
  (thanks to Petr Spacek and Chris Mikkelson)

Modules/
* Added support for getting file descriptor of connection
  with ldap.OPT_DESC

-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


ANN: python-ldap 2.4.17

2014-09-27 Thread Michael Ströder
Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.17

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAP URLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.


Released 2.4.17 2014-09-27

Changes since 2.4.16:

Lib/
* New hook syncrepl_refreshdone() in ldap.syncrepl.SyncReplConsumer
  (thanks to Petr Spacek and Chris Mikkelson)

Modules/
* Added support for getting file descriptor of connection
  with ldap.OPT_DESC

-- 
https://mail.python.org/mailman/listinfo/python-list


ANN: python-ldap 2.4.16

2014-09-10 Thread Michael Ströder
Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.16

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAP URLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.


Released 2.4.16 2014-09-10

Changes since 2.4.15:

Lib/
* New convenience function ldap.dn.is_dn()
* New convenience function ldap.escape_str()
* New convenience methods LDAPObject.read_s() and
  LDAPObject.find_unique_entry()
* Fixed invoking start_tls_s() in ReconnectLDAPObject.reconnect()
  (thanks to Philipp Hahn)

-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


ANN: python-ldap 2.4.16

2014-09-10 Thread Michael Ströder
Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.16

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAP URLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.


Released 2.4.16 2014-09-10

Changes since 2.4.15:

Lib/
* New convenience function ldap.dn.is_dn()
* New convenience function ldap.escape_str()
* New convenience methods LDAPObject.read_s() and
  LDAPObject.find_unique_entry()
* Fixed invoking start_tls_s() in ReconnectLDAPObject.reconnect()
  (thanks to Philipp Hahn)

-- 
https://mail.python.org/mailman/listinfo/python-list


ANN: python-ldap 2.4.15

2014-03-27 Thread Michael Ströder
Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.15

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAP URLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.


Released 2.4.15 2014-03-24

Changes since 2.4.14:

Lib/
* Added missing modules ldap.controls.openldap and
  ldap.controls.pwdpolicy to setup.py
* Added missing imports to ldap.controls.pwdpolicy
* Fixed ldap.controls.pwdpolicy.decodeControlValue() to decode
  string of digits
* Support for X-SUBST in schema element class LDAPSyntax
* Support for X-ORDERED and X-ORIGIN in schema element class AttributeType
* ldapurl: New scope 'subordinates' defined in
  draft-sermersheim-ldap-subordinate-scope

Modules/
* New constant ldap.SCOPE_SUBORDINATE derived from ldap.h for
  draft-sermersheim-ldap-subordinate-scope
* Fixed constant ldap.sasl.CB_GETREALM (thanks to Martin Pfeifer)

-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


ANN: python-ldap 2.4.15

2014-03-27 Thread Michael Ströder
Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.15

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAP URLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.


Released 2.4.15 2014-03-24

Changes since 2.4.14:

Lib/
* Added missing modules ldap.controls.openldap and
  ldap.controls.pwdpolicy to setup.py
* Added missing imports to ldap.controls.pwdpolicy
* Fixed ldap.controls.pwdpolicy.decodeControlValue() to decode
  string of digits
* Support for X-SUBST in schema element class LDAPSyntax
* Support for X-ORDERED and X-ORIGIN in schema element class AttributeType
* ldapurl: New scope 'subordinates' defined in
  draft-sermersheim-ldap-subordinate-scope

Modules/
* New constant ldap.SCOPE_SUBORDINATE derived from ldap.h for
  draft-sermersheim-ldap-subordinate-scope
* Fixed constant ldap.sasl.CB_GETREALM (thanks to Martin Pfeifer)

-- 
https://mail.python.org/mailman/listinfo/python-list


ANN: python-ldap 2.4.14

2014-02-03 Thread Michael Ströder
Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.14

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAP URLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.


Released 2.4.14 2014-01-31

Changes since 2.4.13:

Lib/
* Added ldap.controls.openldap.SearchNoOpControl
* New method ldap.async.AsyncSearchHandler.afterFirstResult()
  for doing something right after successfully receiving but before
  processing first result
* Better log data written when invoking ldap.LDAPLock.acquire() and
  ldap.LDAPLock.release()
* LDAPObject and friends now pass `desc' to ldap.LDAPLock() which
  results in better logging
* ldapobject.ReconnectLDAPObject now uses internal class-wide
  lock for serializing reconnects
* Method signature of ReconnectLDAPObject.reconnect() changed to be able
  to call it with separate retry_max and retry_delay values

Modules/
* Added support for retrieving negotiated TLS version/cipher
  with LDAPObject.get_option() with the help of upcoming OpenLDAP libs

-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


ANN: python-ldap 2.4.14

2014-02-03 Thread Michael Ströder
Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.14

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAP URLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.


Released 2.4.14 2014-01-31

Changes since 2.4.13:

Lib/
* Added ldap.controls.openldap.SearchNoOpControl
* New method ldap.async.AsyncSearchHandler.afterFirstResult()
  for doing something right after successfully receiving but before
  processing first result
* Better log data written when invoking ldap.LDAPLock.acquire() and
  ldap.LDAPLock.release()
* LDAPObject and friends now pass `desc' to ldap.LDAPLock() which
  results in better logging
* ldapobject.ReconnectLDAPObject now uses internal class-wide
  lock for serializing reconnects
* Method signature of ReconnectLDAPObject.reconnect() changed to be able
  to call it with separate retry_max and retry_delay values

Modules/
* Added support for retrieving negotiated TLS version/cipher
  with LDAPObject.get_option() with the help of upcoming OpenLDAP libs

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to manage Git or Mercurial repositories

2013-10-15 Thread Michael Ströder
Andriy Kornatskyy wrote:
 Managing version control repositories can be a challenge in multi-user 
 environment especially when simplification of user collaboration is your 
 goal. There are usually two primary concerns while considering enterprise 
 deployment for version control repositories: access control and safety of 
 your data. Both are not directly addressed by version control itself, thus a 
 sort of security facade is necessary. Read more here:
 
 http://mindref.blogspot.com/2013/10/how-to-manage-git-or-mercurial.html

This seems like simple advertising to me.

Ciao, Michael.

-- 
https://mail.python.org/mailman/listinfo/python-list


ANN: python-ldap 2.4.13

2013-06-27 Thread Michael Ströder
Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.11

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAP URLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.


Released 2.4.13 2013-06-27

Changes since 2.4.12:

Lib/
* ldapobject.ReconnectLDAPObject._apply_last_bind() now sends
  anonymous simple bind request even if the calling application
  did not to provoke ldap.SERVER_DOWN in method reconnect()
* ldapobject.ReconnectLDAPObject.reconnect() now also catches
  ldap.TIMEOUT exception after reconnection attempt
* Several other fixes for ldapobject.ReconnectLDAPObject
  (thanks to Jonathan Giannuzzi)


Released 2.4.12 2013-06-01

Changes since 2.4.11:

Lib/
* Truly optional import of PyAsn1Error exception which should
  not fail anymore if pyasn1 is not installed

-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


ANN: python-ldap 2.4.13

2013-06-27 Thread Michael Ströder
Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.11

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAP URLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.


Released 2.4.13 2013-06-27

Changes since 2.4.12:

Lib/
* ldapobject.ReconnectLDAPObject._apply_last_bind() now sends
  anonymous simple bind request even if the calling application
  did not to provoke ldap.SERVER_DOWN in method reconnect()
* ldapobject.ReconnectLDAPObject.reconnect() now also catches
  ldap.TIMEOUT exception after reconnection attempt
* Several other fixes for ldapobject.ReconnectLDAPObject
  (thanks to Jonathan Giannuzzi)


Released 2.4.12 2013-06-01

Changes since 2.4.11:

Lib/
* Truly optional import of PyAsn1Error exception which should
  not fail anymore if pyasn1 is not installed

-- 
http://mail.python.org/mailman/listinfo/python-list


ANN: python-ldap 2.4.11

2013-05-28 Thread Michael Ströder
Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.11

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAP URLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.


Released 2.4.11 2013-05-27

Changes since 2.4.10:

Lib/
* ldap.controls.DecodeControlTuples() now simply ignores
  PyAsn1Error exception raised during decoding malformed
  response control values in case of non-critical controls.
* ldif.LDIFWriter.unparse() does not simply skip empty
  records anymore.
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


Re: Ldap module and base64 oncoding

2013-05-28 Thread Michael Ströder
Joseph L. Casale wrote:
 I had some time today, so I attempted to open the ldif files in binary mode 
 to simply
 work with the raw byte strings but the moment the first entry was parsed, 
 parse()
 stumbled on a character in the first entries dict and passed a dn of None for 
 the last half?

Without seeing the LDIF data and your code I can't tell what's going on.

 If the option to avoid worrying about decoding and encoding could work, I 
 would be
 happy to process the whole lot in byte strings. Any idea what may cause this?

I would not claim that module 'ldif' has really awesome docs.
But did you follow the example with LDIFParser in the docs?

http://www.python-ldap.org/doc/html/ldif.html#example

It illustrates that for LDIF stream processing one basically derives a class
from ldif.LDIFParser overriding method handle(). The most basic test would be
something like this:

[..]
   def handle(self,dn,entry):
 print '***dn',repr(dn)
 pprint.pprint(entry)

And then carefully look at the output.

Ciao, Michael.

-- 
http://mail.python.org/mailman/listinfo/python-list


ANN: python-ldap 2.4.11

2013-05-28 Thread Michael Ströder
Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.11

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAP URLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.


Released 2.4.11 2013-05-27

Changes since 2.4.10:

Lib/
* ldap.controls.DecodeControlTuples() now simply ignores
  PyAsn1Error exception raised during decoding malformed
  response control values in case of non-critical controls.
* ldif.LDIFWriter.unparse() does not simply skip empty
  records anymore.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Ldap module and base64 oncoding

2013-05-27 Thread Michael Ströder
Joseph L. Casale wrote:
 After parsing the data for a user I am simply taking a value from the ldif 
 file and writing
 it back out to another which fails, the value parsed is:
 
 officestreetaddress:: T3R0by1NZcOfbWVyLVN0cmHDn2UgMQ==
 
 
   File C:\Python27\lib\site-packages\ldif.py, line 202, in unparse
 self._unparseChangeRecord(record)
   File C:\Python27\lib\site-packages\ldif.py, line 181, in 
 _unparseChangeRecord
 self._unparseAttrTypeandValue(mod_type,mod_val)
   File C:\Python27\lib\site-packages\ldif.py, line 142, in 
 _unparseAttrTypeandValue
 self._unfoldLDIFLine(':: 
 '.join([attr_type,base64.encodestring(attr_value).replace('\n','')]))
   File C:\Python27\lib\base64.py, line 315, in encodestring
 pieces.append(binascii.b2a_base64(chunk))
 UnicodeEncodeError: 'ascii' codec can't encode character u'\xdf' in position 
 7: ordinal not in range(128)

Note that all modules in python-ldap up to 2.4.10 including module 'ldif'
expect raw byte strings to be passed as arguments. It seems to me you're
passing a Unicode object in the entry dictionary which will fail in case an
attribute value contains NON-ASCII chars.

python-ldap expects raw strings since it's not schema-aware and therefore does
not have any knowledge about the LDAP syntax used for a particular attribute
type. So automagically convert Unicode strings will likely fail in many cases.
= The calling application has to deal with it.

 I now have the exact the value I started with. Ensuring where I ever handle 
 the original
 values that I return utf-8 decoded objects for use in a modlist to later 
 write and Sub
 classing LDIFWriter and overriding _unparseAttrTypeandValue to do the 
 encoding has
 eliminated all the errors.

Don't muck with overriding  _unparseAttrTypeandValue(). Simply pass the
properly encoded data into ldif module.

Ciao, Michael.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Ldap module and base64 oncoding

2013-05-26 Thread Michael Ströder
Joseph L. Casale wrote:
 I have some data I am working with that is not being interpreted as a string 
 requiring
 base64 encoding when sent to the ldif module for output.
 
 The base64 string parsed is ZGV0XDMzMTB3YmJccGc= and the raw string is 
 det\3310wbb\pg.
 I'll admit my understanding of the handling requirements of non ascii data in 
 2.7 is weak
 and as such I am failing at adjusting the regex that deduces is the string 
 contains characters
 requiring base64 encoding when being output.

I'm not sure what exactly you're asking for.
Especially is not being interpreted as a string requiring base64 encoding is
written without giving the right context.

So I'm just guessing that this might be the usual misunderstandings with use
of base64 in LDIF. Read more about when LDIF requires base64-encoding here:

http://tools.ietf.org/html/rfc2849

To me everything looks right:

Python 2.7.3 (default, Apr 14 2012, 08:58:41) [GCC] on linux2
Type help, copyright, credits or license for more information.
 'ZGV0XDMzMTB3YmJccGc='.decode('base64').decode('utf-8')
u'det\\3310wbb\\pg'


What do you think is a problem?

Ciao, Michael.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Ldap module and base64 oncoding

2013-05-26 Thread Michael Ströder
Joseph L. Casale wrote:
 Can you give an example of the code you have?
 
 I actually just overrode the regex used by the method in the LDIFWriter class 
 to be far more broad
 about what it interprets as a safe string.

Are you sure that you fully understood RFC 2849 before doing this?
Which version of python-ldap are you using?

 I really need to properly handle reading, manipulating and
 writing non ascii data to solve this...

Module ldif in python-ldap does that for you based on RFC 2849.
Without seeing your code using it I cannot tell what's wrong.

 Shame there is no ldap module (with the ldifwriter) in Python 3.

1. The module ldif is stand-alone. So you could easily make it available for
Python 3.

2. Shame is the wrong term here. Personally I currently have no requirement
to use Python 3 and I'm quite busy with other things. So contributors are
welcome. But they should be willing to do some serious work giving continous
support - not only a half-baken patch.

Ciao, Michael.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Ldap module and base64 oncoding

2013-05-26 Thread Michael Ströder
Joseph L. Casale wrote:
 I'm not sure what exactly you're asking for.
 Especially is not being interpreted as a string requiring base64 encoding 
 is
 written without giving the right context.

 So I'm just guessing that this might be the usual misunderstandings with use
 of base64 in LDIF. Read more about when LDIF requires base64-encoding here:

 http://tools.ietf.org/html/rfc2849

 To me everything looks right:

 Python 2.7.3 (default, Apr 14 2012, 08:58:41) [GCC] on linux2
 Type help, copyright, credits or license for more information.
 'ZGV0XDMzMTB3YmJccGc='.decode('base64').decode('utf-8')
 u'det\\3310wbb\\pg'


 What do you think is a problem?
 
 Thanks for the reply. The issues I am sure are in my code, I read the ldif 
 source file and up
 with a values such as 'det\3310wbb\pg' after the base64 encoded entries are 
 decoded.
 
 The problem I am having is when I add this to an add/mod entry list and write 
 it back out.
 As it does not get re-encoded to base64 the ldif file ends up seeing a text 
 entry with a ^]
 character which if I re-read it with the parser it causes the handle method 
 to break midway
 through the entry dict and so the last half re-appears disjoint without a dn.
 
 Like I said, I am pretty sure its my poor misunderstanding of decoding and 
 encoding.
 I am using the build from http://www.lfd.uci.edu/~gohlke/pythonlibs/ on a 
 windows
 2008 r2 server.
 
 I have re-implemented handle to create a cidict holding all the dn/entry's 
 that are parsed as
 I then perform some processing such as manipulating attribute values in the 
 entry dict. I
 am pretty sure I am breaking things here. The data I am reading is coming 
 from utf-16-le
 encoded files and has Unicode characters as the source directory is globally 
 available, being
 written to in just about every country.

Processing LDIF is one thing, doing LDAP operations another.

LDIF itself is meant to be ASCII-clean. But each attribute value can carry any
byte sequence (e.g. attribute 'jpegPhoto'). There's no further processing by
module LDIF - it simply returns byte sequences.

The access protocol LDAPv3 mandates UTF-8 encoding for Unicode strings on the
wire if attribute syntax is DirectoryString, IA5String (mainly ASCII) or 
similar.

So if you're LDIF input returns UTF-16 encoded attribute values for e.g.
attribute 'cn' or 'o' or another attribute not being of OctetString or Binary
syntax something's wrong with the producer of the LDIF data.

 Is there a process for manipulating/adding data to the entry dict before I 
 write it out that I
 should adhere to? For example, if I am adding a new attribute to be composed 
 of part of
 another parsed attr for use in a modlist:
 
   {'customAttr': ['foo.{}.bar'.format(entry['uid'])]}
 
 By looking at the value from above, 'det\3310wbb\pg', I gather the entry dict 
 was parsed
 into byte strings. I should have decoded this, where as some of the data is 
 Unicode and
 as such I should have encoded it?

I wonder what the string really is. At least the base64-encoding you provided
before decodes as UTF-8 but I'm not sure whether it's the right sequence of
Unicode code points you're expecting.

 'ZGV0XDMzMTB3YmJccGc='.decode('base64').decode('utf-8')
u'det\\3310wbb\\pg'

I still can't figure out what you're really doing though. I'd recommend to
strip down your operations to a very simple test code snippet illustrating the
issue and post that here.

Ciao, Michael.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python ldap bind error

2012-12-22 Thread Michael Ströder
Jorge Alberto Diaz Orozco wrote:
 hi there.
 I'm working with python ldap and I need to authenticate my user.
 this is the code I'm using.
 
 import ldap
 ldap.set_option(ldap.OPT_REFERRALS,0)
 ldap.protocol_version = 3
 conn = ldap.initialize(ldap://ldap.domain.cu;)
 conn.simple_bind_s(u...@domain.cu,password)
 
 every time I do this it gives me the next error:
 ldap.INVALID_DN_SYNTAX: {'info': 'invalid DN', 'desc': 'Invalid DN syntax'}

u...@domain.cu is not a DN as required in RFC 4511:

http://tools.ietf.org/html/rfc4511#section-4.2

MS AD directly accepts a userPrincipalName but this is a highly proprietary
feature = search the user's entry first.

Ciao, Michael.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: [fcgi.py] Force cache upgrade?

2012-10-05 Thread Michael Ströder
Gilles wrote:
 On Fri, 28 Sep 2012 23:57:14 +0200, Gilles nos...@nospam.com wrote:
 I guess the FastCGI server (Flup) only updates its cache every so
 often. Do I need to type a command to force Flup to recompile the
 Python script?
 
 Turns out that, yes, mod_fcgid is configured to reload a script only
 after some time or some number of hits,

Well, that's the whole point of using FastCGI:
Have a long-running process for better performance.

Ciao, Michael.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Dynamically scheduling Cron Jobs for Python Scripts.

2012-09-07 Thread Michael Ströder
Miki Tebeka wrote:
 I want to re run the script at that schedule time to send me a email.

 Calculate how much time until the meeting. And spawn the script that will
 sleep that amount of time and then send email.

And if the process gets interrupted in the meantime (e.g. because of reboot)?

Ciao, Michael.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Best way to disconnect from ldap?

2012-04-05 Thread Michael Ströder
John Gordon wrote:
 class ldap.LDAPObject
 Instances of LDAPObject are returned by initialize() and open()
 (deprecated).  The connection is automatically unbound and closed
 when the LDAP object is deleted.
 
 So, given that, do I need to do anything at all?

Hmm, maybe the author of this statement (have to check who) did not know about
the caveats with __del__() when this was written ages ago. IIRC first
python-ldap release was for Python 1.4 back in '98. See use of dealloc() in
Modules/LDAPObject.c.

So I'd recommend to use the modern with-statement to make sure
LDAPObject.unbind_s() is really called. Being old-fashioned I used
try-finally-blocks until now.

Ciao, Michael.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: convert string to bytes without changing data (encoding)

2012-03-30 Thread Michael Ströder
Steven D'Aprano wrote:
 On Thu, 29 Mar 2012 17:36:34 +, Prasad, Ramit wrote:
 
 Technically, ASCII goes up to 256 but they are not A-z letters.

 Technically, ASCII is 7-bit, so it goes up to 127.

 No, ASCII only defines 0-127.  Values =128 are not ASCII.

 From https://en.wikipedia.org/wiki/ASCII:

   ASCII includes definitions for 128 characters: 33 are non-printing
   control characters (now mostly obsolete) that affect how text and
   space is processed and 95 printable characters, including the space
   (which is considered an invisible graphic).


 Doh! I was mistaking extended ASCII for ASCII. Thanks for the
 correction.
 
 There actually is no such thing as extended ASCII -- there is a whole 
 series of many different extended ASCIIs. If you look at the encodings 
 available in (for example) Thunderbird, many of the ISO-8859-* and 
 Windows-* encodings are extended ASCII in the sense that they extend 
 ASCII to include bytes 128-255. Unfortunately they all extend ASCII in a 
 different way (hence they are different encodings).

Yupp.

Looking at RFC 1345 some years ago (while having to deal with EBCDIC) made
this all pretty clear to me. I appreciate that someone did this heavy work of
collecting historical encodings.

Ciao, Michael.
-- 
http://mail.python.org/mailman/listinfo/python-list


Enforcing hash randomization (was: [RELEASED] Second release candidates for Python 2.6.8, 2.7.3, 3.1.5, and 3.2.3)

2012-03-20 Thread Michael Ströder
Benjamin Peterson wrote:
 Hash randomization causes the iteration order of dicts and sets to be
 unpredictable and differ across Python runs. Python has never guaranteed
 iteration order of keys in a dict or set, and applications are advised to 
 never
 rely on it. Historically, dict iteration order has not changed very often 
 across
 releases and has always remained consistent between successive executions of
 Python. Thus, some existing applications may be relying on dict or set 
 ordering.
 Because of this and the fact that many Python applications which don't accept
 untrusted input are not vulnerable to this attack, in all stable Python 
 releases
 mentioned here, HASH RANDOMIZATION IS DISABLED BY DEFAULT. There are two ways 
 to
 enable it. The -R commandline option can be passed to the python executable. 
 It
 can also be enabled by setting an environmental variable PYTHONHASHSEED to
 random. (Other values are accepted, too; pass -h to python for complete
 description.)

I wonder how I could enforce hash randomization from within a Python app
without too much hassle. I'd like to avoid having to rely on sys-admins doing
the right thing when installing my web2ldap.

I guess
os.environ['PYTHONHASHSEED'] = 'random'
before forking a process would be a solution. But is there another way?

Ciao, Michael.
-- 
http://mail.python.org/mailman/listinfo/python-list


ANN: python-ldap 2.4.9

2012-03-15 Thread Michael Ströder

Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.8

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAPURLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.


Released 2.4.9 2012-03-14

Changes since 2.4.8:

Lib/
* ldapobject.ReconnectLDAPObject.reconnect() now does kind of
  an internal locking to pause other threads while reconnecting
  is pending.
* Changes to bind- and startTLS-related operation methods of
  class ReconnectLDAPObject for more robustness
* New constant ldap.OPT_NAMES_DICT contains mapping from
  integer to variable name for all option-related constants.
--
http://mail.python.org/mailman/listinfo/python-list


Re: exec

2012-03-01 Thread Michael Ströder

Rolf Wester wrote:

The reason to use exec is just laziness.


The worst reason for using it. So I hope you carefully read Steven's comment 
and get rid of exec() for anything serious:


4f4f85eb$0$29989$c3e8da3$54964...@news.astraweb.com

Ciao, Michael.
--
http://mail.python.org/mailman/listinfo/python-list


ANN: python-ldap 2.4.8

2012-02-22 Thread Michael Ströder

Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.8

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAPURLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.


Released 2.4.8 2012-02-21

Changes since 2.4.7:

Lib/
* Fixed overzealous check for non-unique NAMEs in
  ldap.schema.subentry.SubSchema.__init__()
* Fixed typos in control decoding method
  ldap.controls.simple.OctetStringInteger.decodeControlValue()
* Added experimental support for draft-vchu-ldap-pwd-policy
--
http://mail.python.org/mailman/listinfo/python-announce-list

   Support the Python Software Foundation:
   http://www.python.org/psf/donations/


ANN: python-ldap 2.4.8

2012-02-22 Thread Michael Ströder

Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.8

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAPURLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.


Released 2.4.8 2012-02-21

Changes since 2.4.7:

Lib/
* Fixed overzealous check for non-unique NAMEs in
  ldap.schema.subentry.SubSchema.__init__()
* Fixed typos in control decoding method
  ldap.controls.simple.OctetStringInteger.decodeControlValue()
* Added experimental support for draft-vchu-ldap-pwd-policy
--
http://mail.python.org/mailman/listinfo/python-list


Re: ldap proxy user bind

2012-02-12 Thread Michael Ströder

sajuptpm wrote:

Yea i am not totally clear about that

Client's Requirement is
option to have a ldap proxy user bind to the ldap server if it needs
more directory rights than an anonymous bind.
option to use a ldap proxy user when searching.


As said: there's the proxy authorization control (see RFC 4370) for which a 
Python class exists in python-ldap. This is used e.g. in web applications if 
the user has successfully authenticated to the application and his identity 
should be used when processing ACLs in the LDAP server. In this case the 
proxy user is trusted entity to have done authentication right. The proxy 
authz control is sent by the application with each LDAP request. The server 
has to be correctly configured to accept that.


Another option is a LDAP proxy server which accepts anon requests and binds as 
a certain user. You could OpenLDAP with back-ldap or back-meta for that.


So you should ask your customer what's really needed.

Ciao, Michael.


--
http://mail.python.org/mailman/listinfo/python-list


Re: ldap proxy user bind

2012-02-11 Thread Michael Ströder

sajuptpm wrote:

I have developed a LDAP auth system using python-ldap module.
Using that i can validate username and password,  fetch user and
groups info from LDAP directory.
Now i want to implement ldap proxy user bind to the ldap server.


What do you mean exactly?

Are you talking about LDAPv3 proxy authorization
(see http://tools.ietf.org/html/rfc4370)?
If yes, then pass an instance of class ldap.controls.simple.ProxyAuthzControl 
to the LDAPObject methods when sending your LDAP requests. This is usable no 
matter how your proxy user has bound the directory. Another option is to send 
a SASL authz-ID along with the initial SASL bind request of your proxy user.


No matter what you have to get your LDAP server configuration right for this 
to work. Which LDAP server is it?



I googled and find this http://ldapwiki.willeke.com/wiki/LDAPProxyUser


AFAICS this web page talks about the proxy user for eDirectory's LDAP gateway 
to NDS. It's unlikely that this is relevant to your needs.



But i don't have any idea about how implement it usng python-ldap.
[..]
I want to add following 2 new flags

ldap_proxy_user = ldap_proxy
ldap_proxy_pwd = secret


Hmm, please don't take it personally but my impression is that you're not 
totally clear on what you need. Could you please try to explain what you want 
to achieve?


Ciao, Michael.
--
http://mail.python.org/mailman/listinfo/python-list


ANN: python-ldap 2.4.7

2012-01-20 Thread Michael Ströder

Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.4

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAPURLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.


Released 2.4.7 2012-12-19

Changes since 2.4.6:

Lib/
* Separate classes for request/response controls for RFC 3829
* Fixed ldap.schema.subentry.SubSchema.attribute_types() to
  also eliminate double attribute types in MAY clause of
  DIT content rule

Modules/
* Fixed memory leak (thanks to David Malcolm)


Released 2.4.6 2011-11-27

Changes since 2.4.5:

Lib/
* ldap.controls.ppolicy:
  Another fix for decoding the password policy response control
--
http://mail.python.org/mailman/listinfo/python-announce-list

   Support the Python Software Foundation:
   http://www.python.org/psf/donations/


ANN: python-ldap 2.4.7

2012-01-20 Thread Michael Ströder

Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.4

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAPURLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.


Released 2.4.7 2012-12-19

Changes since 2.4.6:

Lib/
* Separate classes for request/response controls for RFC 3829
* Fixed ldap.schema.subentry.SubSchema.attribute_types() to
  also eliminate double attribute types in MAY clause of
  DIT content rule

Modules/
* Fixed memory leak (thanks to David Malcolm)


Released 2.4.6 2011-11-27

Changes since 2.4.5:

Lib/
* ldap.controls.ppolicy:
  Another fix for decoding the password policy response control
--
http://mail.python.org/mailman/listinfo/python-list


ANN: python-ldap 2.4.5

2011-11-25 Thread Michael Ströder
Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.4

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAPURLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.


Released 2.4.5 2011-11-25

Changes since 2.4.4:

Installation:
* defines for SASL and SSL in setup.cfg to be more friendly to
  Python setup tools (easy_install)

Lib/
* Fixed typo in ldap.functions._ldap_function_call() which
  always released ldap._ldap_module_lock instead of local lock
* ldap.controls.ppolicy:
  Fixed decoding the password policy response control

Demo/
* Demo script for ldap.controls.ppolicy
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


ANN: python-ldap 2.4.5

2011-11-25 Thread Michael Ströder
Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.4

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAPURLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.


Released 2.4.5 2011-11-25

Changes since 2.4.4:

Installation:
* defines for SASL and SSL in setup.cfg to be more friendly to
  Python setup tools (easy_install)

Lib/
* Fixed typo in ldap.functions._ldap_function_call() which
  always released ldap._ldap_module_lock instead of local lock
* ldap.controls.ppolicy:
  Fixed decoding the password policy response control

Demo/
* Demo script for ldap.controls.ppolicy
-- 
http://mail.python.org/mailman/listinfo/python-list


ANN: python-ldap 2.4.4

2011-10-28 Thread Michael Ströder
Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.4

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAPURLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.


Released 2.4.4 2011-10-26

Changes since 2.4.3:

Modules/
* Format intermediate messages as 3-tuples instead of
  4-tuples to match the format of other response messages.
  (thanks to Chris Mikkelson)
* Fixes for memory leaks (thanks to Chris Mikkelson)

Lib/
* New experimental(!) sub-module ldap.syncrepl implementing syncrepl
  consumer (see RFC 4533, thanks to Chris Mikkelson)

Doc/
* Cleaned up rst files
* Added missing classes
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: [wanted] python-ldap for Python 2.3 / Win32

2011-10-26 Thread Michael Ströder
Waldemar Osuch wrote:
 I did try to build it using my current setup but it failed with some linking 
 errors.
 Oh well.

Waldemar, I really appreciate your Win32 support.

 Google gods were nicer to me.  Here is a couple alternative links.
 Maybe they will work for you.
 http://web.archive.org/web/20081101060042/http://www.agescibs.org/mauro/
 http://old.zope.org/Members/volkerw/LdapWin32/

Puh, this is really ancient stuff...

For Python historians:
http://python-ldap.cvs.sourceforge.net/python-ldap/python-ldap/CHANGES?view=markup

Ciao, Michael.
-- 
http://mail.python.org/mailman/listinfo/python-list


UnicodeError instead of UnicodeWarning

2011-10-25 Thread Michael Ströder
HI!

For tracking the cause of a UnicodeWarning I'd like to make the Python
interpreter to raise an UnicodeError exception with full stack trace. Is there
a short trick to achieve this?

Many thanks in advance.

Ciao, Michael.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: [wanted] python-ldap for Python 2.3 / Win32

2011-10-25 Thread Michael Ströder
Gilles Lenfant wrote:
 I have spent a couple of hours asking google, browsing Pypi, SF, and of
 course the official www.python-ldap.org site searching for a python-ldap
 installer for Python 2.3 on Windows 32 bits. Unsuccessfully :(

In theory even recent python-ldap 2.4.3 should still work with Python 2.3.
Please post your inquiry on the mailing-list python-l...@python.org (subscribe
before post). Maybe you can convince the maintainer of the Win32 packages there.

Ciao, Michael.
-- 
http://mail.python.org/mailman/listinfo/python-list


ANN: python-ldap 2.4.3

2011-07-23 Thread Michael Ströder
Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.3

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAPURLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.


Released 2.4.3 2011-07-23

Changes since 2.4.2:

Lib/
* Mostly corrected/updated __doc__ strings

Doc:
* Corrected rst files
* Added missing modules, functions, classes, methods, parameters etc.
  at least as auto-generated doc


Released 2.4.2 2011-07-21

Changes since 2.4.1:

Lib/

Logging:
* pprint.pformat() is now used when writing method/function
  arguments to the trace log

ldap.schema.subentry:
* SubSchema.__init__() now has new key-word argument check_uniqueness
  which enables checking whether OIDs are unique in the subschema subentry
* Code-cleaning: consequent use of method SubSchema.getoid() instead of
  accessing SubSchema.name2oid directly.
* SubSchema.getoid() and SubSchema.getoid() now have key-word argument
  raise_keyerror=0 and raise KeyError with appropriate description.
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


ANN: python-ldap 2.4.3

2011-07-23 Thread Michael Ströder
Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.3

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAPURLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.


Released 2.4.3 2011-07-23

Changes since 2.4.2:

Lib/
* Mostly corrected/updated __doc__ strings

Doc:
* Corrected rst files
* Added missing modules, functions, classes, methods, parameters etc.
  at least as auto-generated doc


Released 2.4.2 2011-07-21

Changes since 2.4.1:

Lib/

Logging:
* pprint.pformat() is now used when writing method/function
  arguments to the trace log

ldap.schema.subentry:
* SubSchema.__init__() now has new key-word argument check_uniqueness
  which enables checking whether OIDs are unique in the subschema subentry
* Code-cleaning: consequent use of method SubSchema.getoid() instead of
  accessing SubSchema.name2oid directly.
* SubSchema.getoid() and SubSchema.getoid() now have key-word argument
  raise_keyerror=0 and raise KeyError with appropriate description.
-- 
http://mail.python.org/mailman/listinfo/python-list


ANN: python-ldap 2.4.1

2011-07-05 Thread Michael Ströder
Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.1

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAPURLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.


Released 2.4.1 2011-07-05

Changes since 2.4.0:

Modules:
* New LDAP option OPT_X_TLS_PACKAGE available in OpenLDAP 2.4.26+
  to determine the name of the SSL/TLS package OpenLDAP was
  built with

Lib/
* ldap.modlist.modifyModlist(): New key-word argument
  case_ignore_attr_types used to define attribute types for which
  comparison of old and new values should be case-insensitive
* Minor changes to which data is sent to debug output for various
  trace levels
* Now tag [1] is used in ldap.extop.dds.RefreshResponse in
  compliance with RFC 2589 (fix available for OpenLDAP ITS#6886)
* New sub-module ldap.controls.sessiontrack implements request control
  as described in draft-wahl-ldap-session (needs pyasn1_modules)
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


ANN: python-ldap 2.4.1

2011-07-05 Thread Michael Ströder
Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.1

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAPURLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.


Released 2.4.1 2011-07-05

Changes since 2.4.0:

Modules:
* New LDAP option OPT_X_TLS_PACKAGE available in OpenLDAP 2.4.26+
  to determine the name of the SSL/TLS package OpenLDAP was
  built with

Lib/
* ldap.modlist.modifyModlist(): New key-word argument
  case_ignore_attr_types used to define attribute types for which
  comparison of old and new values should be case-insensitive
* Minor changes to which data is sent to debug output for various
  trace levels
* Now tag [1] is used in ldap.extop.dds.RefreshResponse in
  compliance with RFC 2589 (fix available for OpenLDAP ITS#6886)
* New sub-module ldap.controls.sessiontrack implements request control
  as described in draft-wahl-ldap-session (needs pyasn1_modules)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: LDAP: How get all users belongs to a group.

2011-06-25 Thread Michael Ströder
sajuptpm wrote:
 results = ldapClient.search_s(cn=My-Group-1,ou=Groups,o=CUST,
 ldap.SCOPE_BASE)
 
 Is this method work for all types of groups (groupOfNames,
 posixGroup) ???

Yes, but the member attribute differs.

'member' in entries of object class 'groupOfNames' contains the DN of the
member's entry.

'memberUID' in entries of object class 'posixGroup' contains the 'uid' of the
member's entry if the original RFC 2307 is used. If the LDAP server uses a
draft-howard-rfc2307bis it behaves like groupOfNames.

Also there's object class 'groupOfUniqueNames' used most times on Sun DS which
contains the DN of the member's entry in attribute 'uniqueMember'.

Additionally organizationalRole - roleOccupant contains DN of the member's
entry...

The default config of my web2ldap contains even more:

- snip -

# The definitions for group entry administration
groupadm_defs={
  'groupOfNames':   ('member',None),
  'groupOfUniqueNames': ('uniqueMember',None),
  'organizationalRole': ('roleOccupant',None),
  'rfc822MailGroup':('mail','mail'),
  'nisMailAlias':   ('rfc822MailMember','mail'),
  'mailGroup':  ('mgrprfc822mailmember','mail'),
  # Found on IBM SecureWay Directory
  'accessGroup':('member',None),
  # RFC2370
  'posixGroup': ('memberUid','uid'),
  'nisNetgroup':('memberNisNetgroup','uid'),
  # Samba 3.0
  'sambaGroupMapping':  ('sambaSIDList','sambaSID'),
  # Active Directory
  'group':  ('member',None),
  # draft-findlay-ldap-groupofentries
  'groupOfEntries': ('member',None),
  # Apple MAC OS X
  'apple-group':('apple-group-memberguid','apple-generateduid'),
},

- snip -

Ciao, Michael.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: User Authentication

2011-06-24 Thread Michael Ströder
Anurag wrote:
 My application is a web based application for both windows and Linux.
 The web part is developed using Django. So if Python does not support
 it then any support for local sytem account authentication in Django?
 
 I am looking for a common library for both Linux and Windows. Any help
 will be Gr8

Doesn't Django provide an abstraction layer for accessing differnt
authentication backends? I guess you have to write/use two different
authentication modules for the two different mechanisms.

A quick search looks promising:

http://www.google.com/search?q=django+ldap+authentication

Ciao, Michael.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: LDAP: How get all users belongs to a group.

2011-06-24 Thread Michael Ströder
sajuptpm wrote:
 How get all users belongs to a group using python ldap module.

There are several ways of storing grouping information in a LDAP server.

I assume the groups are normal group entries of object class 'groupOfNames'
which is most commonly used. Such an entry has the attribute 'member' which
contains DNs of all member entries which you would have to read yourself. This
can be quite annoying for large group entries since you would have to send a
search request for each group member.

Therefore on some servers you can search for a back-link attribute in the user
entries. Most times it's called 'memberOf' or 'isMemberOf'. But this depends
on the server's implemented features and configuration.

Which LDAP server are you using?

Ciao, Michael.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: LDAP: How get all users belongs to a group.

2011-06-24 Thread Michael Ströder
sajuptpm wrote:
 --- User
 
 cn=AJP2203,ou=Internal PCA,o=CUST has group memberships
 to the following Groups:
 groupMembership: cn=My-Group-1,ou=Groups,o=CUST
 groupMembership: cn=My-Group-2,u=Groups,o=CUST
 groupMembership: cn=My-Group-3,ou=Groups,o=CUST
 
 --- Group
 
 dn: cn=My-Group-1, ou=Groups, o=CUST
 equivalentToMe: cn=TDS7034,ou=Internal PCA,o=CUST
 objectClass: groupOfNames  
 objectClass: top
 objectClass: swarePointers
 ACL: 2#entry#[Root]#member
 cn: My-Group-1
 member: cn=AJP2203,ou=Internal PCA,o=CUST
 member: cn=AZE9632,ou=Internal PCA,o=CUST
 member: cn=BTC4979,ou=Internal PCA,o=CUST
 
 -
 
 * We will get groups of a member from member record, using key
 'groupMembership'.
 * But i want to get members belogs to a particular group Eg:'My-
 Group-1'

If this is the server's data the LDAP server seems to be Novell eDirectory not
OpenLDAP.

I'd try member search with this filter:

  (groupMembership=cn=My-Group-1,ou=Groups,o=CUST)

Ciao, Michael.
-- 
http://mail.python.org/mailman/listinfo/python-list


ANN: python-ldap 2.4.0

2011-06-03 Thread Michael Ströder

Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.0

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAPURLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.


Released 2.4.0 2011-06-02

Changes since 2.3.13:

* OpenLDAP 2.4.11+ required to build
* Support for extracting LDAPv3 extended controls in
  LDAP_RES_SEARCH_ENTRY responses
  (see SF#2829057, thanks to Rich)
* Generic support for LDAPv3 extended operations (thanks to Rich)

Lib/
* new class API in ldap.controls, not backwards-compatible!
* new sub-modules for ldap.controls, some require pyasn1 and pyasn1_modules
* New methods LDAPObject.result4() and LDAPObject.extop_result()
* New (optional) class ldap.controls.AssertionControl
* New helper module ldap.logger contains file-like object which
  sends trace messages to logging.log()
* Removed non-functional method LDAPObject.set_cache_options()
* Removed unused dictionary ldap.controls.knownLDAPControls

Modules/
* ldapcontrol.c: Fixed encode_assertion_control() and function is no longer
  hidden behind ifdef-statement

--
http://mail.python.org/mailman/listinfo/python-announce-list

   Support the Python Software Foundation:
   http://www.python.org/psf/donations/


ANN: python-ldap 2.4.0

2011-06-03 Thread Michael Ströder

Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.4.0

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAPURLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.


Released 2.4.0 2011-06-02

Changes since 2.3.13:

* OpenLDAP 2.4.11+ required to build
* Support for extracting LDAPv3 extended controls in
  LDAP_RES_SEARCH_ENTRY responses
  (see SF#2829057, thanks to Rich)
* Generic support for LDAPv3 extended operations (thanks to Rich)

Lib/
* new class API in ldap.controls, not backwards-compatible!
* new sub-modules for ldap.controls, some require pyasn1 and pyasn1_modules
* New methods LDAPObject.result4() and LDAPObject.extop_result()
* New (optional) class ldap.controls.AssertionControl
* New helper module ldap.logger contains file-like object which
  sends trace messages to logging.log()
* Removed non-functional method LDAPObject.set_cache_options()
* Removed unused dictionary ldap.controls.knownLDAPControls

Modules/
* ldapcontrol.c: Fixed encode_assertion_control() and function is no longer
  hidden behind ifdef-statement

--
http://mail.python.org/mailman/listinfo/python-list


Re: Active Directory user creation with python-ldap

2011-04-29 Thread Michael Ströder
Nello wrote:
 I need to create an Active Directory user using python-ldap library. So, I
 authenticate with an admin account and I use add_s to create the user.

This is possible. Which version of AD are you working with.

 Anyway, by default users are disabled on creation,

That's the correct way of doing this.

 and I can not set
 userAccountControl to swith off the flag ACCOUNTDISABLE, i.e. setting
 userAccountControl with 512 (NORMAL_ACCOUNT) value. 

This should be possible. Make sure you really bind as the admin and you have
sufficient access rights.

Check your code. I'd suggest to set trace_level when calling ldap.initialize()
to observe what gets passed to python-ldap in which order.

http://www.python-ldap.org/doc/html/ldap.html#ldap.initialize

 Same thing if - as someone suggests - I create the user without a
 password and try to set userAccountCreation later.

Passwords are different anyway since you have to set the unicodePwd attribute.
I never tried to do this with a single write operation though.

You can try my web2ldap which does all this also with MS AD. It has a special
plugin class for attribute userAccountControl which lets you set values
bit-wise when modifying an user entry. And setting password automagically
switches to setting unicodePwd when working with MS AD.

Ciao, Michael.
-- 
http://mail.python.org/mailman/listinfo/python-list


New mailing list for python-ldap

2011-04-01 Thread Michael Ströder
HI!

The old SF mailing list python-ldap-dev was shut down today.

I'd be happy to see you on the new mailing list for
http://python-ldap.org under the umbrella of python.org.

List info here:
http://mail.python.org/mailman/listinfo/python-ldap

All announcements, discussion and support related to python-ldap can be posted
there.

Ciao, Michael.

-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


New mailing list for python-ldap

2011-04-01 Thread Michael Ströder
HI!

The old SF mailing list python-ldap-dev was shut down today.

I'd be happy to see you on the new mailing list for
http://python-ldap.org under the umbrella of python.org.

List info here:
http://mail.python.org/mailman/listinfo/python-ldap

All announcements, discussion and support related to python-ldap can be posted
there.

Ciao, Michael.

-- 
http://mail.python.org/mailman/listinfo/python-list


ANN: python-ldap-2.3.13

2011-02-19 Thread Michael Ströder
Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.3.13

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAPURLs and LDAPv3 schema).

Note: This is the last release with this feature set. From now on only very
urgent fixes are going into release series 2.3.x.

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.


Released 2.3.13 2011-02-19

Changes since 2.3.12:

Modules/
* Correct #ifdef-statement for LDAP_OPT_X_TLS_CRLFILE in
  constants.c fixes build with older OpenLDAP libs
* Support for LDAP_OPT_DEFBASE (see SF#3072016, thanks to Johannes)

-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


ANN: python-ldap-2.3.13

2011-02-19 Thread Michael Ströder
Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.3.13

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAPURLs and LDAPv3 schema).

Note: This is the last release with this feature set. From now on only very
urgent fixes are going into release series 2.3.x.

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.


Released 2.3.13 2011-02-19

Changes since 2.3.12:

Modules/
* Correct #ifdef-statement for LDAP_OPT_X_TLS_CRLFILE in
  constants.c fixes build with older OpenLDAP libs
* Support for LDAP_OPT_DEFBASE (see SF#3072016, thanks to Johannes)

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Streaming templating languages for use as WSGI body.

2011-01-07 Thread Michael Ströder
Alice Bevan–McGregor wrote:
 On 2011-01-06 11:11:27 -0800, Adam Tauno Williams said:
 On Thu, 2011-01-06 at 11:07 -0800, Alice Bevan–McGregor wrote:
 On 2011-01-06 10:00:39 -0800, Adam Tauno Williams said:
 With HTTP/1.0 [and WSGI is HTTP/1.0 only] you have to provide a
 Content-Length header - so you have to generate the entire response
 at once [however you want to muddy at once].

 Both of these statements are false.

 Both these statements are true!  I suggest you consult the HTTP spec.
 
 It's generally polite to provide direct references, either sections or
 actual links when asking someone to RTFM.  No matter, examining the
 HTTP/1.0 RFC (conveniently chopped up and HTML-ified by the w3) I find
 evidence to support your argument:
 
 http://www.w3.org/Protocols/HTTP/1.0/draft-ietf-http-spec.html#Entity-Body

As I read section 7.2.2 (Length) the Content-length header is only required in
HTTP *requests* if the body contains data. According to the text it's not
required in HTTP *responses*.

Ciao, Michael.
-- 
http://mail.python.org/mailman/listinfo/python-list


ANN: python-ldap-2.3.12

2010-08-09 Thread Michael Ströder
Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.3.12

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAPURLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.

-- 
Michael Ströder
E-Mail: mich...@stroeder.com
http://www.stroeder.com


Released 2.3.12 2010-08-05

Changes since 2.3.11:

Lib/
* Removed tabs from various modules to make things work with python -tt.
* Quick fix to ldif.is_dn() to let multi-valued RDNs pass as valid.
  Is too liberal in some corner-cases though...
* Fix to ldif.is_dn() to allow dashes in attribute type (see SF#3020292)
* ldap.open() now outputs a deprecation warning
* module-wide locking is now limited to calling _ldap.initialize().
  Still ldap.functions._ldap_function_call() is used to wrap all
  calls for writing debug log.

Modules/
* New LDAP options available in OpenLDAP 2.4.18+ supported in
  LDAPObject.get/set_option():
  ldap.OPT_X_KEEPALIVE_IDLE, ldap.OPT_X_KEEPALIVE_PROBES,
  ldap.OPT_X_KEEPALIVE_INTERVAL,
  ldap.OPT_X_TLS_CRLCHECK, ldap.OPT_X_TLS_CRLFILE

Doc/
* Various small updates/improvements

-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


ANN: python-ldap-2.3.12

2010-08-09 Thread Michael Ströder
Find a new release of python-ldap:

  http://pypi.python.org/pypi/python-ldap/2.3.12

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAPURLs and LDAPv3 schema).

Project's web site:

  http://www.python-ldap.org/

Ciao, Michael.

-- 
Michael Ströder
E-Mail: mich...@stroeder.com
http://www.stroeder.com


Released 2.3.12 2010-08-05

Changes since 2.3.11:

Lib/
* Removed tabs from various modules to make things work with python -tt.
* Quick fix to ldif.is_dn() to let multi-valued RDNs pass as valid.
  Is too liberal in some corner-cases though...
* Fix to ldif.is_dn() to allow dashes in attribute type (see SF#3020292)
* ldap.open() now outputs a deprecation warning
* module-wide locking is now limited to calling _ldap.initialize().
  Still ldap.functions._ldap_function_call() is used to wrap all
  calls for writing debug log.

Modules/
* New LDAP options available in OpenLDAP 2.4.18+ supported in
  LDAPObject.get/set_option():
  ldap.OPT_X_KEEPALIVE_IDLE, ldap.OPT_X_KEEPALIVE_PROBES,
  ldap.OPT_X_KEEPALIVE_INTERVAL,
  ldap.OPT_X_TLS_CRLCHECK, ldap.OPT_X_TLS_CRLFILE

Doc/
* Various small updates/improvements

-- 
http://mail.python.org/mailman/listinfo/python-list


python-crypto list has a new home

2010-07-21 Thread Michael Ströder
HI!

The python-crypto mailing list had to move to a new mailing list service. The
natural choice was to move under the umbrella of python.org.

The new list address is: python-cry...@python.org

My archive of the old postings was imported to the new list service:

http://mail.python.org/pipermail/python-crypto/

For various reasons I will *not* migrate the subscriptions of the old
PYTHON-CRYPTO list at SURFnet#s LISTSERV! So you have to manually subscribe to
this new list:

http://mail.python.org/mailman/listinfo/python-crypto

Hope to see you all there soon.

Ciao, Michael.

-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


Re: python ldap recursive

2010-07-15 Thread Michael Ströder
tekion wrote:
 I know perl Net::LDAP could do a recursive search call to LDAP.

I don't know perl's Net::LDAP and therefore I'm not sure what you mean with
recursive search call. Personally I'd associate that with recursively
processing LDAP tree structure.

 What I am running into with Python LDAP on the search call is that I would 
 l have to wait for the search to complete to get the result.  Where as with
 Perl recursive search call,  I would get the result (not the completed
 result) back while the search is still running.

In case you're using http://www.python-ldap.org you're probably looking for
the asynchronous search methods:

http://www.python-ldap.org/doc/html/ldap.html#ldap.LDAPObject.search

See general note:

http://www.python-ldap.org/doc/html/ldap.html#sending-ldap-requests

Ciao, Michael.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: [Python-Dev] [RELEASED] 2.7 beta 1

2010-04-10 Thread Michael Ströder
average wrote:
 On behalf of the Python development team, I'm merry to announce the first 
 beta
 release of Python 2.7.

 Python 2.7 is scheduled (by Guido and Python-dev) to be the last major 
 version
 in the 2.x series.  Though more major releases have not been absolutely ruled
 out, it's likely that the 2.7 release will an extended period of maintenance 
 for
 the 2.x series.
 
 May I propose that the developers consider keeping this release *beta*
 until after the present Python moratorium?  That is, don't let it be
 marked as *official* until after, say, Python 3.3.
 
 There are so many features taken from 3.0 that I fear that it will
 postpone its adoption interminably

Whether 3.x is adopted by developers is IMO not influenced by the 2.7 release
schedule. At least the effect is highly speculative. So please simply release
2.7 when it's ready.

Ciao, Michael.
-- 
http://mail.python.org/mailman/listinfo/python-list


ANN: python-ldap-2.3.11

2010-02-26 Thread Michael Ströder
Find a new release of python-ldap:

  http://www.python-ldap.org/

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAPURLs and LDAPv3 schema).

Ciao, Michael.

-- 
Michael Ströder
E-Mail: mich...@stroeder.com
http://www.stroeder.com


Released 2.3.11 2010-02-26

Changes since 2.3.10:

Lib/
* Fixed LDAP URL parsing with four ? but no real extensions
* ldap.ldapobject.LDAPObject.rename_s() now also accepts arguments
  serverctrls and clientctrls
* Removed untested and undocumented class ldap.ldapobject.SmartLDAPObject
* Removed broken method ldap.ldapobject.LDAPObject.manage_dsa_it()

Modules/
* Make use of LDAP_OPT_X_TLS_NEWCTX only if available in
  OpenLDAP libs used for the build
* Fixed #ifdef-statements for OPT_X_TLS_PROTOCOL_MIN

Doc/
* Some updates and corrections regarding description of use of
  LDAPv3 controls
* Some more descriptions for constants
* Removed comments related to old LaTeX-based documentation system


-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


ANN: python-ldap-2.3.11

2010-02-26 Thread Michael Ströder
Find a new release of python-ldap:

  http://www.python-ldap.org/

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAPURLs and LDAPv3 schema).

Ciao, Michael.

-- 
Michael Ströder
E-Mail: mich...@stroeder.com
http://www.stroeder.com


Released 2.3.11 2010-02-26

Changes since 2.3.10:

Lib/
* Fixed LDAP URL parsing with four ? but no real extensions
* ldap.ldapobject.LDAPObject.rename_s() now also accepts arguments
  serverctrls and clientctrls
* Removed untested and undocumented class ldap.ldapobject.SmartLDAPObject
* Removed broken method ldap.ldapobject.LDAPObject.manage_dsa_it()

Modules/
* Make use of LDAP_OPT_X_TLS_NEWCTX only if available in
  OpenLDAP libs used for the build
* Fixed #ifdef-statements for OPT_X_TLS_PROTOCOL_MIN

Doc/
* Some updates and corrections regarding description of use of
  LDAPv3 controls
* Some more descriptions for constants
* Removed comments related to old LaTeX-based documentation system


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: UnicodeDecodeError? Argh! Nothing works! I'm tired and hurting and...

2009-12-03 Thread Michael Ströder
Aahz wrote:
 In article 031bc732$0$1336$c3e8...@news.astraweb.com,
 Steven D'Aprano  st...@remove-this-cybersource.com.au wrote:
 Good grief, it's about six weeks away from 2010 and Thunderbird still 
 uses mbox as it's default mail box format. Hello, the nineties called, 
 they want their mail formats back! Are the tbird developers on crack or 
 something? I can't believe that they're still using that crappy format.
 
 Just to be contrary, I *like* mbox.

Me too. :-)

Ciao, Michael.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Linux, Python 2.5.2, serverless binding LDAP?

2009-11-13 Thread Michael Ströder
Kevin Cole wrote:
 On Nov 12, 8:01 pm, alex23 wuwe...@gmail.com wrote:
 On Nov 13, 10:47 am, Kevin Cole dc.l...@gmail.com wrote:
 I recently asked our IT department how to gain access to an
 addressbook.  After carefully explaining that I was on a Linux system
 using Python, I got the reply:
 You should use our LDAP. With LDAP you can pull any data you want
 from Active Directory. On our network, the serverless binding address
 for our LDAP is ldap://dc=...,dc=...,dc=...,dc=...;
 with the actual ... filled in.
 I don't know squat about LDAP, but installed the python-ldap deb, and
 started glancing at the documentation on-line. I didn't see anything
 obvious for working with the URI above.  Can I work w/ it?  If so, a
 short example, please?
 Thanx.
 http://www.python-ldap.org/doc/html/ldapurl.html#example
 
 Ah, it wasn't clear to me that localhost:1389 meant serverless.
 Armed with that, I'm off to experiment.

localhost:1389 means localhost on port 1389. It has nothing to do with
server-less bind.

Server-less bind is based on a DNS lookup: Let's say you want to query the DNS
server for returning the LDAP server(s) for naming context dc=uninett,dc=no
then invoke on the command-line:

$ host -t srv _ldap._tcp.uninett.no.
_ldap._tcp.uninett.no has SRV record 0 0 389 ldap.uninett.no.

That is also heavily used with MS AD.

Off course you can do this SRV lookup with http://pydns.sf.net which is
actually done in my LDAP client http://web2ldap.de:

http://demo.web2ldap.de:1760/web2ldap?ldap:///dc=uninett,dc=no??one

Ciao, Michael.

-- 
Michael Ströder
E-Mail: mich...@stroeder.com
http://www.stroeder.com
-- 
http://mail.python.org/mailman/listinfo/python-list


ANN: python-ldap-2.3.10

2009-11-01 Thread Michael Ströder
Find a new release of python-ldap:

  http://www.python-ldap.org/

python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. processing LDIF, LDAPURLs and LDAPv3 schema).

Ciao, Michael.

-- 
Michael Ströder
E-Mail: mich...@stroeder.com
http://www.stroeder.com
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


  1   2   3   >