Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
What's wrong with this code?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Prentice Bisbal  
View profile  
 More options Feb 17 2011, 4:04 pm
Newsgroups: perl.ldap
From: prent...@ias.edu (Prentice Bisbal)
Date: Thu, 17 Feb 2011 16:04:20 -0500
Local: Thurs, Feb 17 2011 4:04 pm
Subject: What's wrong with this code?
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\\$ntUserDomainId"
                );

.

When I run my program, I get this error:

Use of uninitialized value in concatenation (.) or string at
./add_nt_attribs.pl line 120, <STDIN> line 1.
Use of uninitialized value in length at
/usr/local/perl-5.8/lib/site_perl/5.8.8/Convert/ASN1/_encode.pm line
143, <STDIN> line 1.
Use of uninitialized value in concatenation (.) or string at
/usr/local/perl-5.8/lib/site_perl/5.8.8/Convert/ASN1/_encode.pm line
144, <STDIN> line 1.
ntUserDomainId: value #0 invalid per syntax at
/usr/local/perl-5.8/lib/site_perl/5.8.8/Net/LDAP/Entry.pm line 268

$entry already exists in LDAP, and I'm just trying to add this new
objectClass and related attributes to the entry. Am I doing this the
wrong way?

Should I be using a function other than entry->add(), like $ldap->modify()?

--
Prentice


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Prentice Bisbal  
View profile  
 More options Feb 17 2011, 4:12 pm
Newsgroups: perl.ldap
From: prent...@ias.edu (Prentice Bisbal)
Date: Thu, 17 Feb 2011 16:12:10 -0500
Local: Thurs, Feb 17 2011 4:12 pm
Subject: Re: What's wrong with this code?

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 Bisbal wrote:
>> Use of uninitialized value in concatenation

No, I did not see your post, but I got a copy of my e-mail that I just
sent. It was the first e-mail I received from this list in a while.

Turning off warning and using strict did not make any difference.

--
Prentice


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Prentice Bisbal  
View profile  
 More options Feb 17 2011, 4:15 pm
Newsgroups: perl.ldap
From: prent...@ias.edu (Prentice Bisbal)
Date: Thu, 17 Feb 2011 16:15:57 -0500
Local: Thurs, Feb 17 2011 4:15 pm
Subject: Re: What's wrong with this code?

John,

I effectively did that by commenting out lines 1 and 2 individually and
simultaneously with no dice. When I comment them both out, I get the
error that objectClass ntUser requires the attribute ntUserDomainId, so
I think at least those two must be added together.

--
Prentice


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Prentice Bisbal  
View profile  
 More options Feb 17 2011, 4:13 pm
Newsgroups: perl.ldap
From: prent...@ias.edu (Prentice Bisbal)
Date: Thu, 17 Feb 2011 16:13:55 -0500
Local: Thurs, Feb 17 2011 4:13 pm
Subject: Re: What's wrong with this code?
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
Linux Software Support Specialist/System Administrator
School of Natural Sciences
Institute for Advanced Study
Princeton, NJ

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dieter Kluenter  
View profile  
 More options Feb 17 2011, 4:34 pm
Newsgroups: perl.ldap
From: die...@dkluenter.de (Dieter Kluenter)
Date: Thu, 17 Feb 2011 22:34:20 +0100
Local: Thurs, Feb 17 2011 4:34 pm
Subject: Re: What's wrong with this code?
Am Thu, 17 Feb 2011 16:04:20 -0500
schrieb Prentice Bisbal <prent...@ias.edu>:

value #0 is referring to the entry's first attribute type value, please
check this value.

-Dieter

--
Dieter Klünter | Systemberatung
http://dkluenter.de
GPG Key ID:DA147B05
53°37'09,95"N
10°08'02,42"E


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Prentice Bisbal  
View profile  
 More options Feb 17 2011, 4:48 pm
Newsgroups: perl.ldap
From: prent...@ias.edu (Prentice Bisbal)
Date: Thu, 17 Feb 2011 16:48:47 -0500
Local: Thurs, Feb 17 2011 4:48 pm
Subject: Re: What's wrong with this code?
Thanks everyone for all the assistance. I finally found the source of my
error. I was assigning ntUserDomainId inside an if block earlier in the
code like this:

if (something) {
        my $ntUserDomainId = something_else;

} else {
        .....
}

$mesg = $entry->add('objectClass' => 'ntUser',
                'ntUserDomainId' => $ntUserDomainId,
                'ntUserHomeDir' => "\\\\host.tld\\home\\$ntUserDomainId"
                );

Obviously, this scoped $ntUserDomainId incorrectly, so it was undefined
in my entry->add 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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Ridd  
View profile  
 More options Feb 18 2011, 2:10 am
Newsgroups: perl.ldap
From: chrisr...@mac.com (Chris Ridd)
Date: Fri, 18 Feb 2011 07:10:10 +0000
Local: Fri, Feb 18 2011 2:10 am
Subject: Re: What's wrong with this code?

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 value look like?

If you call $ldap->debug(15) before $entry->add you will get some extra output showing what perl's sent to your server, and that should provide a big clue.

Chris


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Prentice Bisbal  
View profile  
 More options Feb 18 2011, 8:29 am
Newsgroups: perl.ldap
From: prent...@ias.edu (Prentice Bisbal)
Date: Fri, 18 Feb 2011 08:29:41 -0500
Local: Fri, Feb 18 2011 8:29 am
Subject: Re: What's wrong with this code?

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 value look like?

> If you call $ldap->debug(15) before $entry->add you will get some extra output showing what perl's sent to your server, and that should provide a big clue.

> Chris

Thanks for the tip. I figured out the source of my problem (you probably
are reading your e-mails in order so haven't gotten to that one yet),
but that's a trick that will be very helpful in the future.

--
Prentice


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »