24.46. slapi_entry_set_uniqueid()

Description

This function replaces the unique ID value of the entry with the uniqueid value that you specify. In addition, the function adds SLAPI_ATTR_UNIQUEID to the attribute list and gives it the unique ID value supplied. If the entry already contains a SLAPI_ATTR_UNIQUEID attribute, its value is updated with the new value supplied.

Syntax

#include "slapi-plugin.h"
void slapi_entry_set_uniqueid( Slapi_Entry *e, char *uniqueid );

Parameters

This function takes the following parameters:

e
Entry for which you want to generate a description.
uniqueid
The unique ID value to which you want to assign the entry.
Memory Concerns

Do not free the uniqueid after calling this function. The value will eventually be freed when slapi_entry_free() is called.

You should pass in a copy of the value because this function will consume the value passed in. For example:
char *uniqueid = slapi_ch_strdup(some_uniqueid);
slapi_entry_set_uniqueid(e, uniqueid);
Do not pass in a NULL for uniqueid.