summaryrefslogtreecommitdiffstats
path: root/ldap/servers/plugins/pwdstorage
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/plugins/pwdstorage
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/plugins/pwdstorage')
-rw-r--r--ldap/servers/plugins/pwdstorage/crypt_pwd.c6
-rw-r--r--ldap/servers/plugins/pwdstorage/ssha_pwd.c2
2 files changed, 2 insertions, 6 deletions
diff --git a/ldap/servers/plugins/pwdstorage/crypt_pwd.c b/ldap/servers/plugins/pwdstorage/crypt_pwd.c
index 4c0f1221..28aab7a4 100644
--- a/ldap/servers/plugins/pwdstorage/crypt_pwd.c
+++ b/ldap/servers/plugins/pwdstorage/crypt_pwd.c
@@ -79,11 +79,7 @@ crypt_pw_enc( char *pwd )
cry = crypt( pwd, salt );
if ( cry != NULL )
{
- enc = slapi_ch_malloc( 3 + CRYPT_NAME_LEN + strlen( cry ));
- if ( enc != NULL )
- {
- sprintf( enc, "%c%s%c%s", PWD_HASH_PREFIX_START, CRYPT_SCHEME_NAME, PWD_HASH_PREFIX_END, cry );
- }
+ enc = slapi_ch_smprintf("%c%s%c%s", PWD_HASH_PREFIX_START, CRYPT_SCHEME_NAME, PWD_HASH_PREFIX_END, cry );
}
PR_Unlock(cryptlock);
return( enc );
diff --git a/ldap/servers/plugins/pwdstorage/ssha_pwd.c b/ldap/servers/plugins/pwdstorage/ssha_pwd.c
index 194ee817..a65bd797 100644
--- a/ldap/servers/plugins/pwdstorage/ssha_pwd.c
+++ b/ldap/servers/plugins/pwdstorage/ssha_pwd.c
@@ -97,7 +97,7 @@ salted_sha1_pw_enc( char *pwd )
return( NULL );
}
- if (( enc = PR_Malloc( 3 + SALTED_SHA1_NAME_LEN +
+ if (( enc = slapi_ch_malloc( 3 + SALTED_SHA1_NAME_LEN +
LDIF_BASE64_LEN(sizeof(hash)))) == NULL ) {
return( NULL );
}