Search code examples
ldapldap-query

Cannot modify entry by ldapmodify (no ldif)


I have object in ldap that I want to change Value from 0 to 1 (without ldif):

dn: ParameterId=MyParam,FragmentId=aaa,FragmentId=bbb,FragmentId=ccc,fsFragmentId=ddd,fsClusterId=eee
objectClass: fff
ParameterId: MyParam
MyParamValue: 0

And all i need for eternal happiness is to change Value to 1, no luck since 4 hours. "StackOverflow, you're my only hope."

I use this command:

ldapmodify -x -y <path_to_passfile> -D uid=fsLDAPRoot,ou=People,fsFragmentId=Security,fsClusterId=ClusterRoot
dn: ParameterId=MyParam,FragmentId=aaa,FragmentId=bbb,FragmentId=ccc,fsFragmentId=ddd,fsClusterId=eee
changetype: modify
replace: MyParam
MyParam: 1

Result, well nothing, as i enter lines, in eed to type enter twice (one line blank, then this:)

modifying entry "omsParameterId=DeleteFilesAfterRead,omsFragmentId=OMSBTSFileReader,omsFragmentId=SS_MeasurementHandling,omsFragmentId=OMSPlatform,fsFragmentId=OMS,fsClusterId=ClusterRoot"

Then returnes me control. I close by ctrl+z

object disappears from ldap

I cannot figure out what is wrong.


Solution

  • You must use the command ldapmodrdn to rename an entry:

    ldapmodrdn -r
    ParameterId=0,FragmentId=a,FragmentId=b,FragmentId=c,fsFragmentId=d,fsClusterId=e
    ParameterId=1
    

    The lines are read from stdin in my example. Add an empty line to communicate end of operation, then Ctrl-Z for end of file. I left your other command options out for clarity.

    Typed and not tested