int z;
for (z = 0; z < BLOCK_SIZE/4; z++) {
unsigned char *outptr = &out[z*4];
- unsigned char *inptr = &in[z*4];
+ const unsigned char *inptr = &in[z*4];
/*
* Use unaligned accesses. On x86, this will probably still be faster
* than multiple byte accesses for unaligned data, and for aligned data
*size = 0;
break;
case KRB5_CRYPTO_TYPE_DATA:
- *size = (size_t)~0; /* match Heimdal */
+ *size = (unsigned int)~0; /* match Heimdal */
break;
case KRB5_CRYPTO_TYPE_HEADER:
case KRB5_CRYPTO_TYPE_PADDING:
/* If reporting an error message, separate it. */
if (code) {
- char *emsg;
+ const char *emsg;
outbuf[sizeof(outbuf) - 1] = '\0';
emsg = krb5_get_error_message (err_context, code);
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved
- *
- * $Header$
*/
-#if !defined(lint) && !defined(__CODECENTER__)
-static char *rcsid = "$Header$";
-#endif
#include <kadm5/admin.h>
#include <stdlib.h>
#include "server_internal.h"
static krb5_principal
conv_princ_2db(krb5_context context, kdbe_princ_t *kdbe_princ)
{
- int i;
+ unsigned int i;
+ int j;
krb5_principal princ;
kdbe_data_t *components;
princ->data[i].data = NULL;
princ->length = (krb5_int32)kdbe_princ->k_components.k_components_len;
- for (i = 0; i < princ->length; i++) {
- princ->data[i].magic = components[i].k_magic;
- set_from_utf8str(&princ->data[i], components[i].k_data);
- if (princ->data[i].data == NULL)
+ for (j = 0; j < princ->length; j++) {
+ princ->data[j].magic = components[j].k_magic;
+ set_from_utf8str(&princ->data[j], components[j].k_data);
+ if (princ->data[j].data == NULL)
goto error;
}
{
kdb_incr_update_t *upd;
- int i, j, k, cnt;
+ unsigned int i, j;
+ int k, cnt;
if (updates == NULL)
return;
#include "kdb_log.h"
#include "kdb5int.h"
+#ifndef MAP_FAILED
+#define MAP_FAILED ((void *)-1)
+#endif
+
/*
* This modules includes all the necessary functions that create and
* modify the Kerberos principal update and header logs.
PROT_READ+PROT_WRITE, MAP_SHARED, ulogfd, 0);
}
- if ((int)(ulog) == -1) {
+ if (ulog == MAP_FAILED) {
/*
* Can't map update log file to memory
*/
*/
static int extend_file_to(int fd, uint_t new_size)
{
- int current_offset;
+ off_t current_offset;
static const char zero[512] = { 0, };
current_offset = lseek(fd, 0, SEEK_END);
errno = EINVAL;
return -1;
}
- while (current_offset < new_size) {
+ while (current_offset < (off_t)new_size) {
int write_size, wrote_size;
write_size = new_size - current_offset;
if (write_size > 512)
* Like end_sequence_of(), but uses the different (non-shadowing)
* variable names.
*/
-static asn1_error_code
+static inline asn1_error_code
end_sequence_of_no_tagvars_helper(asn1buf *buf, asn1buf *seqbufp,
int seqofindef)
{
va_list ap)
{
krb5_error_code retval = 0;
+ krb5_principal p;
+ char *first;
- krb5_principal p = malloc(sizeof(krb5_principal_data));
- if (!p) { retval = ENOMEM; }
-
- if (!retval) {
- retval = krb5_build_principal_va(context, p, rlen, realm, ap);
- }
+ p = malloc(sizeof(krb5_principal_data));
+ if (p == NULL)
+ return ENOMEM;
- if (!retval) {
- *princ = p;
- } else {
+ first = va_arg(ap, char *);
+ retval = krb5int_build_principal_va(context, p, rlen, realm, first, ap);
+ if (retval) {
free(p);
+ return retval;
}
- return retval;
+ *princ = p;
+ return 0;
}
krb5_error_code KRB5_CALLCONV_C
krb5_data *packet, int *result_code, krb5_data *result_data)
{
char *ptr;
- int plen, vno;
+ unsigned int plen, vno;
krb5_data ap_rep;
krb5_ap_rep_enc_part *ap_rep_enc;
krb5_error_code ret;
static krb5_error_code
complete(krb5_context context, krb5_tkt_creds_context ctx)
{
- krb5_error_code code;
-
TRACE_TKT_CREDS_COMPLETE(context, ctx->reply_creds->server);
/* Note the authdata we asked for in the output creds. */
return(ret);
}
- if ((salt->length == -1 || salt->length == SALT_TYPE_AFS_LENGTH) && (salt->data == NULL)) {
+ if (salt->length == SALT_TYPE_AFS_LENGTH && salt->data == NULL) {
if ((ret = krb5_principal2salt(context, client, &defsalt)))
return(ret);
/* Convert to signed 32 bit integer */
obuf32 = obuf;
- if (kret == 0 && obuf != obuf32)
+ if (kret == 0 && obuf > KRB5_INT32_MAX)
kret = EINVAL;
if (!kret)
(void) krb5_ser_pack_int32(obuf32, &bp, &remain);
if (len < 0)
return -1;
ds->cur_ans++;
- if (ds->nclass == ns_rr_class(rr)
- && ds->ntype == ns_rr_type(rr)) {
+ if (ds->nclass == (int)ns_rr_class(rr)
+ && ds->ntype == (int)ns_rr_type(rr)) {
*pp = ns_rr_rdata(rr);
*lenp = ns_rr_rdlen(rr);
return 0;
e = 0;
while (selstate->nfds > 0) {
- unsigned int i;
-
e = krb5int_cm_call_select(selstate, seltemp, &selret);
if (e == EINTR)
continue;