
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
        "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- MyFirstUnitAd -->
<ins class="adsbygoogle"
     style="display:inline-block;width:970px;height:250px"
     data-ad-client="ca-pub-5778386704669218"
     data-ad-slot="1503492166"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- MyFirstUnitAd -->
<ins class="adsbygoogle"
     style="display:inline-block;width:970px;height:250px"
     data-ad-client="ca-pub-5778386704669218"
     data-ad-slot="1503492166"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

    <link rel="stylesheet" type="text/css" href="../../../style.css" title="style" />
    <link rel="stylesheet" type="text/css" href="../style.css" title="style" />
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />

    <title>ldap_modify(3) - Linux manual page</title>
</head>

<body>

<div class="page-top"><a id="top_of_page"></a></div>
<!--%%%TOP_BAR%%%-->
    <div class="nav-bar">
        <table class="nav-table">
            <tr>
                <td class="nav-cell">
                    <p class="nav-text">
                        <a href="http://man7.org/index.html">man7.org</a> &gt; Linux &gt; <a href="../index.html">man-pages</a>
                    </p>
                </td>
                <td class="training-cell">
                    <p class="training-text"><a class="training-link" href="http://man7.org/training/">Linux/UNIX system programming training</a></p>
                </td>
            </tr>
        </table>
    </div>

<hr class="nav-end" />

<!--%%%PAGE_START%%%-->


<table class="sec-table">
<tr>
    <td>
        <p class="section-dir">
<a href="ldap_modify_s.3.html#NAME">NAME</a> | <a href="ldap_modify_s.3.html#LIBRARY">LIBRARY</a> | <a href="ldap_modify_s.3.html#SYNOPSIS">SYNOPSIS</a> | <a href="ldap_modify_s.3.html#DESCRIPTION">DESCRIPTION</a> | <a href="ldap_modify_s.3.html#DEPRECATED_INTERFACES">DEPRECATED&nbsp;INTERFACES</a> | <a href="ldap_modify_s.3.html#SEE_ALSO">SEE&nbsp;ALSO</a> | <a href="ldap_modify_s.3.html#ACKNOWLEDGEMENTS">ACKNOWLEDGEMENTS</a> | <a href="ldap_modify_s.3.html#COLOPHON">COLOPHON</a>
        </p>
    </td>
    <td class="search-box">
        <div class="man-search-box">

            <form method="get" action="http://www.google.com/search">
                <fieldset class="man-search">
                    <input type="text" name="q" size="10" maxlength="255" value="" />
                    <input type="hidden" name="sitesearch" value="man7.org/linux/man-pages" />
                    <input type="submit" name="sa" value="Search online pages" />
                </fieldset>
            </form>

        </div>
    </td>
    <td> </td>
</tr>
</table>

<pre>
<span class="headline">LDAP_MODIFY(3)            Library Functions Manual            LDAP_MODIFY(3)</span>
</pre>
<h2><a id="NAME" href="ldap_modify_s.3.html#NAME"></a>NAME  &nbsp; &nbsp; &nbsp; &nbsp; <a href="ldap_modify_s.3.html#top_of_page"><span class="top-link">top</span></a></h2><pre>
       ldap_modify_ext, ldap_modify_ext_s - Perform an LDAP modify operation
</pre>
<h2><a id="LIBRARY" href="ldap_modify_s.3.html#LIBRARY"></a>LIBRARY  &nbsp; &nbsp; &nbsp; &nbsp; <a href="ldap_modify_s.3.html#top_of_page"><span class="top-link">top</span></a></h2><pre>
       OpenLDAP LDAP (libldap, -lldap)
</pre>
<h2><a id="SYNOPSIS" href="ldap_modify_s.3.html#SYNOPSIS"></a>SYNOPSIS  &nbsp; &nbsp; &nbsp; &nbsp; <a href="ldap_modify_s.3.html#top_of_page"><span class="top-link">top</span></a></h2><pre>
       <b>#include &lt;ldap.h&gt;</b>

       <b>int ldap_modify_ext(</b>
              <b>LDAP *</b><i>ld</i><b>,</b>
              <b>char *</b><i>dn</i><b>,</b>
              <b>LDAPMod *</b><i>mods[]</i><b>,</b>
              <b>LDAPControl **</b><i>sctrls</i><b>,</b>
              <b>LDAPControl **</b><i>cctrls</i><b>,</b>
              <b>int *</b><i>msgidp</i> <b>);</b>

       <b>int ldap_modify_ext_s(</b>
              <b>LDAP *</b><i>ld</i><b>,</b>
              <b>char *</b><i>dn</i><b>,</b>
              <b>LDAPMod *</b><i>mods[]</i><b>,</b>
              <b>LDAPControl **</b><i>sctrls</i><b>,</b>
              <b>LDAPControl **</b><i>cctrls</i> <b>);</b>

       <b>void ldap_mods_free(</b>
              <b>LDAPMod **</b><i>mods</i><b>,</b>
              <b>int </b><i>freemods</i> <b>);</b>
</pre>
<h2><a id="DESCRIPTION" href="ldap_modify_s.3.html#DESCRIPTION"></a>DESCRIPTION  &nbsp; &nbsp; &nbsp; &nbsp; <a href="ldap_modify_s.3.html#top_of_page"><span class="top-link">top</span></a></h2><pre>
       The routine <b>ldap_modify_ext_s() </b>is used to perform an LDAP modify
       operation.  <i>dn</i> is the DN of the entry to modify, and <i>mods</i> is a null-
       terminated array of modifications to make to the entry.  Each element
       of the <i>mods</i> array is a pointer to an LDAPMod structure, which is
       defined below.

            typedef struct ldapmod {
                int mod_op;
                char *mod_type;
                union {
                    char **modv_strvals;
                    struct berval **modv_bvals;
                } mod_vals;
                struct ldapmod *mod_next;
            } LDAPMod;
            #define mod_values mod_vals.modv_strvals
            #define mod_bvalues mod_vals.modv_bvals

       The <i>mod_op</i> field is used to specify the type of modification to
       perform and should be one of LDAP_MOD_ADD, LDAP_MOD_DELETE, or
       LDAP_MOD_REPLACE.  The <i>mod_type</i> and <i>mod_values</i> fields specify the
       attribute type to modify and a null-terminated array of values to
       add, delete, or replace respectively.  The <i>mod_next</i> field is used
       only by the LDAP server and may be ignored by the client.

       If you need to specify a non-string value (e.g., to add a photo or
       audio attribute value), you should set <i>mod_op</i> to the logical OR of
       the operation as above (e.g., LDAP_MOD_REPLACE) and the constant
       LDAP_MOD_BVALUES.  In this case, <i>mod_bvalues</i> should be used instead
       of <i>mod_values</i>, and it should point to a null-terminated array of
       struct bervals, as defined in &lt;lber.h&gt;.

       For LDAP_MOD_ADD modifications, the given values are added to the
       entry, creating the attribute if necessary.  For LDAP_MOD_DELETE
       modifications, the given values are deleted from the entry, removing
       the attribute if no values remain.  If the entire attribute is to be
       deleted, the <i>mod_values</i> field should be set to NULL.  For
       LDAP_MOD_REPLACE modifications, the attribute will have the listed
       values after the modification, having been created if necessary.  All
       modifications are performed in the order in which they are listed.

       <b>ldap_mods_free() </b>can be used to free each element of a NULL-
       terminated array of mod structures.  If <i>freemods</i> is non-zero, the
       <i>mods</i> pointer itself is freed as well.

       <b>ldap_modify_ext_s() </b>returns a code indicating success or, in the case
       of failure, indicating the nature of the failure.  See <a href="ldap_error.3.html">ldap_error(3)</a>
       for details

       The <b>ldap_modify_ext() </b>operation works the same way as
       <b>ldap_modify_ext_s()</b>, except that it is asynchronous. The integer that
       <i>msgidp</i> points to is set to the message id of the modify request.  The
       result of the operation can be obtained by calling <a href="ldap_result.3.html">ldap_result(3)</a>.

       Both <b>ldap_modify_ext() </b>and <b>ldap_modify_ext_s() </b>allows server and
       client controls to be passed in via the sctrls and cctrls parameters,
       respectively.
</pre>
<h2><a id="DEPRECATED_INTERFACES" href="ldap_modify_s.3.html#DEPRECATED_INTERFACES"></a>DEPRECATED INTERFACES  &nbsp; &nbsp; &nbsp; &nbsp; <a href="ldap_modify_s.3.html#top_of_page"><span class="top-link">top</span></a></h2><pre>
       The <b>ldap_modify() </b>and <b>ldap_modify_s() </b>routines are deprecated in
       favor of the <b>ldap_modify_ext() </b>and <b>ldap_modify_ext_s() </b>routines,
       respectively.

       Deprecated interfaces generally remain in the library.  The macro
       LDAP_DEPRECATED can be defined to a non-zero value (e.g.,
       -DLDAP_DEPRECATED=1) when compiling program designed to use
       deprecated interfaces.  It is recommended that developers writing new
       programs, or updating old programs, avoid use of deprecated
       interfaces.  Over time, it is expected that documentation (and,
       eventually, support) for deprecated interfaces to be eliminated.
</pre>
<h2><a id="SEE_ALSO" href="ldap_modify_s.3.html#SEE_ALSO"></a>SEE ALSO  &nbsp; &nbsp; &nbsp; &nbsp; <a href="ldap_modify_s.3.html#top_of_page"><span class="top-link">top</span></a></h2><pre>
       <a href="ldap.3.html">ldap(3)</a>, <a href="ldap_error.3.html">ldap_error(3)</a>,
</pre>
<h2><a id="ACKNOWLEDGEMENTS" href="ldap_modify_s.3.html#ACKNOWLEDGEMENTS"></a>ACKNOWLEDGEMENTS  &nbsp; &nbsp; &nbsp; &nbsp; <a href="ldap_modify_s.3.html#top_of_page"><span class="top-link">top</span></a></h2><pre>
       <b>OpenLDAP Software </b>is developed and maintained by The OpenLDAP Project
       &lt;<a href="http://www.openldap.org/">http://www.openldap.org/</a>&gt;.  <b>OpenLDAP Software </b>is derived from the
       University of Michigan LDAP 3.3 Release.
</pre>
<h2><a id="COLOPHON" href="ldap_modify_s.3.html#COLOPHON"></a>COLOPHON  &nbsp; &nbsp; &nbsp; &nbsp; <a href="ldap_modify_s.3.html#top_of_page"><span class="top-link">top</span></a></h2><pre>
       This page is part of the <i>OpenLDAP</i> (an open source implementation of
       the Lightweight Directory Access Protocol) project.  Information
       about the project can be found at ⟨<a href="http://www.openldap.org/">http://www.openldap.org/</a>⟩.  If you
       have a bug report for this manual page, see
       ⟨<a href="http://www.openldap.org/its/">http://www.openldap.org/its/</a>⟩.  This page was obtained from the
       project's upstream Git repository
       ⟨git://git.openldap.org/openldap.git⟩ on 2018-02-02.  (At that time,
       the date of the most recent commit that was found in the repository
       was 2018-01-30.)  If you discover any rendering problems in this HTML
       version of the page, or you believe there is a better or more up-to-
       date source for the page, or you have corrections or improvements to
       the information in this COLOPHON (which is <i>not</i> part of the original
       manual page), send a mail to man-pages@man7.org

<span class="footline">OpenLDAP LDVERSION               RELEASEDATE                  LDAP_MODIFY(3)</span>
</pre>

<hr class="end-man-text" />
<p>Pages that refer to this page: 
    <a href="../man1/ldapmodify.1.html">ldapmodify(1)</a>,&nbsp; 
    <a href="ldap_add.3.html">ldap_add(3)</a>,&nbsp; 
    <a href="ldap_get_option.3.html">ldap_get_option(3)</a>,&nbsp; 
    <a href="ldap_rename.3.html">ldap_rename(3)</a>,&nbsp; 
    <a href="ldap_result.3.html">ldap_result(3)</a>
</p>
<hr/>

 
<hr class="start-footer" />

<div class="footer"> 

<table class="colophon-table">
    <tr>
    <td class="pub-info">
        <p>
            HTML rendering created 2018-02-02
            by <a href="http://man7.org/mtk/index.html">Michael Kerrisk</a>, 
            author of 
            <a href="http://man7.org/tlpi/"><em>The Linux Programming Interface</em></a>, 
            maintainer of the 
            <a href="https://www.kernel.org/doc/man-pages/">Linux <em>man-pages</em> project</a>.
        </p>
        <p>
            For details of in-depth
            <strong>Linux/UNIX system programming training courses</strong>
            that I teach, look <a href="http://man7.org/training/">here</a>.
        </p>
        <p>
            Hosting by <a href="http://www.jambit.com/index_en.html">jambit GmbH</a>.
        </p>
        <p>
            <a href="http://validator.w3.org/check?uri=referer">
            <img src="http://www.w3.org/Icons/valid-xhtml11"
                alt="Valid XHTML 1.1" height="31" width="88" />
            </a>
        </p>
    </td>
    <td class="colophon-divider">
    </td>
    <td class="tlpi-cover">
        <a href="http://man7.org/tlpi/"><img src="../../../tlpi/cover/TLPI-front-cover-vsmall.png" alt="Cover of TLPI" /></a>
    </td>
    </tr>
</table>

</div>

<hr class="end-footer" />



<!--BEGIN-SITETRACKING-->
<!-- SITETRACKING.man7.org_linux_man-pages -->

<!-- Start of StatCounter Code (xhtml) -->

<script type="text/javascript">
//<![CDATA[
var sc_project=7422636; 
var sc_invisible=1; 
var sc_security="9b6714ff"; 
//]]>
</script>
<script type="text/javascript"
src="http://www.statcounter.com/counter/counter_xhtml.js"></script>
<noscript><div class="statcounter"><a title="website
statistics" href="http://statcounter.com/"
class="statcounter"><img class="statcounter"
src="http://c.statcounter.com/7422636/0/9b6714ff/1/"
alt="website statistics" /></a></div></noscript>

<!-- End of StatCounter Code -->


<!-- Start of Google Analytics Code -->

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-9830363-8']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>

<!-- End of Google Analytics Code -->

<!--END-SITETRACKING-->

</body>
</html>
