diff options
author | Simo Sorce <ssorce@redhat.com> | 2011-06-14 16:04:26 -0400 |
---|---|---|
committer | Simo Sorce <ssorce@redhat.com> | 2011-08-26 08:24:48 -0400 |
commit | e261c556268609b24bc923fd33b8b060dfaf1c19 (patch) | |
tree | e52bde5c0c649cbbf40e9dec1cc47e8983937425 /daemons | |
parent | 1b4eab0411cd4e669e3bd18541f5736c9aa81467 (diff) | |
download | freeipa-e261c556268609b24bc923fd33b8b060dfaf1c19.tar.gz freeipa-e261c556268609b24bc923fd33b8b060dfaf1c19.tar.xz freeipa-e261c556268609b24bc923fd33b8b060dfaf1c19.zip |
Fix build warnings
Some are actual bugs.
Diffstat (limited to 'daemons')
-rw-r--r-- | daemons/ipa-slapi-plugins/ipa-enrollment/ipa_enrollment.c | 2 | ||||
-rw-r--r-- | daemons/ipa-slapi-plugins/ipa-lockout/ipa_lockout.c | 22 | ||||
-rw-r--r-- | daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_common.c | 4 |
3 files changed, 15 insertions, 13 deletions
diff --git a/daemons/ipa-slapi-plugins/ipa-enrollment/ipa_enrollment.c b/daemons/ipa-slapi-plugins/ipa-enrollment/ipa_enrollment.c index 5d276de53..7c79b4be8 100644 --- a/daemons/ipa-slapi-plugins/ipa-enrollment/ipa_enrollment.c +++ b/daemons/ipa-slapi-plugins/ipa-enrollment/ipa_enrollment.c @@ -103,7 +103,7 @@ ipaenrollement_secure(Slapi_PBlock *pb, char **errMesg) if (NULL == realm) { *errMesg = "Kerberos realm is not set.\n"; - LOG_FATAL("%s", errMesg); + LOG_FATAL("%s", *errMesg); rc = LDAP_OPERATIONS_ERROR; goto done; } diff --git a/daemons/ipa-slapi-plugins/ipa-lockout/ipa_lockout.c b/daemons/ipa-slapi-plugins/ipa-lockout/ipa_lockout.c index 0284872b8..806425428 100644 --- a/daemons/ipa-slapi-plugins/ipa-lockout/ipa_lockout.c +++ b/daemons/ipa-slapi-plugins/ipa-lockout/ipa_lockout.c @@ -343,15 +343,15 @@ static int ipalockout_postop(Slapi_PBlock *pb) time_now = time(NULL); if (lastfail != NULL) { struct tm tm; - int ret = 0; + int res = 0; memset(&tm, 0, sizeof(struct tm)); - ret = sscanf(lastfail, + res = sscanf(lastfail, "%04u%02u%02u%02u%02u%02u", &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &tm.tm_sec); - if (ret == 6) { + if (res == 6) { tm.tm_year -= 1900; tm.tm_mon -= 1; @@ -562,21 +562,23 @@ static int ipalockout_preop(Slapi_PBlock *pb) unlock_time = slapi_entry_attr_get_charptr(target_entry, "krbLastAdminUnlock"); if (lastfail != NULL) { struct tm tm; - int ret = 0; + int res = 0; memset(&tm, 0, sizeof(struct tm)); - ret = sscanf(lastfail, + res = sscanf(lastfail, "%04u%02u%02u%02u%02u%02u", &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &tm.tm_sec); - if (ret == 6) { + if (res == 6) { tm.tm_year -= 1900; tm.tm_mon -= 1; last_failed = timegm(&tm); - LOG("%d > %d ?\n", time_now, last_failed + failcnt_interval); - LOG("diff %d\n", (last_failed + failcnt_interval) - time_now); + LOG("%ld > %ld ?\n", + (long)time_now, (long)last_failed + failcnt_interval); + LOG("diff %ld\n", + (long)((last_failed + failcnt_interval) - time_now)); if (time_now > last_failed + failcnt_interval) { failedcount = 0; } @@ -585,12 +587,12 @@ static int ipalockout_preop(Slapi_PBlock *pb) time_t unlock; memset(&tm, 0, sizeof(struct tm)); - ret = sscanf(lastfail, + res = sscanf(lastfail, "%04u%02u%02u%02u%02u%02u", &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &tm.tm_sec); - if (ret == 6) { + if (res == 6) { tm.tm_year -= 1900; tm.tm_mon -= 1; diff --git a/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_common.c b/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_common.c index fc9ccb05c..dc295fc7e 100644 --- a/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_common.c +++ b/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipapwd_common.c @@ -1082,7 +1082,7 @@ int ipapwd_get_cur_kvno(Slapi_Entry *target) LOG_TRACE("Error retrieving berval from Slapi_Value\n"); goto next; } - be = ber_init(cbval); + be = ber_init(discard_const(cbval)); if (!be) { LOG_TRACE("ber_init() failed!\n"); goto next; @@ -1292,7 +1292,7 @@ Slapi_Value **ipapwd_setPasswordHistory(Slapi_Mods *smods, count = 0; err = slapi_attr_get_numvalues(passwordHistory, &count); /* if we have one */ - if (count > 0 && data->pwHistoryLen > 0) { + if (err == 0 && count > 0 && data->pwHistoryLen > 0) { pH = calloc(count + 2, sizeof(Slapi_Value *)); if (!pH) { LOG_OOM(); |