perror("read");
exit(5);
}
- if (count < in_buf->length) {
+ if ((size_t)count < in_buf->length) {
fprintf(stderr, "Warning, only read in %d bytes, expected %d\n",
count, (int)in_buf->length);
}
call_server(char *host, u_short port, gss_OID oid, char *service_name,
OM_uint32 gss_flags, int auth_flag, int wrap_flag,
int encrypt_flag, int mic_flag, int v1_format, char *msg,
- int use_file, int mcount)
+ int use_file, size_t mcount)
{
gss_ctx_id_t context;
gss_buffer_desc in_buf, out_buf, sname, tname, oid_name;
gss_buffer_desc tok;
OM_uint32 maj_stat, min_stat;
- if (isdigit((int)mechanism[0])) {
+ if (isdigit((unsigned char)mechanism[0])) {
if (asprintf(&mechstr, "{ %s }", mechanism) < 0) {
fprintf(stderr, "Couldn't allocate mechanism scratch!\n");
return;
if (tok->length > 0xffffffffUL)
abort();
store_32_be(tok->length, lenbuf);
- ret = write_all(s, lenbuf, 4);
+ ret = write_all(s, (char *)lenbuf, 4);
if (ret < 0) {
perror("sending token length");
return -1;
if (ret < 0) {
perror("sending token data");
return -1;
- } else if (ret != tok->length) {
+ } else if ((size_t)ret != tok->length) {
if (display_file) {
fprintf(display_file,
"sending token data: %d of %d bytes written\n",
if (char_flags == 0) {
lenbuf[0] = 0;
- ret = read_all(s, &lenbuf[1], 3);
+ ret = read_all(s, (char *)&lenbuf[1], 3);
if (ret < 0) {
perror("reading token length");
return -1;
return -1;
}
} else {
- ret = read_all(s, lenbuf, 4);
+ ret = read_all(s, (char *)lenbuf, 4);
if (ret < 0) {
perror("reading token length");
return -1;
}
}
- tok->length = ((lenbuf[0] << 24) | (lenbuf[1] << 16) | (lenbuf[2] << 8) |
- lenbuf[3]);
+ tok->length = load_32_be(lenbuf);
tok->value = malloc(tok->length ? tok->length : 1);
if (tok->length && tok->value == NULL) {
if (display_file)
perror("reading token data");
free(tok->value);
return -1;
- } else if (ret != tok->length) {
+ } else if ((size_t)ret != tok->length) {
fprintf(stderr, "sending token data: %d of %d bytes written\n",
ret, (int)tok->length);
free(tok->value);
static void
display_status_1(char *m, OM_uint32 code, int type)
{
- OM_uint32 maj_stat, min_stat;
+ OM_uint32 min_stat;
gss_buffer_desc msg;
OM_uint32 msg_ctx;
msg_ctx = 0;
while (1) {
- maj_stat = gss_display_status(&min_stat, code, type, GSS_C_NULL_OID,
- &msg_ctx, &msg);
+ (void)gss_display_status(&min_stat, code, type, GSS_C_NULL_OID,
+ &msg_ctx, &msg);
if (display_file) {
fprintf(display_file, "GSS-API error %s: %s\n", m,
(char *)msg.value);
{
gss_buffer_desc client_name, xmit_buf, msg_buf;
gss_ctx_id_t context;
- OM_uint32 maj_stat, min_stat;
- int i, conf_state, ret_flags, token_flags;
+ OM_uint32 maj_stat, min_stat, ret_flags;
+ int i, conf_state, token_flags;
char *cp;
/* Establish a context with the client */
if (logfile) {
fprintf(logfile, "Received message: ");
cp = msg_buf.value;
- if ((isprint((int)cp[0]) || isspace((int)cp[0])) &&
- (isprint((int)cp[1]) || isspace((int)cp[1]))) {
+ if (isprint((unsigned char)cp[0]) &&
+ isprint((unsigned char)cp[1])) {
fprintf(logfile, "\"%.*s\"\n", (int)msg_buf.length,
(char *)msg_buf.value);
} else {