correct way to ldapmodify certain entries

View: New views
3 Messages — Rating Filter:   Alert me  

correct way to ldapmodify certain entries

by Damon Getsman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am trying to learn basic administration of users/groups in a PAM/LDAP setting, but I assure you my question is strictly about how to correctly write an .ldif for ldapmodify, and thus on topic.  :)

I see that the LDAP database is set up with group entries as such:
dn: cn=executiv,ou=Group,dc=ouah,dc=net
objectClass: posixGroup
objectClass: top
cn: executiv
userPassword: {crypt}!
gidNumber: 4000
memberUid: yankee
memberUid: doodle
memberUid: dandy

What I need to do is add more memberUid s to this and other entries.  I attempted to write an .ldif as follows:
dn: cn=executiv,ou=Group,dc=ouah,dc=net
changetype: add
memberUid: diddy
memberUid: whee

and was quickly informed by ldapmodify that this was not the correct way to do such.  I'm having trouble finding a detailed account of how to add multiple instances of the same attribute within an entry online and in my LDAP: System Administration ORA book.

I'd appreciate any pointers you can give.  :)

Thanks in advance,
Damon Getsman
--- You are currently subscribed to ldap@... as: [lists@...] To unsubscribe send email to ldap-request@... with the word UNSUBSCRIBE as the SUBJECT of the message.

Re: correct way to ldapmodify certain entries

by Jon Roberts-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Damon Getsman wrote:

> my question is strictly about how to correctly
> write an .ldif for ldapmodify, and thus on topic.  :)
>
> I attempted to write an .ldif as follows:
> dn: cn=executiv,ou=Group,dc=ouah,dc=net
> changetype: add
> memberUid: diddy
> memberUid: whee
>
> and was quickly informed by ldapmodify that this was not the correct way
> to do such.  

Instead try:

dn: cn=executiv,ou=Group,dc=ouah,dc=net
changetype: modify
add: memberUid
memberUid: diddy
memberUid: whee

I believe that will work. See RFC 2849 for details on LDIF syntax. Also,
include the output for a failed command next time for best odds of
assistance.

Jon Roberts
www.mentata.com

---
You are currently subscribed to ldap@... as: [lists@...]
To unsubscribe send email to ldap-request@... with the word UNSUBSCRIBE as the SUBJECT of the message.

Re: correct way to ldapmodify certain entries

by Michael Ströder :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Damon Getsman wrote:
> What I need to do is add more memberUid s to this and other entries.  I
> attempted to write an .ldif as follows:
> dn: cn=executiv,ou=Group,dc=ouah,dc=net
> changetype: add
> memberUid: diddy
> memberUid: whee

Try this (since you want to modify an existing entry and not add a new one):

------------------------- bite here ---------------------
dn: cn=executiv,ou=Group,dc=ouah,dc=net
changetype: modify
add: memberUid
memberUid: diddy
memberUid: whee
-

------------------------- bite here ---------------------

http://www.ietf.org/rfc/rfc2849.txt has a good example section.

Ciao, Michael.

---
You are currently subscribed to ldap@... as: [lists@...]
To unsubscribe send email to ldap-request@... with the word UNSUBSCRIBE as the SUBJECT of the message.
LightInTheBox - Buy quality products at wholesale price