Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have the ff LDIF file for adding an attributeType passwordNonRootMayResetUserpwd. The attributeType is already existing.

dn: cn=schema
changetype: modify
delete: objectClasses
objectClasses: ( 1.3.6.1.4.1.42.2.27.9.2.6 NAME 'passwordPolicy'
        SUP top STRUCTURAL MUST cn MAY ( description $ passwordMaxAge
        $ passwordExp $ passwordMinLength $ passwordInHistory
        $ passwordChange $ passwordWarning $ passwordLockout
        $ passwordMaxFailure $ passwordResetDuration
        $ passwordUnlock $ passwordLockoutDuration
        $ passwordCheckSyntax $ passwordMustChange
        $ passwordStorageScheme $ passwordMinAge
        $ passwordResetFailureCount $ passwordExpireWithoutWarning
        $ passwordRootdnMayBypassModsChecks ) )

dn: cn=schema
changetype: modify
add: objectClasses
objectClasses: ( 1.3.6.1.4.1.42.2.27.9.2.6 NAME 'passwordPolicy'
        SUP top STRUCTURAL MUST cn MAY ( description $ passwordMaxAge
        $ passwordExp $ passwordMinLength $ passwordInHistory
        $ passwordChange $ passwordWarning $ passwordLockout
        $ passwordMaxFailure $ passwordResetDuration
        $ passwordUnlock $ passwordLockoutDuration
        $ passwordCheckSyntax $ passwordMustChange
        $ passwordStorageScheme $ passwordMinAge
        $ passwordResetFailureCount $ passwordExpireWithoutWarning
        $ passwordRootdnMayBypassModsChecks $ passwordNonRootMayResetUserpwd ) )

I'm getting the ff error and I'm stuck.

$ ldapmodify -h host -p 8888 -D "cn=Directory Manager" -f delete_add.ldif
Enter bind password:
modifying entry cn=schema
ldap_modify: DSA is unwilling to perform
ldap_modify: additional info: objectclasses: No target attribute type or object class specified

I do not know what's causing this error since the attributeType exists as well as the objectClass.

Edit: This LDAP service is running on Sun OS 10.

share|improve this question

2 Answers 2

You do not mention which backend server is offering LDAP services. In general when modifying schema in this fashion, it is best to do the delete and add as one atomic operation.

That is a - after the delete: followed immediately by an add: action.

share|improve this answer
    
I have edited the post, the server is Sun OS 10. –  Joset Oct 7 '11 at 3:52
    
I'm getting ldap_modify: additional info: object class passwordPolicy: Cannot delete a standard object class –  Joset Jan 9 '12 at 8:45
up vote 1 down vote accepted

I got it working by doing the ff sequentially:

Firstly, add the attributeType

dn: cn=schema
changetype: modify
add: attributeTypes
attributeTypes: ( 1.3.6.1.4.1.42.2.27.9.1.782
 NAME 'passwordNonRootMayResetUserpwd'
 DESC 'Sun ONE defined password policy attribute type'
 SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
 X-DS-USE 'internal'
 X-ORIGIN 'Sun ONE Directory Server' )

Lastly, associate the attributeType to the objectClass

dn: cn=schema
changetype: modify
add: objectClasses
objectClasses: ( 1.3.6.1.4.1.42.2.27.9.2.6 NAME 'passwordPolicy'
        SUP top STRUCTURAL MUST cn MAY ( description $ passwordMaxAge
        $ passwordExp $ passwordMinLength $ passwordInHistory
        $ passwordChange $ passwordWarning $ passwordLockout
        $ passwordMaxFailure $ passwordResetDuration
        $ passwordUnlock $ passwordLockoutDuration
        $ passwordCheckSyntax $ passwordMustChange
        $ passwordStorageScheme $ passwordMinAge
        $ passwordResetFailureCount $ passwordExpireWithoutWarning
        $ passwordRootdnMayBypassModsChecks $ passwordNonRootMayResetUserpwd ) )

Fire these two on separate LDIF files then invoke ldapmodify

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.