fa620fc Ticket #48800 - Cleaning up error buffers

Authored and Committed by nhosoi 8 years ago
30 files changed. 549 lines added. 626 lines removed.
ldap/servers/plugins/acl/acllas.c
file modified
+33 -31
ldap/servers/plugins/acl/aclutil.c
file modified
+27 -25
ldap/servers/plugins/replication/repl5_connection.c
file modified
+2 -4
ldap/servers/plugins/replication/windows_connection.c
file modified
+2 -4
ldap/servers/plugins/retrocl/retrocl.c
file modified
+11 -11
ldap/servers/plugins/syntaxes/string.c
file modified
+7 -6
ldap/servers/slapd/add.c
file modified
+3 -3
ldap/servers/slapd/attr.c
file modified
+8 -11
ldap/servers/slapd/back-ldbm/import-threads.c
file modified
+11 -12
ldap/servers/slapd/back-ldbm/ldbm_config.c
file modified
+54 -56
ldap/servers/slapd/back-ldbm/ldbm_instance_config.c
file modified
+7 -12
ldap/servers/slapd/bind.c
file modified
+5 -5
ldap/servers/slapd/compare.c
file modified
+1 -1
ldap/servers/slapd/config.c
file modified
+2 -2
ldap/servers/slapd/daemon.c
file modified
+1 -2
ldap/servers/slapd/delete.c
file modified
+1 -1
ldap/servers/slapd/detach.c
file modified
+2 -3
ldap/servers/slapd/dn.c
file modified
+2 -4
ldap/servers/slapd/libglobs.c
file modified
+251 -301
ldap/servers/slapd/log.c
file modified
+32 -46
ldap/servers/slapd/mapping_tree.c
file modified
+22 -32
ldap/servers/slapd/modify.c
file modified
+4 -3
ldap/servers/slapd/modrdn.c
file modified
+2 -1
ldap/servers/slapd/opshared.c
file modified
+2 -1
ldap/servers/slapd/pw.c
file modified
+24 -36
ldap/servers/slapd/saslbind.c
file modified
+1 -2
ldap/servers/slapd/schema.c
file modified
+7 -9
ldap/servers/slapd/slapi-private.h
file modified
+9 -0
ldap/servers/slapd/ssl.c
file modified
+1 -2
ldap/servers/slapd/util.c
file modified
+15 -0
    Ticket #48800 - Cleaning up error buffers
    
    Description: The changes in this patch is mainly one of these,
    1. unifying error buffer size to SLAPI_DSE_RETURNTEXT_SIZE.
       An error buf is filled either in config, mapping-tree, log, pass-
       word code, where the size SLAPI_DSE_RETURNTEXT_SIZE is expected,
       while some callers declare BUFSIZ array and pass it.
       Note: SLAPI_DSE_RETURNTEXT_SIZE is defined as 512 in slapi-plugin.h.
    
    2. replacing PR_snprintf with slapi_create_errormsg.
       slapi_create_errormsg is almost the same as PR_snprintf except
       2-1 the former does not do anything if the place to write the error
           message is NULL.  With this change, we can skip returning an
           error message if it is not needed.
       2-2 If buffer size 0 is given, sizeof(buffer) is used as the size
           of buffer.  The strict size is supposed to be passed only when
           the error buffer is allocated on the heap.
    
    3. Avoiding unnecessary array.
       Caller sometimes declares an error buffer even though it does not
       use it.  This patch removed such error buffer declaration or moved
       it in the local block where it is being used.
    
    https://fedorahosted.org/389/ticket/48800
    
    Reviewed by wibrown@redhat.com (Thank you, William!!)
    
        
file modified
+3 -3
file modified
+8 -11
file modified
+5 -5
file modified
+1 -1
file modified
+2 -2
file modified
+1 -2
file modified
+1 -1
file modified
+2 -3
file modified
+2 -4
file modified
+251 -301
file modified
+32 -46
file modified
+4 -3
file modified
+2 -1
file modified
+24 -36
file modified
+7 -9
file modified
+1 -2
file modified
+15 -0