Return the list of attribute names from a mapping table
**********************************************************************/
- char** get_attr_list( ATTRIB_MAP_ENTRY table[] )
+ const char** get_attr_list( ATTRIB_MAP_ENTRY table[] )
{
- char **names;
+ const char **names;
int i = 0;
while ( table[i].attrib != LDAP_ATTR_LIST_END )
i++;
i++;
- names = SMB_MALLOC_ARRAY( char*, i );
+ names = SMB_MALLOC_ARRAY( const char*, i );
if ( !names ) {
DEBUG(0,("get_attr_list: out of memory\n"));
return NULL;
Cleanup
********************************************************************/
- void free_attr_list( char **list )
+ void free_attr_list( const char **list )
{
int i = 0;
int smbldap_search(struct smbldap_state *ldap_state,
const char *base, int scope, const char *filter,
- char *attrs[], int attrsonly,
+ const char *attrs[], int attrsonly,
LDAPMessage **res)
{
int rc = LDAP_SERVER_DOWN;
run the search by name.
******************************************************************/
int smbldap_search_suffix (struct smbldap_state *ldap_state, const char *filter,
- char **search_attr, LDAPMessage ** result)
+ const char **search_attr, LDAPMessage ** result)
{
int scope = LDAP_SCOPE_SUBTREE;
int rc;
int ldap_op;
LDAPMessage *result = NULL;
int num_result;
- char **attr_list;
+ const char **attr_list;
uid_t u_low, u_high;
gid_t g_low, g_high;
uint32 rid_low, rid_high;
NTSTATUS ret = NT_STATUS_UNSUCCESSFUL;
pstring filter;
int rc;
- char **attr_list;
+ const char **attr_list;
int count;
pstr_sprintf(filter, "(&(objectClass=%s)(%s=%s))",
Return the list of attribute names given a user schema version.
**********************************************************************/
-static char** get_userattr_list( int schema_ver )
+static const char** get_userattr_list( int schema_ver )
{
switch ( schema_ver ) {
case SCHEMAVER_SAMBAACCOUNT:
Return the list of attribute names to delete given a user schema version.
**************************************************************************/
-static char** get_userattr_delete_list( int schema_ver )
+static const char** get_userattr_delete_list( int schema_ver )
{
switch ( schema_ver ) {
case SCHEMAVER_SAMBAACCOUNT:
static int ldapsam_search_suffix_by_name (struct ldapsam_privates *ldap_state,
const char *user,
- LDAPMessage ** result, char **attr)
+ LDAPMessage ** result,
+ const char **attr)
{
pstring filter;
char *escape_user = escape_ldap_string_alloc(user);
static int ldapsam_search_suffix_by_rid (struct ldapsam_privates *ldap_state,
uint32 rid, LDAPMessage ** result,
- char **attr)
+ const char **attr)
{
pstring filter;
int rc;
static int ldapsam_search_suffix_by_sid (struct ldapsam_privates *ldap_state,
const DOM_SID *sid, LDAPMessage ** result,
- char **attr)
+ const char **attr)
{
pstring filter;
int rc;
static NTSTATUS ldapsam_delete_entry(struct ldapsam_privates *ldap_state,
LDAPMessage *result,
const char *objectclass,
- char **attrs)
+ const char **attrs)
{
int rc;
LDAPMessage *entry = NULL;
for (name = ldap_first_attribute(ldap_state->smbldap_state->ldap_struct, entry, &ptr);
name != NULL;
name = ldap_next_attribute(ldap_state->smbldap_state->ldap_struct, entry, ptr)) {
- char **attrib;
+ const char **attrib;
/* We are only allowed to delete the attributes that
really exist. */
struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data;
int rc;
pstring filter, suffix;
- char **attr_list;
+ const char **attr_list;
BOOL machine_mask = False, user_mask = False;
pstr_sprintf( filter, "(&%s%s)", lp_ldap_filter(),
return NT_STATUS_OK;
}
-static void append_attr(char ***attr_list, const char *new_attr)
+static void append_attr(const char ***attr_list, const char *new_attr)
{
int i;
;
}
- (*attr_list) = SMB_REALLOC_ARRAY((*attr_list), char *, i+2);
+ (*attr_list) = SMB_REALLOC_ARRAY((*attr_list), const char *, i+2);
SMB_ASSERT((*attr_list) != NULL);
(*attr_list)[i] = SMB_STRDUP(new_attr);
(*attr_list)[i+1] = NULL;
LDAPMessage *result = NULL;
LDAPMessage *entry = NULL;
int count;
- char ** attr_list;
+ const char ** attr_list;
int rc;
attr_list = get_userattr_list( ldap_state->schema_ver );
const DOM_SID *sid, LDAPMessage **result)
{
int rc = -1;
- char ** attr_list;
+ const char ** attr_list;
uint32 rid;
switch ( ldap_state->schema_ver ) {
int rc;
LDAPMessage *result = NULL;
NTSTATUS ret;
- char **attr_list;
+ const char **attr_list;
fstring objclass;
if (!sam_acct) {
LDAPMessage *result = NULL;
LDAPMessage *entry = NULL;
LDAPMod **mods = NULL;
- char **attr_list;
+ const char **attr_list;
result = pdb_get_backend_private_data(newpwd, my_methods);
if (!result) {
LDAPMod **mods = NULL;
int ldap_op = LDAP_MOD_REPLACE;
uint32 num_result;
- char **attr_list;
+ const char **attr_list;
char *escape_user;
const char *username = pdb_get_username(newpwd);
const DOM_SID *sid = pdb_get_user_sid(newpwd);
{
int scope = LDAP_SCOPE_SUBTREE;
int rc;
- char **attr_list;
+ const char **attr_list;
attr_list = get_attr_list(groupmap_attr_list);
rc = smbldap_search(ldap_state->smbldap_state,
(struct ldapsam_privates *)methods->private_data;
struct smbldap_state *conn = ldap_state->smbldap_state;
pstring filter;
- char *attrs[] = { "gidNumber", "sambaSID", NULL };
+ const char *attrs[] = { "gidNumber", "sambaSID", NULL };
char *escape_name;
int rc;
LDAPMessage *msg = NULL;
pstring suffix;
pstring filter;
- char **attr_list;
+ const char **attr_list;
ldap_msgfree(result);
LDAPMessage *result = NULL;
int rc;
NTSTATUS ret;
- char **attr_list;
+ const char **attr_list;
sid_to_string(sidstring, &sid);
struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data;
fstring filter;
int rc;
- char **attr_list;
+ const char **attr_list;
pstr_sprintf( filter, "(objectclass=%s)", LDAP_OBJ_GROUPMAP);
attr_list = get_attr_list( groupmap_attr_list );
(struct ldapsam_privates *)methods->private_data;
LDAP *ldap_struct;
- char *attrs[] = { LDAP_ATTRIBUTE_SID, NULL };
+ const char *attrs[] = { LDAP_ATTRIBUTE_SID, NULL };
LDAPMessage *result = NULL;
LDAPMessage *entry = NULL;