Re: Error trying to add attribute to existing class

2012-04-05 Thread Prentice Bisbal
fined properly. I was leaving off the "cn=" at the start. My code has been reduced to this, which works: $mesg = $ldap->modify($group_dn, add => { 'memberUid' => "$username" }, ); Prentice On 04/05/2012 01:55 PM, Prentice Bisbal wrote:

Error trying to add attribute to existing class

2012-04-05 Thread Prentice Bisbal
Dear Net::LDAPers, I'm using Net:LDAP to add/remove user accounts from LDAP. I've created a subroutine that adds the user to a group after their account is already created. I'm trying to add an additional MemberUID attribute to an existing posixGroup object. Here's my subroutine: sub ldap_add_gro

Re: Use of uninitialized value $cn in substitution (s///) at ...

2012-03-08 Thread Prentice Bisbal
On 03/08/2012 03:44 AM, Clément OUDOT wrote: > Le 7 mars 2012 21:43, Prentice Bisbal a écrit : >> Okay, >> >> I'm sure this error has come up repeatedly on this list, but I've >> googled and googled, and can't find an answer, probably because "Use o

Active Directory: problem 1001 (NO_ATTRIBUTE_OR_VAL)

2012-03-07 Thread Prentice Bisbal
I have another Active Directory related question. When I updated a password in AD as an AD aministrator, I get this error: 2085: AtrErr: DSID-031906A5, #1: 0: 2085: DSID-031906A5, problem 1001 (NO_ATTRIBUTE_OR_VAL), data 0, Att 9005a (unicodePwd):len 20 at sns_passwd.pl line 214.

Use of uninitialized value $cn in substitution (s///) at ...

2012-03-07 Thread Prentice Bisbal
Okay, I'm sure this error has come up repeatedly on this list, but I've googled and googled, and can't find an answer, probably because "Use of unitialized value" comes up for just about every perl error. I'm an occasional Perl programmer that occasionally used Net::LDAP. I'm trying to connect to

Re: Is it possible to use Unix user-based authentication for LDAP?

2011-08-17 Thread Prentice Bisbal
On 08/17/2011 02:39 PM, Andrej wrote: > On 13 August 2011 02:30, Mehmet wrote: >> Is there a way to use methods that require write access (add, delete, etc) >> without providing a password? I want my script run as a cronjob and I do not >> want to keep the password in a file or the code itself. In

Re: Is it possible to use Unix user-based authentication for LDAP?

2011-08-15 Thread Prentice Bisbal
I think Kerberos authentication will do what you need. This will require setting up a kerberos server, but that's not too difficult, but if this is the only think you need it for, it might be overkill. Prentice On 08/12/2011 10:30 AM, Mehmet wrote: > Hi everyone, > > Your great replies to my pre

Re: Can't change passwd in AD 2008 R2

2011-04-28 Thread Prentice Bisbal
y" with > wire encryption. > > If I don't use encryption, AD rejects all security related changes. > > Hope that helps. > > --Dan > > -Original Message- > From: Prentice Bisbal [mailto:prent...@ias.edu] > Sent: Thursday, April 28, 2011 3:07 PM &

Re: Can't change passwd in AD 2008 R2

2011-04-28 Thread Prentice Bisbal
'supersecretpw' -f > new_users_pw.ldif -H ldaps://dc01.mycompany.com -Z > > I typically write perl code to create LDIF files, then use "ldappmodify" with > wire encryption. > > If I don't use encryption, AD rejects all security related changes. > >

Can't change passwd in AD 2008 R2

2011-04-28 Thread Prentice Bisbal
We recently updated our Active Directory servers to 2008 R2. I had a perl script that would change a users password in OpenLDAP and Active Directory at the same time. This was working fine until the update. I can still change a user's password when I bind as an AD administrator, but not as a normal

Re: Password modify

2011-02-18 Thread Prentice Bisbal
t; $new_passwd); -- Prentice Robert Threet wrote: > I injected the dn but now it complains - objectclass person requires > surname. Tried them all - they all say that. Grr! Just want to change > the password without knowing the old password. > > On 02/18/2011 10:40 AM, Prentic

Re: Password modify

2011-02-18 Thread Prentice Bisbal
Robert, I have been using Net::LDAP to create accounts one at a time for about a year now. Based on the error you are seeing, I suspect that you are forgetting to add the correct objectClass that contains the attribute you want to store the attribute in. Searching your code, I don't see you addin

Re: What's wrong with this code?

2011-02-18 Thread Prentice Bisbal
Chris Ridd wrote: > On 17 Feb 2011, at 21:13, Prentice Bisbal wrote: > >> I cut off the last line of the errors, which says this, which might be >> an additional clue: >> >> ntUserDomainId: value #0 invalid per syntax > > What does your $ntUserDomainId val

Re: What's wrong with this code?

2011-02-17 Thread Prentice Bisbal
dd function. A subtle mistake that I kept overlooking. I used the debugger, but was checking it's value as soon as it was defined, and not where the error was actually occuring. D'oh! Thanks again for all the quick, helpful response. Prentice Prentice Bisbal wrote: > Okay guys, I n

Re: What's wrong with this code?

2011-02-17 Thread Prentice Bisbal
John Perkins wrote: > On 02/17/2011 03:04 PM, Prentice Bisbal wrote: >> Okay guys, I need another pair of eyes to try find an error in my code. >> Can any of you see anything wrong with this bit of code? >> >> $mesg = $entry->add('objectClass'

Re: What's wrong with this code?

2011-02-17 Thread Prentice Bisbal
I cut off the last line of the errors, which says this, which might be an additional clue: ntUserDomainId: value #0 invalid per syntax This makes me think somewhere an array is being used instead of a string. Prentice Bisbal wrote: > Okay guys, I need another pair of eyes to try find an er

Re: What's wrong with this code?

2011-02-17 Thread Prentice Bisbal
Robert Threet wrote: > Just for testing - turn off warnings and strict and see if it runs. > > Also - did you see a post from me on this list earlier? I thought you > got copies of your own posts but I haven't see it nor a response. > > On 02/17/2011 03:04 PM, Prentice

What's wrong with this code?

2011-02-17 Thread Prentice Bisbal
Okay guys, I need another pair of eyes to try find an error in my code. Can any of you see anything wrong with this bit of code? $mesg = $entry->add('objectClass' => 'ntUser', 'ntUserDomainId' => $ntUserDomainId, 'ntUserHomeDir' => "host.tld\\home\\$ntUserDomain

Re: Converting from UTF-8 to ASCII for gecos field.

2010-10-14 Thread Prentice Bisbal
Graham Barr wrote: > On Oct 14, 2010, at 13:47 , Prentice Bisbal wrote: >> Greetings. >> >> Can anyone suggest a good way of converting a string from UTF-8 to IA5 >> (ASCII) for the gecos attribute. For example, I have the hypotheical >> user Ërïç Cärtmân, with a

Converting from UTF-8 to ASCII for gecos field.

2010-10-14 Thread Prentice Bisbal
Greetings. Can anyone suggest a good way of converting a string from UTF-8 to IA5 (ASCII) for the gecos attribute. For example, I have the hypotheical user Ërïç Cärtmân, with a lot of accented characters in his name converting his name to ASCII using this code: my $gecos = encode('ascii', $cn);

Re: hashing ldap entries

2010-09-28 Thread Prentice Bisbal
Robert Threet wrote: > IS there a method of calling SSHA when stuffing passwords into the > directory? > Do you mean to encrypt the passwords with SSHA, or to make sure SSL is being used when adding passwords? -- Prentice Bisbal Linux Software Support Specialist/System Administrator

Re: Having trouble with TLS and server verification

2010-07-13 Thread Prentice Bisbal
fy => 'require', >> capath => '/etc/ssl/certs/', >> ); >> die $mesg->error if $mesg->is_error; >> >> All the certs in the chain are signed with SHA512RSA. Also the CA Cert is >> 4096 bits and the server certs I am checking

Re: Unable to ADD or MODIFY entries using NET::LDAP (2)

2010-04-22 Thread Prentice Bisbal
I just noticed this is your code: #--- # Programmer note: # # "$mesg->error" DOESN'T work!!! I think that's another sign you are doing something wrong. I use $error = $mesg->error(); and $error = $mesg->error; throughout my code. The parentheses are irrelevant. I'm using both Perl-LDAP 0.33

Re: Unable to ADD or MODIFY entries using NET::LDAP (2)

2010-04-22 Thread Prentice Bisbal
Piet, Two things: 1. Write a smaller "toy" program to test the function you having problems with. This will help you find out if your calling the function correctly without getting distracted by all the other code and it will help us read through your code. You're providing way too much code to u

Re: SSL/TLS does not check hostname in cert

2010-03-31 Thread Prentice Bisbal
Chris Ridd wrote: > On 31 Mar 2010, at 19:25, Prentice Bisbal wrote: > >> It's my understanding that using LDAPS->new or $ldap->start_tls with the >> option >> >> verify => 'require' >> >> Should verify that the host name

Re: Anonymous searches fail with 'invalid DN'

2010-03-31 Thread Prentice Bisbal
Nevermind - I found the source of the "Invalid DN" error - A typo in my command. sorry. Prentice Bisbal wrote: > In a subsequent section of the same search, I'm trying to do an > anonymous search. Anonymous binding works (or more accurately, doesn't > produce an e

Anonymous searches fail with 'invalid DN'

2010-03-31 Thread Prentice Bisbal
In a subsequent section of the same search, I'm trying to do an anonymous search. Anonymous binding works (or more accurately, doesn't produce an error code). Hoever, when I do search using the same LDAP handle, I get an error. I know anonymous searching is allowed, and I can verify this using ldap

SSL/TLS does not check hostname in cert

2010-03-31 Thread Prentice Bisbal
= $ldap->start_tls(verify => 'require', cafile => $cafile ); $code = $mesg->code; if ($code != 0) { $error = $mesg->error; print "Could not start TLS\n"; print "$error\n"; $exit_val = '2'; } } -- Prentice Bisbal Linux Software Support Specialist/System Administrator School of Natural Sciences Institute for Advanced Study Princeton, NJ

SSL/TLS does not check hostname in cert

2010-03-31 Thread Prentice Bisbal
It's my understanding that using LDAPS->new or $ldap->start_tls with the option verify => 'require' Should verify that the host name should be checked and fail if it's not an exact match. From my experience with websites, TLS/SSL requires that if the cert contains the FQDN for the server, the ver

Re: search for one object with thousands of members fails

2010-03-29 Thread Prentice Bisbal
e, because there's only one > object? >$page->cookie($cookie); > }; > > sub process_entry { >my $mesg = shift; >my $entry = shift; >(warn "end of entry\n", return) unless $entry; > foreach ( $entry->get_value("member")) { ># process member > }; > } > == > > > Mike > -- Prentice Bisbal Linux Software Support Specialist/System Administrator School of Natural Sciences Institute for Advanced Study Princeton, NJ

Check for krb5 creds before SASL auth?

2010-03-09 Thread Prentice Bisbal
quot;; } } And here's the error Local error at ./sns_chsh.pl line 107. -- Prentice Bisbal Linux Software Support Specialist/System Administrator School of Natural Sciences Institute for Advanced Study Princeton, NJ

Net::LDAP scheme() method

2010-03-09 Thread Prentice Bisbal
dap_servers, but I don't know in advance which server new() will connect to, and it's possible to have this in ldap.conf: URI ldap://ldap1.example.com ldaps:://ldap2.exmaple.com so scheme() looks like the most reliable method. -- Prentice Bisbal Linux Software Support Specialist/System Administrator School of Natural Sciences Institute for Advanced Study Princeton, NJ