Re: ldap.ENCODING_ERROR when trying to use SimplePageResultsControl

2009-03-03 Thread Russell Jackson
Michael Ströder wrote:
> It seems you're running on a 64-bit platform. I did never test
> python-ldap on such a system. Which version of python-ldap is it? Did
> you compile it yourself? Which versions of OpenLDAP libs are used?
> 

Just as a data point, I've been running python-ldap (from ports) on 
FreeBSD-amd64 since
6.x without issue.

-- 
Russell A. Jackson 
Network Analyst
California State University, Bakersfield

Q:  What do they call the alphabet in Arkansas?
A:  The impossible dream.



signature.asc
Description: OpenPGP digital signature
--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H___
Python-LDAP-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/python-ldap-dev


Re: Any example of Server/Client Side Sorting?

2009-05-14 Thread Russell Jackson
Michael Ströder wrote:
> Zhang Huangbin wrote:
>> Michael Ströder wrote:
>> Tring to learn ldap programing from web2ldap now. Thanks for your great
>> program. :)
> 
> Bear in mind that I started learning Python when the first code was
> written almost 11 years ago. So I have to admit that many parts are
> really ugly code and not really good programming examples.

Every programmer I've ever talked to always thinks their own code sucks.

-- 
Russell A. Jackson 
Network Analyst
California State University, Bakersfield

With a gentleman I try to be a gentleman and a half, and with a fraud I
try to be a fraud and a half.
-- Otto von Bismarck



signature.asc
Description: OpenPGP digital signature
--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com___
Python-LDAP-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/python-ldap-dev


Re: ldap.passwd_s with Active Direcory

2009-08-05 Thread Russell Jackson
[email protected] wrote:
>> -Original Message-
>> From: Michael Ströder [mailto:[email protected]]
>> Sent: 04 August 2009 18:23
>> To: Mike Peters
>> Cc: [email protected]
>> Subject: Re: ldap.passwd_s with Active Direcory
>>
>> [email protected] wrote:
 There's a MSDN article about how to set attribute unicodePwd via
>> LDAP
 in AD.
>>> If I try the alternative method however:
>>>
>>> mod_attrs = [( ldap.MOD_REPLACE, 'unicodePwd', 'password' )]
>>> dn = 'CN=Barney Rubble,OU=Users,DC=mydomain,dc=local'
>>> r = l.modify_s(dn, mod_attrs)
>>>
>>> I get:
>>>
>>> {'info': '001F: SvcErr: DSID-031A0FC0, problem 5003
>> (WILL_NOT_PERFORM), data 0\n', 'desc': 'Server is unwilling to
>> perform'}
>>> I guess I'm still missing something :(
>> Did you search for the MSDN article? The value has to be in your case
>> above:
>>
>> '"password"'.encode('utf-16-le')
>>
>> Note the quotes and the UTF-16 low-endian encoding.
>>
> 
> Thanks again for your help. I tried that but to no avail. I still get the 
> same error. Do you know if the fact I'm accessing the server over a VPN would 
> make any difference?
> 

For what it's worth, this is the working code I use to set the password. I 
didn't realize
you could use the -le suffix to get an encoding without the byte order mark 
which I've
just been stripping off. The example posted above should be equivalent.

ldap_conn.modify_s(dn, [
(
ldap.MOD_REPLACE,
'unicodePwd',
''.join(('"', pwd, '"')).encode('utf-16').lstrip('\377\376'),
)
])

Another thing to note is that the connection must be under a TLS layer.

-- 
Russell A. Jackson 
Network Analyst
California State University, Bakersfield

Excellent day to have a rotten day.



signature.asc
Description: OpenPGP digital signature
--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july___
Python-LDAP-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/python-ldap-dev