Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Is it possible to add 'newsuperior' to the modrdn function? #1

Open
MattMencel opened this Issue Apr 16, 2010 · 2 comments

Comments

Projects
None yet
1 participant

No idea if this would work....but the PERL examples I've seen put newsuperior before deleteoldrdn in the params list.

Thanks,
Matt

conn.c

/*

  • call-seq:

  • conn.modrdn(dn, new_rdn, new_superior, delete_old_rdn) => self
    *

  • Modify the RDN of the entry with DN, +dn+, giving it the new RDN,

  • +new_rdn+. Move to a new container if +new_superior+ is given.

  • If +delete_old_rdn+ is true, the old RDN value will be deleted from

  • the entry.
    */
    VALUE
    rb_ldap_conn_modrdn_s (VALUE self, VALUE dn, VALUE newrdn, , VALUE newsuperior, VALUE delete_p)
    {
    RB_LDAP_DATA *ldapdata;
    char *c_dn;
    char *c_newrdn;
    char *c_newsuperior;
    int c_delete_p;

    GET_LDAP_DATA (self, ldapdata);
    c_dn = StringValueCStr (dn);
    c_newrdn = StringValueCStr (newrdn);
    c_newsuperior = StringValueCStr (newsuperior);
    c_delete_p = (delete_p == Qtrue) ? 1 : 0;

    ldapdata->err = ldap_modrdn2_s (ldapdata->ldap, c_dn, c_newrdn, c_newsuperior, c_delete_p);
    Check_LDAP_Result (ldapdata->err);

    return self;
    };

conn.c line 1796

/* If the number here specifies the number of required params...

  • then it should be 3 and not 4...
  • but I wasn't sure exactly what to do except it was related
  • to the number of params.
    */
    rb_ldap_conn_define_method ("modrdn", rb_ldap_conn_modrdn_s, 4);

win/winldap.h line 286

ULONG ldap_modrdn2_s(LDAP *ld, PCHAR olddn, PCHAR newdn, PCHAR newsuperior, int delold_flag);

rbldap.h line 117

VALUE rb_ldap_conn_modrdn_s (VALUE, VALUE, VALUE, VALUE, VALUE);

Any further thoughts on this? Right now I have my ruby program doing an external call out to a perl script for these newsuperior actions.

Matt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment