diff options
author | Jeremy Allison <jra@samba.org> | 1998-05-12 00:55:32 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1998-05-12 00:55:32 +0000 |
commit | 2d774454005f0b54e5684cf618da7060594dfcbb (patch) | |
tree | d3e7831d1d5eb0cc21a78dadb51d63a82c269d2d /source/passdb/ldap.c | |
parent | c760ebbf127796427c4602aae61952df938c6def (diff) | |
download | samba-2d774454005f0b54e5684cf618da7060594dfcbb.tar.gz |
This is a security audit change of the main source.
It removed all ocurrences of the following functions :
sprintf
strcpy
strcat
The replacements are slprintf, safe_strcpy and safe_strcat.
It should not be possible to use code in Samba that uses
sprintf, strcpy or strcat, only the safe_equivalents.
Once Andrew has fixed the slprintf implementation then
this code will be moved back to the 1.9.18 code stream.
Jeremy.
Diffstat (limited to 'source/passdb/ldap.c')
-rw-r--r-- | source/passdb/ldap.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/passdb/ldap.c b/source/passdb/ldap.c index 7af8a1b9f10..0c9847becfe 100644 --- a/source/passdb/ldap.c +++ b/source/passdb/ldap.c @@ -114,7 +114,7 @@ BOOL ldap_search_one_user_by_name(LDAP *ldap_struct, char *user, LDAPMessage **r in the filter expression, replace %u with the real name so in ldap filter, %u MUST exist :-) */ - strcpy(filter,lp_ldap_filter()); + pstrcpy(filter,lp_ldap_filter()); string_sub(filter,"%u",user); if ( !ldap_search_one_user(ldap_struct, filter, result) ) @@ -152,7 +152,7 @@ void get_single_attribute(LDAP *ldap_struct, LDAPMessage *entry, char *attribute if ( (valeurs=ldap_get_values(ldap_struct, entry, attribute)) != NULL) { - strcpy(value, valeurs[0]); + pstrcpy(value, valeurs[0]); ldap_value_free(valeurs); DEBUG(3,("get_single_attribute: [%s]=[%s]\n", attribute, value)); } @@ -451,7 +451,7 @@ void *startldappwent(BOOL update) int scope = LDAP_SCOPE_ONELEVEL; int rc; - char filter[256]; + pstring filter; if (!ldap_open_connection(&ldap_ent.ldap_struct)) /* open a connection to the server */ return NULL; @@ -464,17 +464,17 @@ void *startldappwent(BOOL update) { case 1: { - strcpy(filter, "objectclass=sambaAccount"); + pstrcpy(filter, "objectclass=sambaAccount"); break; } case 2: { - strcpy(filter, "objectclass=sambaMachine"); + pstrcpy(filter, "objectclass=sambaMachine"); break; } default: { - strcpy(filter, "(|(objectclass=sambaMachine)(objectclass=sambaAccount))"); + pstrcpy(filter, "(|(objectclass=sambaMachine)(objectclass=sambaAccount))"); break; } } |