From e1e643ea41117e06c9262ecff43b785674910b58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Kuzn=C3=ADk?= Date: Fri, 15 Feb 2019 13:52:23 +0000 Subject: [PATCH] ITS#8731 Manual adjustments --- contrib/slapd-modules/nops/nops.c | 4 +-- libraries/librewrite/config.c | 56 +++++++++++++++---------------- libraries/librewrite/ldapmap.c | 4 +-- libraries/librewrite/xmap.c | 6 ++-- servers/slapd/acl.c | 2 +- servers/slapd/back-ldap/chain.c | 2 +- servers/slapd/back-wt/dn2id.c | 2 +- servers/slapd/daemon.c | 24 ++++++------- servers/slapd/limits.c | 4 +-- servers/slapd/modify.c | 13 +++---- 10 files changed, 57 insertions(+), 60 deletions(-) diff --git a/contrib/slapd-modules/nops/nops.c b/contrib/slapd-modules/nops/nops.c index 1dcd1c5cc2..fcb406900d 100644 --- a/contrib/slapd-modules/nops/nops.c +++ b/contrib/slapd-modules/nops/nops.c @@ -130,8 +130,8 @@ nops_modify( Operation *op, SlapReply *rs ) continue; /* This is a nop, remove it */ - Debug(LDAP_DEBUG_TRACE, "removing nop on %s%s%s", - a->a_desc->ad_cname.bv_val, "", ""); + Debug(LDAP_DEBUG_TRACE, "removing nop on %s", + a->a_desc->ad_cname.bv_val, 0, 0 ); nops_rm_mod(&op->orm_modlist, mc); } diff --git a/libraries/librewrite/config.c b/libraries/librewrite/config.c index f868540da7..8af7292f1e 100644 --- a/libraries/librewrite/config.c +++ b/libraries/librewrite/config.c @@ -67,15 +67,15 @@ rewrite_parse( if ( strcasecmp( argv[ 0 ], "rewriteEngine" ) == 0 ) { if ( argc < 2 ) { Debug( LDAP_DEBUG_ANY, - "[%s:%d] rewriteEngine needs 'state'\n%s", - fname, lineno, "" ); + "[%s:%d] rewriteEngine needs 'state'\n", + fname, lineno, 0 ); return -1; } else if ( argc > 2 ) { Debug( LDAP_DEBUG_ANY, "[%s:%d] extra fields in rewriteEngine" - " will be discarded\n%s", - fname, lineno, "" ); + " will be discarded\n", + fname, lineno, 0 ); } if ( strcasecmp( argv[ 1 ], "on" ) == 0 ) { @@ -87,8 +87,8 @@ rewrite_parse( } else { Debug( LDAP_DEBUG_ANY, "[%s:%d] unknown 'state' in rewriteEngine;" - " assuming 'on'\n%s", - fname, lineno, "" ); + " assuming 'on'\n", + fname, lineno, 0 ); info->li_state = REWRITE_ON; } rc = REWRITE_SUCCESS; @@ -99,8 +99,8 @@ rewrite_parse( } else if ( strcasecmp( argv[ 0 ], "rewriteMaxPasses" ) == 0 ) { if ( argc < 2 ) { Debug( LDAP_DEBUG_ANY, - "[%s:%d] rewriteMaxPasses needs 'value'\n%s", - fname, lineno, "" ); + "[%s:%d] rewriteMaxPasses needs 'value'\n", + fname, lineno, 0 ); return -1; } @@ -144,8 +144,8 @@ rewrite_parse( } else if ( strcasecmp( argv[ 0 ], "rewriteContext" ) == 0 ) { if ( argc < 2 ) { Debug( LDAP_DEBUG_ANY, - "[%s:%d] rewriteContext needs 'name'\n%s", - fname, lineno, "" ); + "[%s:%d] rewriteContext needs 'name'\n", + fname, lineno, 0 ); return -1; } @@ -178,8 +178,8 @@ rewrite_parse( Debug( LDAP_DEBUG_ANY, "[%s:%d] rewriteContext" " needs 'name' after" - " 'alias'\n%s", - fname, lineno, "" ); + " 'alias'\n", + fname, lineno, 0 ); return -1; } else if ( argc > 4 ) { @@ -188,8 +188,8 @@ rewrite_parse( " rewriteContext" " after aliased name" " will be" - " discarded\n%s", - fname, lineno, "" ); + " discarded\n", + fname, lineno, 0 ); } aliased = rewrite_context_find( info, @@ -211,8 +211,8 @@ rewrite_parse( Debug( LDAP_DEBUG_ANY, "[%s:%d] extra fields" " in rewriteContext" - " will be discarded\n%s", - fname, lineno, "" ); + " will be discarded\n", + fname, lineno, 0 ); } } rc = REWRITE_SUCCESS; @@ -224,22 +224,22 @@ rewrite_parse( if ( argc < 3 ) { Debug( LDAP_DEBUG_ANY, "[%s:%d] rewriteRule needs 'pattern'" - " 'subst' ['flags']\n%s", - fname, lineno, "" ); + " 'subst' ['flags']\n", + fname, lineno, 0 ); return -1; } else if ( argc > 4 ) { Debug( LDAP_DEBUG_ANY, "[%s:%d] extra fields in rewriteRule" - " will be discarded\n%s", - fname, lineno, "" ); + " will be discarded\n", + fname, lineno, 0 ); } if ( rewrite_int_curr_context == NULL ) { Debug( LDAP_DEBUG_ANY, "[%s:%d] rewriteRule outside a" - " context; will add to default\n%s", - fname, lineno, "" ); + " context; will add to default\n", + fname, lineno, 0 ); rewrite_int_curr_context = rewrite_context_find( info, REWRITE_DEFAULT_CONTEXT ); @@ -260,8 +260,8 @@ rewrite_parse( if ( argc < 3 ) { Debug( LDAP_DEBUG_ANY, "[%s:%d] rewriteMap needs at least 'type'" - " and 'name' ['args']\n%s", - fname, lineno, "" ); + " and 'name' ['args']\n", + fname, lineno, 0 ); return -1; } @@ -275,8 +275,8 @@ rewrite_parse( if ( argc < 3 ) { Debug( LDAP_DEBUG_ANY, "[%s:%d] rewriteParam needs 'name'" - " and 'value'\n%s", - fname, lineno, "" ); + " and 'value'\n", + fname, lineno, 0 ); return -1; } @@ -432,8 +432,8 @@ rewrite_parse_builtin_map( */ } else { free( map ); - Debug( LDAP_DEBUG_ANY, "[%s:%d] unknown map type\n%s", - fname, lineno, "" ); + Debug( LDAP_DEBUG_ANY, "[%s:%d] unknown map type\n", + fname, lineno ); return -1; } diff --git a/libraries/librewrite/ldapmap.c b/libraries/librewrite/ldapmap.c index da4bd3575a..2f2c5de243 100644 --- a/libraries/librewrite/ldapmap.c +++ b/libraries/librewrite/ldapmap.c @@ -106,8 +106,8 @@ map_ldap_parse( if ( argc < 1 ) { Debug( LDAP_DEBUG_ANY, - "[%s:%d] ldap map needs URI\n%s", - fname, lineno, "" ); + "[%s:%d] ldap map needs URI\n", + fname, lineno, 0 ); free( data ); return NULL; } diff --git a/libraries/librewrite/xmap.c b/libraries/librewrite/xmap.c index fb228fd11e..da5438de5e 100644 --- a/libraries/librewrite/xmap.c +++ b/libraries/librewrite/xmap.c @@ -55,15 +55,15 @@ rewrite_xmap_parse( assert( s != NULL ); assert( currpos != NULL ); - Debug( LDAP_DEBUG_ARGS, "rewrite_xmap_parse: %s\n%s%s", - s, "", "" ); + Debug( LDAP_DEBUG_ARGS, "rewrite_xmap_parse: %s\n", + s, 0, 0 ); *currpos = NULL; map = calloc( sizeof( struct rewrite_map ), 1 ); if ( map == NULL ) { Debug( LDAP_DEBUG_ANY, "rewrite_xmap_parse:" - " calloc failed\n%s%s%s", "", "", "" ); + " calloc failed\n", 0, 0, 0 ); return NULL; } diff --git a/servers/slapd/acl.c b/servers/slapd/acl.c index d7c2a48ccc..59a74e5013 100644 --- a/servers/slapd/acl.c +++ b/servers/slapd/acl.c @@ -2632,7 +2632,7 @@ acl_string_expand( *dp = '\0'; bv->bv_len = size; - Debug( LDAP_DEBUG_ACL, "=> acl_string_expand: pattern: %.*s\n", (int)pat->bv_len, pat->bv_val, 0 ); + Debug( LDAP_DEBUG_ACL, "=> acl_string_expand: pattern: %.*s\n", (int)pat->bv_len, pat->bv_val ); Debug( LDAP_DEBUG_ACL, "=> acl_string_expand: expanded: %s\n", bv->bv_val, 0, 0 ); return 0; diff --git a/servers/slapd/back-ldap/chain.c b/servers/slapd/back-ldap/chain.c index fd1c7809a3..043ab4a667 100644 --- a/servers/slapd/back-ldap/chain.c +++ b/servers/slapd/back-ldap/chain.c @@ -1327,7 +1327,7 @@ chain_ldadd( CfEntryInfo *p, Entry *e, ConfigArgs *ca ) Debug( LDAP_DEBUG_ANY, "slapd-chain: " "first underlying database \"%s\" " "cannot contain attribute \"%s\".\n", - e->e_name.bv_val, ad->ad_cname.bv_val, 0 ); + e->e_name.bv_val, ad->ad_cname.bv_val ); rc = LDAP_CONSTRAINT_VIOLATION; goto done; diff --git a/servers/slapd/back-wt/dn2id.c b/servers/slapd/back-wt/dn2id.c index 3c9a15f011..eddfe5f812 100644 --- a/servers/slapd/back-wt/dn2id.c +++ b/servers/slapd/back-wt/dn2id.c @@ -371,7 +371,7 @@ wt_dn2id( Debug( LDAP_DEBUG_ANY, LDAP_XSTRING(wt_dn2id) ": cursor open failed: %s (%d)\n", - wiredtiger_strerror(rc), rc, 0 ); + wiredtiger_strerror(rc), rc ); return rc; } cursor->set_key(cursor, dn->bv_val); diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index da4651ec2b..fee323ec75 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -207,7 +207,7 @@ static slap_daemon_st slap_daemon[SLAPD_MAX_DAEMON_THREADS]; if (!events) { \ Debug(LDAP_DEBUG_ANY, \ "daemon: SLAP_EVENT_INIT: ch_malloc of events failed, wanted %d bytes\n", \ - sizeof(*events) * SLAP_EVENT_MAX(t), 0, 0); \ + sizeof(*events) * SLAP_EVENT_MAX(t)); \ slapd_shutdown = 2; \ } \ } \ @@ -216,7 +216,7 @@ static slap_daemon_st slap_daemon[SLAPD_MAX_DAEMON_THREADS]; # define SLAP_SOCK_INIT(t) do { \ int kq_i; \ size_t kq_nbytes; \ - Debug(LDAP_DEBUG_ANY, "daemon: SLAP_SOCK_INIT: dtblsize=%d\n", dtblsize, 0, 0); \ + Debug(LDAP_DEBUG_ANY, "daemon: SLAP_SOCK_INIT: dtblsize=%d\n", dtblsize); \ slap_daemon[t].sd_nfds = 0; \ slap_daemon[t].sd_changeidx = 0; \ for (kq_i = 0; kq_i < 2; kq_i++) { \ @@ -228,7 +228,7 @@ static slap_daemon_st slap_daemon[SLAPD_MAX_DAEMON_THREADS]; if (!kqc->sd_changes) { \ Debug(LDAP_DEBUG_ANY, \ "daemon: SLAP_SOCK_INIT: ch_calloc of slap_daemon.sd_changes[%d] failed, wanted %d bytes, shutting down\n", \ - kq_i, kq_nbytes, 0); \ + kq_i, kq_nbytes); \ slapd_shutdown = 2; \ } \ } \ @@ -237,7 +237,7 @@ static slap_daemon_st slap_daemon[SLAPD_MAX_DAEMON_THREADS]; if (!slap_daemon[t].sd_fdmodes) { \ Debug(LDAP_DEBUG_ANY, \ "daemon: SLAP_SOCK_INIT: ch_calloc of slap_daemon.sd_fdmodes failed, wanted %d bytes, shutting down\n", \ - kq_nbytes, 0, 0); \ + kq_nbytes); \ slapd_shutdown = 2; \ } \ kq_nbytes = sizeof(*slap_daemon[t].sd_l) * dtblsize; \ @@ -245,12 +245,12 @@ static slap_daemon_st slap_daemon[SLAPD_MAX_DAEMON_THREADS]; if (!slap_daemon[t].sd_l) { \ Debug(LDAP_DEBUG_ANY, \ "daemon: SLAP_SOCK_INIT: ch_calloc of slap_daemon.sd_l failed, wanted %d bytes, shutting down\n", \ - kq_nbytes, 0, 0); \ + kq_nbytes); \ slapd_shutdown = 2; \ } \ slap_daemon[t].sd_kq = kqueue(); \ if (slap_daemon[t].sd_kq < 0) { \ - Debug(LDAP_DEBUG_ANY, "daemon: SLAP_SOCK_INIT: kqueue() failed, errno=%d, shutting down\n", errno, 0, 0); \ + Debug(LDAP_DEBUG_ANY, "daemon: SLAP_SOCK_INIT: kqueue() failed, errno=%d, shutting down\n", errno); \ slapd_shutdown = 2; \ } \ } while (0) @@ -321,7 +321,7 @@ static slap_daemon_st slap_daemon[SLAPD_MAX_DAEMON_THREADS]; if (!kqc->sd_changes) { \ Debug(LDAP_DEBUG_ANY, \ "daemon: SLAP_KQUEUE_CHANGE: ch_realloc of slap_daemon.sd_kqc[%d].sd_changes failed, wanted %d bytes, shutting down\n", \ - slap_daemon[t].sd_changeidx, kq_nbytes, 0); \ + slap_daemon[t].sd_changeidx, kq_nbytes); \ slapd_shutdown = 2; \ break; /* Don't want to do the EV_SET if sd_changes is NULL */ \ } \ @@ -476,7 +476,7 @@ static slap_daemon_st slap_daemon[SLAPD_MAX_DAEMON_THREADS]; } else { \ Debug( LDAP_DEBUG_ANY, \ "daemon: epoll_ctl(ADD,fd=%d) failed, errno=%d, shutting down\n", \ - s, errno, 0 ); \ + s, errno ); \ slapd_shutdown = 2; \ } \ } while (0) @@ -639,7 +639,7 @@ static slap_daemon_st slap_daemon[SLAPD_MAX_DAEMON_THREADS]; * need to shutdown. */ # define SLAP_SOCK_ADD(t, s, l) do { \ - Debug( LDAP_DEBUG_CONNS, "SLAP_SOCK_ADD(%d, %p)\n", (s), (l), 0 ); \ + Debug( LDAP_DEBUG_CONNS, "SLAP_SOCK_ADD(%d, %p)\n", (s), (l) ); \ SLAP_DEVPOLL_SOCK_IX(t,(s)) = slap_daemon[t].sd_nfds; \ SLAP_DEVPOLL_SOCK_LX(t,(s)) = (l); \ SLAP_DEVPOLL_SOCK_FD(t,(s)) = (s); \ @@ -652,7 +652,7 @@ static slap_daemon_st slap_daemon[SLAPD_MAX_DAEMON_THREADS]; # define SLAP_SOCK_DEL(t,s) do { \ int fd, index = SLAP_DEVPOLL_SOCK_IX(t,(s)); \ - Debug( LDAP_DEBUG_CONNS, "SLAP_SOCK_DEL(%d)\n", (s), 0, 0 ); \ + Debug( LDAP_DEBUG_CONNS, "SLAP_SOCK_DEL(%d)\n", (s) ); \ if ( index < 0 ) break; \ if ( index < slap_daemon[t].sd_nfds - 1 ) { \ struct pollfd pfd = slap_daemon[t].sd_pollfd[index]; \ @@ -701,7 +701,7 @@ static slap_daemon_st slap_daemon[SLAPD_MAX_DAEMON_THREADS]; if ( slap_daemon[t].sd_dpfd == -1 ) { \ Debug( LDAP_DEBUG_ANY, "daemon: " SLAP_EVENT_FNAME ": " \ "open(\"" SLAP_EVENT_FNAME "\") failed errno=%d\n", \ - errno, 0, 0 ); \ + errno ); \ SLAP_SOCK_DESTROY(t); \ return -1; \ } \ @@ -3239,7 +3239,7 @@ slap_sig_shutdown( int sig ) int i; #if 0 - Debug(LDAP_DEBUG_TRACE, "slap_sig_shutdown: signal %d\n", sig, 0, 0); + Debug(LDAP_DEBUG_TRACE, "slap_sig_shutdown: signal %d\n", sig); #endif /* diff --git a/servers/slapd/limits.c b/servers/slapd/limits.c index 813a9b721f..cf2a9b8bf5 100644 --- a/servers/slapd/limits.c +++ b/servers/slapd/limits.c @@ -328,8 +328,8 @@ limits_parse( if ( argc < 3 ) { Debug( LDAP_DEBUG_ANY, "%s : line %d: missing arg(s) in " - "\"limits \" line.\n%s", - fname, lineno, "" ); + "\"limits \" line.\n", + fname, lineno, 0 ); return( -1 ); } diff --git a/servers/slapd/modify.c b/servers/slapd/modify.c index 44f11d7e9e..2a4c84d779 100644 --- a/servers/slapd/modify.c +++ b/servers/slapd/modify.c @@ -116,17 +116,14 @@ do_modify( "replace")), tmp->sml_type.bv_val, 0 ); if ( tmp->sml_values == NULL ) { - Debug( LDAP_DEBUG_ARGS, "%s\n", - "\t\tno values", NULL, NULL ); + Debug( LDAP_DEBUG_ARGS, "\t\tno values\n" ); } else if ( BER_BVISNULL( &tmp->sml_values[ 0 ] ) ) { - Debug( LDAP_DEBUG_ARGS, "%s\n", - "\t\tzero values", NULL, NULL ); + Debug( LDAP_DEBUG_ARGS, "\t\tzero values\n" ); } else if ( BER_BVISNULL( &tmp->sml_values[ 1 ] ) ) { - Debug( LDAP_DEBUG_ARGS, "%s, length %ld\n", - "\t\tone value", (long) tmp->sml_values[0].bv_len, NULL ); + Debug( LDAP_DEBUG_ARGS, "\t\tone value, length %ld\n", + (long) tmp->sml_values[0].bv_len ); } else { - Debug( LDAP_DEBUG_ARGS, "%s\n", - "\t\tmultiple values", NULL, NULL ); + Debug( LDAP_DEBUG_ARGS, "\t\tmultiple values\n" ); } }