• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ slapi_ch_free_string函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中slapi_ch_free_string函数的典型用法代码示例。如果您正苦于以下问题:C++ slapi_ch_free_string函数的具体用法?C++ slapi_ch_free_string怎么用?C++ slapi_ch_free_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了slapi_ch_free_string函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: check_db_version

/*
 * this function reads the db/DBVERSION file and check
 * 1) if the db version is supported, and
 * 2) if the db version requires some migration operation
 *
 * return: 0: supported
 *         DBVERSION_NOT_SUPPORTED: not supported
 *
 * action: 0: nothing is needed
 *         DBVERSION_UPGRADE_3_4: db3->db4 uprev is needed
 *         DBVERSION_UPGRADE_4_4: db4->db4 uprev is needed
 *         DBVERSION_UPGRADE_4_5: db4->db  uprev is needed
 */
int
check_db_version( struct ldbminfo *li, int *action )
{
    int value = 0;
    char *ldbmversion = NULL;
    char *dataversion = NULL;

    *action = 0;
    dbversion_read(li, li->li_directory, &ldbmversion, &dataversion);
    if (NULL == ldbmversion || '\0' == *ldbmversion) {
        slapi_ch_free_string(&dataversion);
        return 0;
    }

    value = lookup_dbversion( ldbmversion, DBVERSION_TYPE | DBVERSION_ACTION );
    if ( !value )
    {
        LDAPDebug( LDAP_DEBUG_ANY,
           "ERROR: Database version mismatch (expecting "
           "'%s' but found '%s' in directory %s)\n",
            LDBM_VERSION, ldbmversion, li->li_directory );
        /*
         * A non-zero return here will cause slapd to exit during startup.
         */
        slapi_ch_free_string(&ldbmversion);
        slapi_ch_free_string(&dataversion);
        return DBVERSION_NOT_SUPPORTED;
    }
    if ( value & DBVERSION_UPGRADE_3_4 )
    {
        dblayer_set_recovery_required(li);
        *action = DBVERSION_UPGRADE_3_4;
    }
    else if ( value & DBVERSION_UPGRADE_4_4 )
    {
        dblayer_set_recovery_required(li);
        *action = DBVERSION_UPGRADE_4_4;
    }
    else if ( value & DBVERSION_UPGRADE_4_5 )
    {
        dblayer_set_recovery_required(li);
        *action = DBVERSION_UPGRADE_4_5;
    }
    if (value & DBVERSION_RDN_FORMAT) {
        if (entryrdn_get_switch()) {
            /* nothing to do */
        } else {
            *action |= DBVERSION_NEED_RDN2DN;
        }
    } else {
        if (entryrdn_get_switch()) {
            *action |= DBVERSION_NEED_DN2RDN;
        } else {
            /* nothing to do */
        }
    }
    slapi_ch_free_string(&ldbmversion);
    slapi_ch_free_string(&dataversion);
    return 0;
}
开发者ID:leto,项目名称:389-ds,代码行数:73,代码来源:upgrade.c


示例2: ldbm_instance_destructor

/* (ie, only when an instance is being deleted) */
static void 
ldbm_instance_destructor(void **arg)
{
    ldbm_instance *inst = (ldbm_instance *) *arg;

    slapi_log_err(SLAPI_LOG_ERR, "ldbm_instance_destructor", "Destructor for instance %s called\n", 
              inst->inst_name);

    slapi_counter_destroy(&(inst->inst_ref_count));
    slapi_ch_free_string(&inst->inst_name);
    PR_DestroyLock(inst->inst_config_mutex);
    slapi_ch_free_string(&inst->inst_dir_name);
    slapi_ch_free_string(&inst->inst_parent_dir_name);
    PR_DestroyMonitor(inst->inst_db_mutex);
    PR_DestroyLock(inst->inst_handle_list_mutex);
    PR_DestroyLock(inst->inst_nextid_mutex);
    PR_DestroyCondVar(inst->inst_indexer_cv);
    attrinfo_deletetree(inst);
    if (inst->inst_dataversion) {
        slapi_ch_free((void **)&inst->inst_dataversion);
    }
    /* cache has already been destroyed */

    slapi_ch_free((void **)&inst);
}
开发者ID:Firstyear,项目名称:ds,代码行数:26,代码来源:instance.c


示例3: slapi_ch_realloc

char *
slapi_ch_realloc( char *block, unsigned long size )
{
	char	*newmem;
    unsigned long lsize;
	unsigned long origsize;
	char *realblock;
	char *realnewmem;

	if ( block == NULL ) {
		return( slapi_ch_malloc( size ) );
	}

	if (size <= 0) {
		log_negative_alloc_msg( "realloc", "bytes", size );
		return block;
	}

	lsize = size + sizeof(unsigned long);
	if (lsize <= 1024) {
		newmem = slapi_ch_realloc_core( block, lsize );
	} else if (lsize <= 67108864) {
		/* return 2KB ~ 64MB memory to memory pool */
		unsigned long roundup = 1;
		int n = 0;
		while (1) {
			roundup <<= 1;
			n++;
			if (roundup >= lsize) {
				break;
			}
		}
		PR_ASSERT(n >= 11 && n <= 26);
		newmem = (char *)mempool_get(n-11);	/* 11: 2^11 = 2K */
		if (NULL == newmem) {
			newmem = slapi_ch_realloc_core( block, roundup );
		} else {
			realblock = block - sizeof(unsigned long);
			origsize = *(unsigned long *)realblock - sizeof(unsigned long);;
			memcpy(newmem, block, origsize);
			slapi_ch_free_string(&block);
		}
	} else {
		realblock = block - sizeof(unsigned long);
		origsize = *(unsigned long *)realblock - sizeof(unsigned long);;
		newmem = slapi_ch_mmap( size );
		memcpy(newmem, block, origsize);
		realnewmem = newmem - sizeof(unsigned long);
		*(unsigned long *)realnewmem = lsize;
		slapi_ch_free_string(&block);
	}
	if(!counters_created)
	{
		create_counters();
		counters_created= 1;
	}
    PR_INCREMENT_COUNTER(slapi_ch_counter_realloc);

	return( newmem );
}
开发者ID:Firstyear,项目名称:ds,代码行数:60,代码来源:mempool.c


示例4: sasl_map_config_parse_entry

static int
sasl_map_config_parse_entry(Slapi_Entry *entry, sasl_map_data **new_dp)
{
	int ret = 0;
	int priority;
	char *regex = NULL;
	char *basedntemplate = NULL;
	char *filtertemplate = NULL;
	char *priority_str = NULL;
	char *map_name = NULL;

	*new_dp = NULL;
	regex = _sasl_unescape_parenthesis(slapi_entry_attr_get_charptr( entry, "nsSaslMapRegexString" ));
	basedntemplate = slapi_entry_attr_get_charptr( entry, "nsSaslMapBaseDNTemplate" );
	filtertemplate = slapi_entry_attr_get_charptr( entry, "nsSaslMapFilterTemplate" );
	map_name = slapi_entry_attr_get_charptr( entry, "cn" );
	priority_str = slapi_entry_attr_get_charptr( entry, "nsSaslMapPriority" );

	if(priority_str){
		priority = atoi(priority_str);
	} else {
		priority = LOW_PRIORITY;
	}
	if(priority < 1 || priority > LOW_PRIORITY){
		struct berval desc;
		struct berval *newval[2] = {0, 0};

		desc.bv_val = LOW_PRIORITY_STR;
		desc.bv_len = strlen(desc.bv_val);
		newval[0] = &desc;
		if (entry_replace_values(entry, "nsSaslMapPriority", newval) != 0){
			slapi_log_err(SLAPI_LOG_ERR, "sasl_map_config_parse_entry", "Failed to reset entry "
					"priority to (%d) - previous value (%s)\n", LOW_PRIORITY,  priority_str);
		} else {
			slapi_log_err(SLAPI_LOG_ERR, "sasl_map_config_parse_entry", "Resetting invalid nsSaslMapPriority "
					" value (%s) to the lowest priority (%d)\n",
					priority_str, LOW_PRIORITY);
		}
		priority = LOW_PRIORITY;
	}
	if ( (NULL == map_name) || (NULL == regex) ||
		 (NULL == basedntemplate) || (NULL == filtertemplate) ) {
		/* Invalid entry */
		ret = -1;
	} else {
		/* Make the new dp */
		*new_dp = sasl_map_new_data(map_name, regex, basedntemplate, filtertemplate, priority);
	}

	if (ret) {
		slapi_ch_free_string(&map_name);
		slapi_ch_free_string(&regex);
		slapi_ch_free_string(&basedntemplate);
		slapi_ch_free_string(&filtertemplate);
	}
	slapi_ch_free_string(&priority_str);

	return ret;
}
开发者ID:Firstyear,项目名称:ds,代码行数:59,代码来源:sasl_map.c


示例5: ipa_winsync_upg_enabled

/*
 * Check if User Private Groups are enabled in given IPA domain
 * Returns: 0 - UPG are enabled
 *          1 - UPG are disabled
 *         -1 - some sort of error
 */
static int
ipa_winsync_upg_enabled(const Slapi_DN *ds_subtree)
{
    int ret = -1;
    int rc;
    char * dn = NULL;
    Slapi_Entry *entry = NULL;
    Slapi_Backend *be;
    const Slapi_DN *ds_suffix = NULL;
    Slapi_DN *sdn = NULL;
    const char *attrs_list[] = {IPA_WINSYNC_UPG_DEF_ATTR, 0};
    char * value = NULL;

    /* find ancestor base DN */
    be = slapi_be_select(ds_subtree);
    ds_suffix = slapi_be_getsuffix(be, 0);
    if (ds_suffix == NULL) {
        LOG_FATAL("Invalid DS subtree [%s]\n", slapi_sdn_get_dn(ds_subtree));
        goto done;
    }

    dn = slapi_ch_smprintf(IPA_WINSYNC_UPG_DEF_DN, slapi_sdn_get_dn(ds_suffix));

    if (!dn) {
        LOG_OOM();
        goto done;
    }

    sdn = slapi_sdn_new_dn_byref(dn);
    rc = slapi_search_internal_get_entry(sdn, (char **) attrs_list, &entry,
                                         ipa_winsync_get_plugin_identity());

    if (rc) {
        LOG("failed to retrieve UPG definition (%s) with rc %d\n", dn, rc);
        goto done;
    }

    value = slapi_entry_attr_get_charptr(entry, IPA_WINSYNC_UPG_DEF_ATTR);

    if (!value) {
        LOG("failed to read %s from UPG definition (%s)\n",
             IPA_WINSYNC_UPG_DEF_ATTR, dn);
        goto done;
    }

    if (strstr(value, IPA_WINSYNC_UPG_DEF_DISABLED) == NULL) {
        ret = 0;
    } else {
        ret = 1;
    }

done:
    slapi_ch_free_string(&dn);
    slapi_sdn_free(&sdn);
    slapi_ch_free_string(&value);
    slapi_entry_free(entry);

    return ret;
}
开发者ID:AvidehST,项目名称:freeipa,代码行数:65,代码来源:ipa-winsync-config.c


示例6: free_config

void
free_config()
{
	slapi_ch_free_string(&globalcfg.state_attr_name);
	slapi_ch_free_string(&globalcfg.alt_state_attr_name);
	slapi_ch_free_string(&globalcfg.spec_attr_name);
	slapi_ch_free_string(&globalcfg.limit_attr_name);
	slapi_ch_free_string(&globalcfg.always_record_login_attr);
}
开发者ID:Firstyear,项目名称:ds,代码行数:9,代码来源:acct_config.c


示例7: sasl_map_free_data

static void 
sasl_map_free_data(sasl_map_data **dp)
{
	slapi_ch_free_string(&(*dp)->name);
	slapi_ch_free_string(&(*dp)->regular_expression);
	slapi_ch_free_string(&(*dp)->template_base_dn);
	slapi_ch_free_string(&(*dp)->template_search_filter);
	slapi_ch_free((void**)dp);
}
开发者ID:Firstyear,项目名称:ds,代码行数:9,代码来源:sasl_map.c


示例8: snmp_collator_start

int snmp_collator_start()
{

  int err;
  char *statspath = config_get_rundir();
  char *instdir = config_get_configdir();
  char *instname = NULL;

  /*
   * Get directory for our stats file
   */
  if (NULL == statspath) {
     statspath = slapi_ch_strdup("/tmp");
  }

  instname = PL_strrstr(instdir, "slapd-");
  if (!instname) {
      instname = PL_strrstr(instdir, "/");
      if (instname) {
          instname++;
      }
  }
  PR_snprintf(szStatsFile, sizeof(szStatsFile), "%s/%s%s",
              statspath, instname, AGT_STATS_EXTENSION);
  PR_snprintf(stats_sem_name, sizeof(stats_sem_name), "/%s%s",
              instname, AGT_STATS_EXTENSION);
  tmpstatsfile = szStatsFile;
  slapi_ch_free_string(&statspath);
  slapi_ch_free_string(&instdir);

  /* open the memory map */
  if ((err = agt_mopen_stats(tmpstatsfile, O_RDWR,  &hdl) != 0))
  {
    if (err != EEXIST)      /* Ignore if file already exists */
    {
      slapi_log_error(SLAPI_LOG_FATAL, "snmp collator", "Failed to open stats file (%s) "
                      "(error %d): %s.\n", szStatsFile, err, slapd_system_strerror(err));
      exit(1);
    }
  }

  /* Create semaphore for stats file access */
  snmp_collator_create_semaphore();

  /* point stats struct at mmap data */
  stats = (struct agt_stats_t *) mmap_tbl [hdl].fp;

  /* initialize stats data */
  snmp_collator_init();

  /* Arrange to be called back periodically to update the mmap'd stats file. */
  snmp_eq_ctx = slapi_eq_repeat(snmp_collator_update, NULL, (time_t)0,
                                SLAPD_SNMP_UPDATE_INTERVAL);
  return 0;
}
开发者ID:leto,项目名称:389-ds,代码行数:55,代码来源:snmp_collator.c


示例9: linked_attrs_fixup_task_destructor

static void
linked_attrs_fixup_task_destructor(Slapi_Task *task)
{
	if (task) {
		task_data *mydata = (task_data *)slapi_task_get_data(task);
		if (mydata) {
			slapi_ch_free_string(&mydata->linkdn);
			slapi_ch_free_string(&mydata->bind_dn);
			/* Need to cast to avoid a compiler warning */
			slapi_ch_free((void **)&mydata);
		}
	}
}
开发者ID:leto,项目名称:389-ds,代码行数:13,代码来源:fixup_task.c


示例10: slapi_sdn_done

void slapi_sdn_done( Slapi_DN *sdn )
{
	if ( sdn == NULL )
		return;

	if ( sdn->flag & FLAG_DN ) {
		slapi_ch_free_string( &sdn->dn.bv_val );
	}
	if ( sdn->flag & FLAG_NDN ) {
		slapi_ch_free_string( &sdn->ndn.bv_val );
	}

	slapi_sdn_init( sdn );
}
开发者ID:Distrotech,项目名称:openldap,代码行数:14,代码来源:slapi_dn.c


示例11: sidgen_task_destructor

static void sidgen_task_destructor(Slapi_Task *task)
{
    struct worker_ctx *worker_ctx;

    if (task != NULL) {
        worker_ctx = slapi_task_get_data(task);
        if (worker_ctx != NULL) {
            free_ranges(&worker_ctx->ranges);
            slapi_ch_free_string(&worker_ctx->dom_sid);
            slapi_ch_free_string(&worker_ctx->base_dn);
            slapi_ch_free((void **) &worker_ctx);
        }
    }
}
开发者ID:jtux270,项目名称:translate,代码行数:14,代码来源:ipa_sidgen_task.c


示例12: referint_postop_init

int
referint_postop_init( Slapi_PBlock *pb )
{
    Slapi_Entry *plugin_entry = NULL;
    char *plugin_type = NULL;
    int delfn = SLAPI_PLUGIN_POST_DELETE_FN;
    int mdnfn = SLAPI_PLUGIN_POST_MODRDN_FN;

    /*
     *  Get plugin identity and stored it for later use.
     *  Used for internal operations.
     */
    slapi_pblock_get (pb, SLAPI_PLUGIN_IDENTITY, &referint_plugin_identity);
    PR_ASSERT (referint_plugin_identity);

    /* get the args */
    if ((slapi_pblock_get(pb, SLAPI_PLUGIN_CONFIG_ENTRY, &plugin_entry) == 0) &&
         plugin_entry &&
         (plugin_type = slapi_entry_attr_get_charptr(plugin_entry, "nsslapd-plugintype")) &&
         plugin_type && strstr(plugin_type, "betxn"))
    {
        delfn = SLAPI_PLUGIN_BE_TXN_POST_DELETE_FN;
        mdnfn = SLAPI_PLUGIN_BE_TXN_POST_MODRDN_FN;
        use_txn = 1;
    }
    if(plugin_entry){
        char *allow_repl_updates;

        allow_repl_updates = slapi_entry_attr_get_charptr(plugin_entry, "nsslapd-pluginAllowReplUpdates");
        if(allow_repl_updates && strcasecmp(allow_repl_updates,"on")==0){
            allow_repl = 1;
        }
        slapi_ch_free_string(&allow_repl_updates);
    }
    slapi_ch_free_string(&plugin_type);

    if ( slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, SLAPI_PLUGIN_VERSION_01 ) != 0 ||
         slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, (void *)&pdesc ) != 0 ||
         slapi_pblock_set( pb, delfn, (void *) referint_postop_del ) != 0 ||
         slapi_pblock_set( pb, mdnfn, (void *) referint_postop_modrdn ) != 0 ||
         slapi_pblock_set( pb, SLAPI_PLUGIN_START_FN, (void *) referint_postop_start ) != 0 ||
         slapi_pblock_set( pb, SLAPI_PLUGIN_CLOSE_FN, (void *) referint_postop_close ) != 0)
    {
        slapi_log_error( SLAPI_LOG_FATAL, REFERINT_PLUGIN_SUBSYSTEM, "referint_postop_init failed\n" );
        return( -1 );
    }

    return( 0 );
}
开发者ID:ohamada,项目名称:389ds,代码行数:49,代码来源:referint.c


示例13: usn_bepostop_init

static int
usn_bepostop_init(Slapi_PBlock *pb)
{
    int rc = 0;
    Slapi_Entry *plugin_entry = NULL;
    char *plugin_type = NULL;
    int postadd = SLAPI_PLUGIN_BE_POST_ADD_FN;
    int postmod = SLAPI_PLUGIN_BE_POST_MODIFY_FN;
    int postmdn = SLAPI_PLUGIN_BE_POST_MODRDN_FN;
    int postdel = SLAPI_PLUGIN_BE_POST_DELETE_FN;

    if ((slapi_pblock_get(pb, SLAPI_PLUGIN_CONFIG_ENTRY, &plugin_entry) == 0) &&
        plugin_entry &&
        (plugin_type = slapi_entry_attr_get_charptr(plugin_entry,
                                                    "nsslapd-plugintype")) &&
        plugin_type && strstr(plugin_type, "betxn")) {
        postadd = SLAPI_PLUGIN_BE_TXN_POST_ADD_FN;
        postmod = SLAPI_PLUGIN_BE_TXN_POST_MODIFY_FN;
        postmdn = SLAPI_PLUGIN_BE_TXN_POST_MODRDN_FN;
        postdel = SLAPI_PLUGIN_BE_TXN_POST_DELETE_FN;
    }
    slapi_ch_free_string(&plugin_type);

    if ((slapi_pblock_set(pb, postadd, (void *)usn_bepostop) != 0) ||
        (slapi_pblock_set(pb, postdel, (void *)usn_bepostop_delete) != 0) ||
        (slapi_pblock_set(pb, postmod, (void *)usn_bepostop_modify) != 0) ||
        (slapi_pblock_set(pb, postmdn, (void *)usn_bepostop) != 0)) {
        slapi_log_error(SLAPI_LOG_FATAL, USN_PLUGIN_SUBSYSTEM,
                     "usn_bepostop_init: failed to register bepostop plugin\n");
        rc = -1;
    }

    return rc;
}
开发者ID:leto,项目名称:389-ds,代码行数:34,代码来源:usn.c


示例14: delete_my_str_buf

static void
delete_my_str_buf(MyStrBuf *buf)
{
	if (buf->str != buf->fixbuf) {
		slapi_ch_free_string(&(buf->str));
	}
}
开发者ID:leto,项目名称:389-ds,代码行数:7,代码来源:pam_ptimpl.c


示例15: get_plugin_config_dn_and_entry

static void
get_plugin_config_dn_and_entry( char *msg, Slapi_PBlock *pb )
{
	char		*dn = NULL;
	Slapi_Entry	*e = NULL;
	int			loglevel = SLAPI_LOG_PLUGIN;

	if ( slapi_pblock_get( pb, SLAPI_TARGET_DN, &dn ) != 0 || dn == NULL ) {
		slapi_log_err( loglevel, msg, "failed to get plugin config DN\n" );
	} else {
		slapi_log_err( loglevel, msg, "this plugin's config DN is \"%s\"\n",
				dn );
	}

	if ( slapi_pblock_get( pb, SLAPI_ADD_ENTRY, &e ) != 0 || e == NULL ) {
		slapi_log_err( loglevel, msg, "failed to get plugin config entry\n" );
	} else {
		char	*ldif;

		ldif = slapi_entry2str_with_options( e, NULL, 0 );
		slapi_log_err( loglevel, msg,
				"this plugin's config entry is \"\n%s\"\n", ldif );
		slapi_ch_free_string( &ldif );
	}
}
开发者ID:Firstyear,项目名称:ds,代码行数:25,代码来源:testpreop.c


示例16: db_put_dn

void
db_put_dn(char *data_dn)
{
    int ret;
	char *db_path = DATABASE;
	char *db_path_bak = DATABASE_BACK;
	PRFileInfo64 info;
	PRFileDesc *prfd;
	PRInt32 data_sz;
	char *data_dnp = NULL;

	if(db_lock == NULL){
		db_lock = PR_NewLock();
	}
	PR_Lock(db_lock);
	/* if db_path is a directory, rename it */
	ret =  PR_GetFileInfo64(db_path, &info);
	if (PR_SUCCESS == ret) {
		if (PR_FILE_DIRECTORY == info.type) {    /* directory */
			ret =  PR_GetFileInfo64(db_path_bak, &info);
			if (PR_SUCCESS == ret) {
				if (PR_FILE_DIRECTORY != info.type) {    /* not a directory */
					PR_Delete(db_path_bak);
				}
			}
			PR_Rename(db_path, db_path_bak);
		}
	}

	/* open a file */
	if ((prfd = PR_Open(db_path, PR_RDWR | PR_CREATE_FILE | PR_APPEND, 0600)) == NULL ) {
		slapi_log_error(SLAPI_LOG_FATAL, DB_PLUGIN_NAME,
				"db: Could not open file \"%s\" for read/write; %d (%s)\n",
				db_path, PR_GetError(), slapd_pr_strerror(PR_GetError()));
		return;
	}

	data_dnp = slapi_ch_smprintf("%s\n", data_dn);
	data_sz = (PRInt32)strlen(data_dnp);

	ret = PR_Write(prfd, data_dnp, data_sz);
	if (ret == data_sz) {
		slapi_log_error(SLAPI_LOG_PLUGIN, DB_PLUGIN_NAME,
						"db: %s: key stored.\n", data_dn);
		ret = 0;
	} else  {
		slapi_log_error(SLAPI_LOG_FATAL, DB_PLUGIN_NAME,
				"db: Failed to store key \"%s\"; %d (%s)\n",
				data_dn, PR_GetError(), slapd_pr_strerror(PR_GetError()));
		ret = 1;
	}
    if(ret) {
		slapi_log_error(SLAPI_LOG_FATAL, DB_PLUGIN_NAME,
						"db: Error detected in db_put_dn \n");
    }
	slapi_ch_free_string(&data_dnp);
	PR_Close(prfd);
	PR_Unlock(db_lock);
	return;
}
开发者ID:ohamada,项目名称:389ds,代码行数:60,代码来源:testdbinterop.c


示例17: sasl_map_config_modify

int
sasl_map_config_modify(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, int *returncode, char *returntext, void *arg)
{
	sasl_map_private *priv = sasl_map_get_global_priv();
	sasl_map_data *dp;
	char *map_name = NULL;
	int ret = SLAPI_DSE_CALLBACK_ERROR;

	if((map_name = slapi_entry_attr_get_charptr( entryBefore, "cn" )) == NULL){
		slapi_log_err(SLAPI_LOG_TRACE, "sasl_map_config_modify", "Could not find name of map\n");
		return ret;
	}
	if(sasl_map_remove_list_entry(priv, map_name) == 0){
		ret = sasl_map_config_parse_entry(e, &dp);
		if (!ret && dp) {
			ret = sasl_map_insert_list_entry(priv, dp);
			if(ret == 0){
				ret = SLAPI_DSE_CALLBACK_OK;
			}
		}
	}
	if(ret == SLAPI_DSE_CALLBACK_ERROR){
		slapi_log_err(SLAPI_LOG_TRACE, "sasl_map_config_modify", "Failed to update map(%s)\n",map_name);
	}
	slapi_ch_free_string(&map_name);

	return ret;
}
开发者ID:Firstyear,项目名称:ds,代码行数:28,代码来源:sasl_map.c


示例18: oath_token_free

void oath_token_free(Token *token) {

    if (token->pin) {
        slapi_ch_free_string(&token->pin);
        token->pin = NULL;
    }

    if (token->serial) {
        slapi_ch_free_string(&token->serial);
        token->serial = NULL;
    }

    if (token->seed) {
        ber_bvfree(token->seed);
        token->seed = NULL;
    }

}
开发者ID:cargosoft,项目名称:oath-slapi,代码行数:18,代码来源:oath.c


示例19: mr_private_done

static void
mr_private_done(struct mr_private *mrpriv)
{
	if (mrpriv) {
		mrpriv->pi = NULL;
		mrpriv->oid = NULL;
		slapi_ch_free_string(&mrpriv->type);
		mrpriv->value = NULL;
		mrpriv->ftype = 0;
		mrpriv->op = 0;
		slapi_ch_free_string(&mrpriv->initial);
		slapi_ch_free_string(&mrpriv->any[0]);
		slapi_ch_free_string(&mrpriv->final);
		mrpriv->match_fn = NULL;
		mrpriv->values[0] = NULL;
	}
	mr_private_indexer_done(mrpriv);
}
开发者ID:Firstyear,项目名称:ds,代码行数:18,代码来源:plugin_mr.c


示例20: ber_bvdone

static void ber_bvdone(struct berval *bvp)
{
    if (bvp == NULL) return;

    slapi_ch_free_string(&bvp->bv_val);
    bvp->bv_len = 0;

    return;
}
开发者ID:Firstyear,项目名称:ds,代码行数:9,代码来源:value.c



注:本文中的slapi_ch_free_string函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ slapi_ch_malloc函数代码示例发布时间:2022-05-30
下一篇:
C++ slap_sl_free函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap