summaryrefslogtreecommitdiffstats
path: root/ldap/servers/slapd/fedse.c
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2005-03-05 04:29:24 +0000
committerRich Megginson <rmeggins@redhat.com>2005-03-05 04:29:24 +0000
commitb352660e243c7b9b7d050f1c38cff1c9faf278b1 (patch)
treeede08019beb931c3206609ab2377a015d510bdb4 /ldap/servers/slapd/fedse.c
parentf08951680ddfebc3f3df07e720ad0650fe473c0f (diff)
downloadds-b352660e243c7b9b7d050f1c38cff1c9faf278b1.tar.gz
ds-b352660e243c7b9b7d050f1c38cff1c9faf278b1.tar.xz
ds-b352660e243c7b9b7d050f1c38cff1c9faf278b1.zip
clean up sprintf usage and many other flawfinder issues; clean up compiler warnings on Linux; remove pam_passthru from DS 7.1
Diffstat (limited to 'ldap/servers/slapd/fedse.c')
-rw-r--r--ldap/servers/slapd/fedse.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/ldap/servers/slapd/fedse.c b/ldap/servers/slapd/fedse.c
index 6ef97b62..2b30760f 100644
--- a/ldap/servers/slapd/fedse.c
+++ b/ldap/servers/slapd/fedse.c
@@ -1691,7 +1691,7 @@ search_easter_egg( Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry *entr
char *fstr= NULL;
int retmalloc= 0;
char eggfilter[64];
- sprintf(eggfilter,"(objectclass=%s)",EGG_OBJECT_CLASS);
+ PR_snprintf(eggfilter,sizeof(eggfilter),"(objectclass=%s)",EGG_OBJECT_CLASS);
slapi_pblock_get( pb, SLAPI_SEARCH_STRFILTER, &fstr );
if(fstr!=NULL && strcasecmp(fstr,eggfilter)==0)
{
@@ -1711,7 +1711,7 @@ search_easter_egg( Slapi_PBlock *pb, Slapi_Entry *entryBefore, Slapi_Entry *entr
if ( errmsg != NULL ) {
slapi_log_error( SLAPI_LOG_PARSE, "dse", "%s", errmsg );
/* the memory below was not allocated by the slapi_ch_ functions */
- slapi_ch_free( (void**)&errmsg );
+ PR_smprintf_free(errmsg );
}
return SLAPI_DSE_CALLBACK_ERROR;
}
@@ -1844,8 +1844,7 @@ int fedse_create_startOK(char *filename, char *startokfilename, const char *con
realconfigdir = slapi_ch_malloc(strlen(configdir)+1);
strcpy(realconfigdir, configdir);
} else if (id!=NULL) {
- realconfigdir = slapi_ch_malloc(strlen(id)+strlen(config_sub_dir)+3);
- sprintf(realconfigdir, "%s/%s", id, config_sub_dir);
+ realconfigdir = slapi_ch_smprintf("%s/%s", id, config_sub_dir);
}
slapi_ch_free_string(&id);
if(realconfigdir!=NULL)
@@ -1853,17 +1852,13 @@ int fedse_create_startOK(char *filename, char *startokfilename, const char *con
/* Set the full path name for the config DSE entry */
if (!strstr(filename, realconfigdir))
{
- dse_filename = slapi_ch_malloc( strlen( realconfigdir ) +
- strlen( filename ) + 3 );
- sprintf( dse_filename, "%s/%s", realconfigdir, filename );
+ dse_filename = slapi_ch_smprintf("%s/%s", realconfigdir, filename );
}
else
dse_filename = slapi_ch_strdup(filename);
if (!strstr(startokfilename, realconfigdir)) {
- dse_filestartOK = slapi_ch_malloc( strlen( realconfigdir ) +
- strlen( startokfilename ) + 3 );
- sprintf( dse_filestartOK, "%s/%s", realconfigdir, startokfilename );
+ dse_filestartOK = slapi_ch_smprintf("%s/%s", realconfigdir, startokfilename );
}
else
dse_filestartOK = slapi_ch_strdup(startokfilename);