24.44. slapi_entry_set_dn()

Sets the distinguished name (DN) of an entry.
Description

This function sets the DN pointer in the specified entry to the DN that you supply.

Syntax

#include "slapi-plugin.h"
void slapi_entry_set_dn( Slapi_Entry *e, Slapi_DN *dn );

Parameters

This function takes the following parameters:

e
Entry to which you want to assign the DN.
dn
Distinguished name to assign to the entry.
Memory Concerns

The dn will be freed eventually when slapi_entry_free() is called.

A copy of dn should be passed. For example:
Slapi_DN *dn = slapi_ch_strdup(some_dn):
slapi_entry_set_dn(e, dn);
The old dn will be freed as a result of this call. Do not pass in a NULL value.