mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-26 16:16:31 -06:00
ipa-kdb: unexpected error code in 'ipa_kdb_audit_as_req' triggers a message
This patch is related this defect reported by covscan on FreeIPA master: """ Error: DEADCODE (CWE-561): /daemons/ipa-kdb/ipa_kdb_audit_as.c:42: cond_const: Condition "error_code != -1765328353L", taking false branch. Now the value of "error_code" is equal to -1765328353. /daemons/ipa-kdb/ipa_kdb_audit_as.c:42: cond_const: Condition "error_code != -1765328360L", taking false branch. Now the value of "error_code" is equal to -1765328360. /daemons/ipa-kdb/ipa_kdb_audit_as.c:42: cond_const: Condition "error_code != 0", taking false branch. Now the value of "error_code" is equal to 0. /daemons/ipa-kdb/ipa_kdb_audit_as.c:71: intervals: When switching on "error_code", the value of "error_code" must be in one of the following intervals: {[-1765328360,-1765328360], [-1765328353,-1765328353], [0,0]}. /daemons/ipa-kdb/ipa_kdb_audit_as.c:71: dead_error_condition: The switch value "error_code" cannot reach the default case. /daemons/ipa-kdb/ipa_kdb_audit_as.c:123: dead_error_begin: Execution cannot reach this statement: "default:". """ This patch is a part of series related to https://fedorahosted.org/freeipa/ticket/4795. Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
parent
e29f9280fd
commit
98b1690a0e
@ -20,6 +20,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <syslog.h>
|
||||
#include "ipa_kdb.h"
|
||||
#include "ipa_pwd.h"
|
||||
|
||||
@ -121,6 +122,9 @@ void ipadb_audit_as_req(krb5_context kcontext,
|
||||
client->mask |= KMASK_LAST_FAILED;
|
||||
break;
|
||||
default:
|
||||
krb5_klog_syslog(LOG_ERR,
|
||||
"File '%s' line %d: Got an unexpected value of "
|
||||
"error_code: %d\n", __FILE__, __LINE__, error_code);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -54,9 +54,6 @@ struct ipadb_mspac {
|
||||
time_t last_update;
|
||||
};
|
||||
|
||||
|
||||
int krb5_klog_syslog(int, const char *, ...);
|
||||
|
||||
static char *user_pac_attrs[] = {
|
||||
"objectClass",
|
||||
"uid",
|
||||
|
@ -30,6 +30,8 @@ struct keys_container {
|
||||
#define KEYTAB_RET_OID "2.16.840.1.113730.3.8.10.2"
|
||||
#define KEYTAB_GET_OID "2.16.840.1.113730.3.8.10.5"
|
||||
|
||||
int krb5_klog_syslog(int, const char *, ...);
|
||||
|
||||
void
|
||||
ipa_krb5_free_ktypes(krb5_context context, krb5_enctype *val);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user