[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: syntax of ldap_modify_s
- To: Eli Bach <ebach2@gmail.com>
- Subject: Re: syntax of ldap_modify_s
- From: "Adrian St. John-Bee" <adebee@gmail.com>
- Date: Tue, 28 Apr 2009 15:24:14 +0100
- Cc: openldap-software@openldap.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=uLq7wB0LVMijCSx+JAeLExk5apu8qRV5YOER+2eU8zA=; b=vO9iwYH+5zeBo+RwBDcHMRVuOnM12MYhZXH1EbSXPSAffhQVo04L01dXWOjczzT72N aJjekz6Xq41cWHQ4iYqBKR4kI7sMIPPDQGso+k6z4uGbglJ89nBeSic+aF226oz7Wxr4 YXNRzKywSJYCbICQtoGrMp6jEWSl1rFQJi0G4=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=E/EnD/f7OmVfQT3MHy36riLvSQGvGpIYGsGiPUl3TID/z70JPHt/k45pWtq2FVnQnc lEkhYqo0Zp6OMlBbRzAWFYecBqrW8rH/pL8RZ6pHmlQUWZrwb4OWe/6pKnHJlF98WOEj 0hto9HXkAq7Q2YHIA85EzywZmIZ6/4eJ6b8Vs=
- In-reply-to: <687063CC-A38D-4AD9-AB7D-851FA639773A@gmail.com>
- References: <7d2b0e910904260531o2d30d43bxa728e608f919a67a@mail.gmail.com> <687063CC-A38D-4AD9-AB7D-851FA639773A@gmail.com>
I've changed the code to...
char* vals0[2];
vals0[0] = "eric@ntu.ac.uk";
vals0[1] = NULL;
int rc = ldap_simple_bind_s(ld, user, pass);
LDAPMod *modM;
char *dn = "uflEduUniversityId=28833300,ou=People,dc=ufl,dc=edu";
modM->mod_op = LDAP_MOD_ADD;
modM->mod_type = "mail";
modM->mod_values = vals0;
if((ldap_modify_s(ld, dn, &modM)) != LDAP_SUCCESS)
{
// FAIL
}
But still get the same error on the ldap_modify_s(ld, dn, &modM) command.
Cheers,
Ade
2009/4/27 Eli Bach <ebach2@gmail.com>:
>
> On Apr 26, 2009, at 5:31 AM, Adrian St. John-Bee wrote:
>
>> char** vals0;
>
> ...
>>
>> vals0[0] = "eric@ntu.ac.uk";
>
> It looks like these two lines are your problem.
>
> You are just defining vals0 as a pointer to a pointer, and then referencing
> it as an array of pointers.
>
> However, you don't allocate any memory to actually store any data into.
>
> If you switched you're code to something like:
>
> char* vals0[2];
> vals0[0] = "eric@ntu.ac.uk";
> vals0[1] = NULL;
>
> I have no comment on whether you are using the ldap api's correctly or not.
>
>