[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: can't modify or add uidNumber attribute



On Monday, 26 March 2012 16:21:17 stefano wrote:
> hi, i was modifying uidNumber attribute of a user but then has been
> standing for a few minutes and I stopped it:
> 
> root@amahoro:~# ldapmodify -x -W -D 'cn=Manager,dc=amahoro,dc=bi'
> Enter LDAP Password:
> dn: uid=stefano,cn=Admins,dc=amahoro,dc=bi
> changetype: modify
> replace: uidNumber
> uidNumber: 1001
> 
> modifying entry "uid=stefano,cn=Admins,dc=amahoro,dc=bi"
> .
> .

It was waiting for more input ....

> .
> ctrl+c

CTRL-D is technically the right input here to let this ldapmodify complete.

> then with an ldapsearch for this user there was not the uidNumber
> attribute:

It seems to be here:
 
> dn: uid=stefano,cn=Admins,dc=amahoro,dc=bi
[...
> uidNumber: 1001

I note of course, that if you are using standard schema, it is impossible to 
have the posixAccount objectClass without a uidNumber attribute.

> trying to add it
> 
> root@amahoro:~# ldapmodify -x -W -D 'cn=Manager,dc=amahoro,dc=bi'
> Enter LDAP Password:
> dn: uid=stefano,cn=Admins,dc=amahoro,dc=bi
> changetype: add
> add: uidNumber
> uidNumber: 1001
> 
> adding new entry "uid=stefano,cn=Admins,dc=amahoro,dc=bi"
> ldap_add: Undefined attribute type (17)
>      additional info: add: attribute type undefined
> 
> you can see the error message
> what is wrong?

Your LDIF is incorrect, you asked for a changetype of 'add' (the equivalent of 
calling ldapadd instead of ldapmodify). This would have been correct if you 
had no existing uidNumber attribute:

dn: uid=stefano,cn=Admins,dc=amahoro,dc=bi
add: uidNumber
uidNumber: 1001

At least it should have given you a better error message (that the attribute 
already exists).

Regards,
Buchan