Logo Search packages:      
Sourcecode: ldb version File versions  Download package

int ldb_modify ( struct ldb_context *  ldb,
const struct ldb_message message 
)

Modify the specified attributes of a record

This function modifies a record that is in the database.

Parameters:
ldb the context associated with the database (from ldb_init())
message the message containing the changes required.
Returns:
result code (LDB_SUCCESS if the record was modified as requested, otherwise a failure code)

Definition at line 1024 of file ldb.c.

References LDB_SUCCESS.

{
      struct ldb_request *req;
      int ret;

      ret = ldb_msg_sanity_check(ldb, message);
      if (ret != LDB_SUCCESS) {
            return ret;
      }

      ret = ldb_build_mod_req(&req, ldb, ldb,
                              message,
                              NULL,
                              NULL,
                              NULL);

      if (ret != LDB_SUCCESS) return ret;

      ldb_set_timeout(ldb, req, 0); /* use default timeout */

      /* do request and autostart a transaction */
      ret = ldb_autotransaction_request(ldb, req);

      talloc_free(req);
      return ret;
}


Generated by  Doxygen 1.6.0   Back to index