From 04b1ecd63235370143f3239301f26be69e5c961c Mon Sep 17 00:00:00 2001 From: Noriko Hosoi Date: Tue, 22 Jul 2014 11:50:57 -0700 Subject: [PATCH 237/243] Ticket #47863 - New defects found in 389-ds-base-1.2.11 Description: * Compiler Warnings 1-11. Defect type: COMPILER_WARNING 389-ds-base-1.2.11.15/ldap/servers/slapd/libglobs.c Casted to (long long int) to adjust to the format %lld. - ..., LONG_MAX ); + ..., (long long int)LONG_MAX ); Note: this is a partial backport of ticket #47450 from the master branch. (cherry picked from commit 502629aac8591808ff89e91bd76e626870967105) --- ldap/servers/slapd/libglobs.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/ldap/servers/slapd/libglobs.c b/ldap/servers/slapd/libglobs.c index b7dadcd..6711534 100644 --- a/ldap/servers/slapd/libglobs.c +++ b/ldap/servers/slapd/libglobs.c @@ -1288,7 +1288,7 @@ config_set_disk_threshold( const char *attrname, char *value, char *errorbuf, in if ( *endp != '\0' || threshold <= 4096 || errno == ERANGE ) { PR_snprintf ( errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "%s: \"%s\" is invalid, threshold must be greater than 4096 and less then %lld", - attrname, value, LONG_MAX ); + attrname, value, (long long int)LONG_MAX ); retVal = LDAP_OPERATIONS_ERROR; return retVal; } @@ -1786,7 +1786,7 @@ config_set_sizelimit( const char *attrname, char *value, char *errorbuf, int app if ( *endp != '\0' || errno == ERANGE || sizelimit < -1 ) { PR_snprintf ( errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "%s: \"%s\" is invalid, sizelimit must range from -1 to %lld", - attrname, value, LONG_MAX ); + attrname, value, (long long int)LONG_MAX ); retVal = LDAP_OPERATIONS_ERROR; return retVal; } @@ -1830,7 +1830,7 @@ config_set_pagedsizelimit( const char *attrname, char *value, char *errorbuf, in if ( *endp != '\0' || errno == ERANGE || pagedsizelimit < -1 ) { PR_snprintf ( errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "%s: \"%s\" is invalid, pagedsizelimit must range from -1 to %lld", - attrname, value, LONG_MAX ); + attrname, value, (long long int)LONG_MAX ); retVal = LDAP_OPERATIONS_ERROR; return retVal; } @@ -2593,7 +2593,7 @@ config_set_pw_gracelimit( const char *attrname, char *value, char *errorbuf, int if ( *endp != '\0' || errno == ERANGE || gracelimit < 0 ) { PR_snprintf ( errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "password grace limit \"%s\" is invalid, password grace limit must range from 0 to %lld", - value , LONG_MAX ); + value , (long long int)LONG_MAX ); retVal = LDAP_OPERATIONS_ERROR; return retVal; } @@ -3322,7 +3322,7 @@ config_set_ioblocktimeout( const char *attrname, char *value, char *errorbuf, in if ( *endp != '\0' || errno == ERANGE || nValue < 0 ) { PR_snprintf ( errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "%s: invalid value \"%s\", I/O block timeout must range from 0 to %lld", - attrname, value, LONG_MAX ); + attrname, value, (long long int)LONG_MAX ); retVal = LDAP_OPERATIONS_ERROR; return retVal; } @@ -3364,7 +3364,7 @@ config_set_idletimeout( const char *attrname, char *value, char *errorbuf, int a if (*endp != '\0' || errno == ERANGE || nValue < 0 ) { PR_snprintf ( errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "%s: invalid value \"%s\", idle timeout must range from 0 to %lld", - attrname, value, LONG_MAX ); + attrname, value, (long long int)LONG_MAX ); retVal = LDAP_OPERATIONS_ERROR; return retVal; } @@ -3466,10 +3466,10 @@ config_set_timelimit( const char *attrname, char *value, char *errorbuf, int app if ( *endp != '\0' || errno == ERANGE || nVal < -1 ) { PR_snprintf ( errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, - "%s: invalid value \"%s\", time limit must range from -1 to %lld", - attrname, value, LONG_MAX ); - retVal = LDAP_OPERATIONS_ERROR; - return retVal; + "%s: invalid value \"%s\", time limit must range from -1 to %lld", + attrname, value, (long long int)LONG_MAX ); + retVal = LDAP_OPERATIONS_ERROR; + return retVal; } if ( apply ) { @@ -3663,7 +3663,7 @@ config_set_pw_warning( const char *attrname, char *value, char *errorbuf, int ap PR_snprintf ( errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "%s: password warning age \"%s\" is invalid, password warning " "age must range from 0 to %lld seconds", - attrname, value, LONG_MAX ); + attrname, value, (long long int)LONG_MAX ); retVal = LDAP_OPERATIONS_ERROR; return retVal; } @@ -3693,7 +3693,8 @@ config_set_errorlog_level( const char *attrname, char *value, char *errorbuf, in if ( *endp != '\0' || errno == ERANGE || level < 0 ) { PR_snprintf ( errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "%s: error log level \"%s\" is invalid," - " error log level must range from 0 to %lld", attrname, value, LONG_MAX ); + " error log level must range from 0 to %lld", + attrname, value, (long long int)LONG_MAX ); retVal = LDAP_OPERATIONS_ERROR; return retVal; } @@ -3731,7 +3732,8 @@ config_set_accesslog_level( const char *attrname, char *value, char *errorbuf, i if ( *endp != '\0' || errno == ERANGE || level < 0 ) { PR_snprintf ( errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "%s: access log level \"%s\" is invalid," - " access log level must range from 0 to %lld", attrname, value, LONG_MAX ); + " access log level must range from 0 to %lld", + attrname, value, (long long int)LONG_MAX ); retVal = LDAP_OPERATIONS_ERROR; return retVal; } @@ -5096,7 +5098,7 @@ config_set_maxsasliosize( const char *attrname, char *value, char *errorbuf, int if (retVal != LDAP_SUCCESS) { PR_snprintf(errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "%s: \"%s\" is invalid. Value must range from -1 to %lld", - attrname, value, LONG_MAX ); + attrname, value, (long long int)LONG_MAX ); } else if (apply) { CFG_LOCK_WRITE(slapdFrontendConfig); slapdFrontendConfig->maxsasliosize = maxsasliosize; -- 1.8.1.4