Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Delete objectClass from DN

61 views
Skip to first unread message

Kent

unread,
Dec 12, 2009, 6:11:08 AM12/12/09
to perl...@perl.org
OpenLDAP 2.4.16 on CentOS 5.3
Perl version 5.10.0 on Ubuntu

I Have this entry in LDAP:

dn: cn=00-1E-52-76-B4-8A,ou=Devices,ou=Network,dc=mbl,dc=edu
cn: 00-1E-52-76-B4-8A
userPassword:: <secret>
radiusExpiration: 2030123100:00:00
radiusCheckItem: 999993
radiusUserCategory: FIXED
description: Fred Mertz
macAddress: 00:1E:52:76:B4:8A
ipHostNumber: 128.128.164.100
objectClass: radiusprofile
objectClass: simpleSecurityObject
objectClass: device
objectClass: ieee802Device
objectClass: ipHost
radiusFilterId: Enterasys:version=1:policy=A-User

I want to delete the objectClass 'ipHost' and attribute
'ipHostNumber'. What is the perl code to do this? Everything I've read
is geared towards add/replace/delete attribute -> value but not
objectClass.

$mesg = $obj->modify($dn,
changes => [
delete => [ 'objectclass' => [ 'ipHost' ]],
]
);

Returns:
error 65 - The request specifies a change to an existing entry or the
addition of a new
entry that does not comply with the servers schema

Justin Alcorn

unread,
Dec 12, 2009, 10:52:41 PM12/12/09
to Kent, perl...@perl.org
Have you tried making sure to delete any attributes associated with
that object class first?

--
Sent from my mobile device

klnasv...@gmail.com

unread,
Dec 13, 2009, 7:05:34 AM12/13/09
to Justin Alcorn, perl...@perl.org
OK I finally got it, here is a summary of what I tried and what worked:

$mesg = $obj->modify($dn,
changes => [

delete => [ 'ipHostNumber','objectclass' => [ 'ipHost' ]]
]
);

17 - The request contains an undefined attribute type

$mesg = $obj->modify($dn,
changes => [

delete => [ 'ipHostNumber' ],


delete => [ 'objectclass' => [ 'ipHost' ]]

]
);

16 - The request referenced an attribute that does not exist

$mesg = $obj->modify($dn,
changes => [

delete => [ 'ipHostNumber' => [] ],


delete => [ 'objectclass' => [ 'ipHost' ]]

]
);

no error

$mesg = $obj->modify($dn,
changes => [

delete => [ 'ipHostNumber' => [] ,'objectclass' => [ 'ipHost' ] ],
]
);

no error

Thank you for all your help!

On Dec 12, 2009 10:52pm, Justin Alcorn <jus...@jalcorn.net> wrote:
> Have you tried making sure to delete any attributes associated with

> that object class first?

> On 12/12/09, Kent klnasv...@gmail.com> wrote:

> > OpenLDAP 2.4.16 on CentOS 5.3

> > Perl version 5.10.0 on Ubuntu

> >

> > I Have this entry in LDAP:

> >

> > dn: cn=00-1E-52-76-B4-8A,ou=Devices,ou=Network,dc=mbl,dc=edu

> > cn: 00-1E-52-76-B4-8A

> > userPassword::

> > radiusExpiration: 2030123100:00:00

0 new messages