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

int ldb_extended ( struct ldb_context *  ldb,
const char *  oid,
void *  data,
struct ldb_result **  res 
)

call an extended operation

This function deletes a record from the database.

Parameters:
ldb the context associated with the database (from ldb_init())
oid the OID of the extended operation.
data a void pointer a the extended operation specific parameters, it needs to be NULL or a valid talloc pointer! talloc_get_type() will be used on it
res the result of the extended operation
Returns:
result code (LDB_SUCCESS if the extended operation returned fine, otherwise a failure code)

Definition at line 860 of file ldb.c.

References LDB_ERR_OPERATIONS_ERROR, and LDB_SUCCESS.

{
      struct ldb_request *req;
      int ret;
      struct ldb_result *res;

      *_res = NULL;

      res = talloc_zero(ldb, struct ldb_result);
      if (!res) {
            return LDB_ERR_OPERATIONS_ERROR;
      }

      ret = ldb_build_extended_req(&req, ldb, ldb,
                             oid, data, NULL,
                             res, ldb_extended_default_callback);
      if (ret != LDB_SUCCESS) goto done;

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

      ret = ldb_request(ldb, req);
      
      if (ret == LDB_SUCCESS) {
            ret = ldb_wait(req->handle, LDB_WAIT_ALL);
      }

      talloc_free(req);

done:
      if (ret != LDB_SUCCESS) {
            talloc_free(res);
      }

      *_res = res;
      return ret;
}


Generated by  Doxygen 1.6.0   Back to index