size_t outlen = 0;
unsigned char *p,*q;
int require_conversion = 0;
- u_int16_t flags = conv_flags;
+ u_int16_t flags = conv_flags;
cnid_t id;
- p = name;
- q = buffer;
+ p = (unsigned char *)name;
+ q = (unsigned char *)buffer;
/* optimize for ascii case */
while (*p != 0) {
}
/* convert charsets */
- q=buffer;
- p=name;
+ q=(unsigned char *)buffer;
+ p=(unsigned char *)name;
- outlen = convert_charset(ch_from, ch_to, ch_mac, p, strlen(p), q, sizeof(buffer) -2, &flags);
+ outlen = convert_charset(ch_from, ch_to, ch_mac, (char *)p, strlen((char *)p), (char *)q, sizeof(buffer) -2, &flags);
if ((size_t)-1 == outlen) {
if ( ch_to == CH_UTF8) {
/* maybe name is already in UTF8? */
flags = conv_flags;
- q = (char*) buffer;
- p = name;
- outlen = convert_charset(ch_to, ch_to, ch_mac, p, strlen(p), q, sizeof(buffer) -2, &flags);
+ q = (unsigned char *)buffer;
+ p = (unsigned char *)name;
+ outlen = convert_charset(ch_to, ch_to, ch_mac, (char *)p, strlen((char *)p), (char *)q, sizeof(buffer) -2, &flags);
if ((size_t)-1 == outlen) {
/* it's not UTF8... */
fprintf(stderr, "ERROR: conversion from '%s' to '%s' for '%s' in DID %u failed!!!\n",
/*
- * $Id: afp_dsi.c,v 1.44 2009-10-22 07:40:50 didg Exp $
+ * $Id: afp_dsi.c,v 1.45 2009-10-22 13:40:11 franklahm Exp $
*
* Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
* Copyright (c) 1990,1993 Regents of The University of Michigan.
LOG(log_debug, logtype_afpd, "=> Start AFP command: %s", afpcmpstr);
err = (*afp_switch[function])(obj,
- dsi->commands, dsi->cmdlen,
- dsi->data, &dsi->datalen);
+ (char *)&dsi->commands, dsi->cmdlen,
+ (char *)&dsi->data, &dsi->datalen);
LOG(log_debug, logtype_afpd, "=> Finished AFP command: %s", afpcmpstr);
#ifdef FORCE_UIDGID
if ( afp_switch[ function ] != NULL ) {
dsi->datalen = DSI_DATASIZ;
child.flags |= CHILD_RUNNING;
- err = (*afp_switch[function])(obj, dsi->commands, dsi->cmdlen,
- dsi->data, &dsi->datalen);
+ err = (*afp_switch[function])(obj,
+ (char *)&dsi->commands, dsi->cmdlen,
+ (char *)&dsi->data, &dsi->datalen);
child.flags &= ~CHILD_RUNNING;
#ifdef FORCE_UIDGID
/* bring everything back to old euid, egid */
}
/* Parse file specifications */
- spec1 = ibuf;
- spec2 = ibuf + spec_len + 2;
+ spec1 = (unsigned char*)ibuf;
+ spec2 = (unsigned char*)ibuf + spec_len + 2;
spec1 += 2;
spec2 += 2;
/*
- * $Id: desktop.c,v 1.41 2009-10-22 05:09:56 didg Exp $
+ * $Id: desktop.c,v 1.42 2009-10-22 13:40:11 franklahm Exp $
*
* See COPYRIGHT.
*
*rbuflen = buflen;
}
-geticon_done:
dsi_readdone(dsi);
return AFP_OK;
/*
- * $Id: directory.c,v 1.112 2009-10-22 12:35:38 franklahm Exp $
+ * $Id: directory.c,v 1.113 2009-10-22 13:40:11 franklahm Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
0x69232f74U, 0xfead7bb3U, 0xe9089ab6U, 0xf012f6aeU,
};
- const unsigned char *str = k->d_u_name;
+ const unsigned char *str = (unsigned char *)(k->d_u_name);
hash_val_t acc = 0;
while (*str) {
u_int32_t id;
int len, sfunc;
int utf8 = 0;
- uuidtype_t type;
-
+
ibuf++;
sfunc = (unsigned char) *ibuf++;
*rbuflen = 0;
/*
- $Id: extattrs.c,v 1.9 2009-10-22 12:35:38 franklahm Exp $
+ $Id: extattrs.c,v 1.10 2009-10-22 13:40:11 franklahm Exp $
Copyright (c) 2009 Frank Lahm <franklahm@gmail.com>
This program is free software; you can redistribute it and/or modify
/* This should be big enough to consecutively store the names of all attributes */
static char attrnamebuf[ATTRNAMEBUFSIZ];
+#ifdef DEBUG
static void hexdump(void *m, size_t l) {
char *p = m;
int count = 0, len;
}
}
}
+#endif
/***************************************
* AFP funcs
/*
- * $Id: lp.c,v 1.30 2009-10-16 01:10:59 didg Exp $
+ * $Id: lp.c,v 1.31 2009-10-22 13:40:11 franklahm Exp $
*
* Copyright (c) 1990,1994 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
char temp[4];
long int ch;
- q=p=string;
+ q=p=(unsigned char *)string;
while ( *p != '\0' ) {
ch = 0;
if ( *p == '\\' ) {
/*
- * $Id: uams_dhx_passwd.c,v 1.25 2009-10-15 11:39:48 didg Exp $
+ * $Id: uams_dhx_passwd.c,v 1.26 2009-10-22 13:40:11 franklahm Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* Copyright (c) 1999 Adrian Sun (asun@u.washington.edu)
return AFPERR_NOTAUTH;
/* get the client's public key */
- if (!(bn = BN_bin2bn(ibuf, KEYSIZE, NULL))) {
+ if (!(bn = BN_bin2bn((unsigned char *)ibuf, KEYSIZE, NULL))) {
return AFPERR_PARAM;
}
}
/* figure out the key. use rbuf as a temporary buffer. */
- i = DH_compute_key(rbuf, bn, dh);
+ i = DH_compute_key((unsigned char *)rbuf, bn, dh);
/* set the key */
- CAST_set_key(&castkey, i, rbuf);
+ CAST_set_key(&castkey, i, (unsigned char *)rbuf);
/* session id. it's just a hashed version of the object pointer. */
sessid = dhxhash(obj);
*rbuflen += sizeof(sessid);
/* send our public key */
- BN_bn2bin(dh->pub_key, rbuf);
+ BN_bn2bin(dh->pub_key, (unsigned char *)rbuf);
rbuf += KEYSIZE;
*rbuflen += KEYSIZE;
#endif /* 0 */
/* encrypt using cast */
- CAST_cbc_encrypt(rbuf, rbuf, CRYPTBUFLEN, &castkey, iv, CAST_ENCRYPT);
+ CAST_cbc_encrypt((unsigned char *)rbuf, (unsigned char *)rbuf, CRYPTBUFLEN, &castkey, iv, CAST_ENCRYPT);
*rbuflen += CRYPTBUFLEN;
BN_free(bn);
DH_free(dh);
ibuf += sizeof(sessid);
/* use rbuf as scratch space */
- CAST_cbc_encrypt(ibuf, rbuf, CRYPT2BUFLEN, &castkey,
+ CAST_cbc_encrypt((unsigned char *)ibuf, (unsigned char *)rbuf, CRYPT2BUFLEN, &castkey,
iv, CAST_DECRYPT);
/* check to make sure that the random number is the same. we
* get sent back an incremented random number. */
- if (!(bn1 = BN_bin2bn(rbuf, KEYSIZE, NULL)))
+ if (!(bn1 = BN_bin2bn((unsigned char *)rbuf, KEYSIZE, NULL)))
return AFPERR_PARAM;
if (!(bn2 = BN_bin2bn(randbuf, sizeof(randbuf), NULL))) {
/*
- * $Id: uams_gss.c,v 1.9 2009-10-15 14:54:43 franklahm Exp $
+ * $Id: uams_gss.c,v 1.10 2009-10-22 13:40:11 franklahm Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* Copyright (c) 1999 Adrian Sun (asun@u.washington.edu)
OM_uint32 major_status = 0, minor_status = 0;
char *envp;
- if (envp = getenv("KRB5_KTNAME"))
+ if ((envp = getenv("KRB5_KTNAME")))
LOG(log_debug, logtype_uams,
"acquire credentials: acquiring credentials (uid = %d, keytab = %s)",
(int)geteuid(), envp);
/*
- * $Id: uams_randnum.c,v 1.19 2009-10-15 11:39:48 didg Exp $
+ * $Id: uams_randnum.c,v 1.20 2009-10-22 13:40:11 franklahm Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* Copyright (c) 1999 Adrian Sun (asun@u.washington.edu)
#endif /* USE_CRACKLIB */
if (!err)
- err = randpass(pwd, passwdfile, ibuf + PASSWDLEN, sizeof(seskey), 1);
+ err = randpass(pwd, passwdfile, (unsigned char *)ibuf + PASSWDLEN, sizeof(seskey), 1);
/* zero out some fields */
memset(&seskeysched, 0, sizeof(seskeysched));
/*
- * $Id: dsi_stream.c,v 1.15 2009-10-22 04:59:50 didg Exp $
+ * $Id: dsi_stream.c,v 1.16 2009-10-22 13:40:11 franklahm Exp $
*
* Copyright (c) 1998 Adrian Sun (asun@zoology.washington.edu)
* All rights reserved. See COPYRIGHT.
char block[DSI_BLOCKSIZ];
/* read in the header */
- if (dsi_buffered_stream_read(dsi, block, sizeof(block)) != sizeof(block))
+ if (dsi_buffered_stream_read(dsi, (u_int8_t *)block, sizeof(block)) != sizeof(block))
return 0;
dsi->header.dsi_flags = block[0];
return tdb_unlock(tdb, BUCKET(tdb_hash(&key)), F_WRLCK);
}
+#if 0
static int tdb_chainlock_read(TDB_CONTEXT *tdb, TDB_DATA key)
{
return tdb_lock(tdb, BUCKET(tdb_hash(&key)), F_RDLCK);
}
+#endif
+#if 0
static int tdb_chainunlock_read(TDB_CONTEXT *tdb, TDB_DATA key)
{
return tdb_unlock(tdb, BUCKET(tdb_hash(&key)), F_RDLCK);
}
-
+#endif
/* register a loging function */
void tdb_logging_function(TDB_CONTEXT *tdb, void (*fn)(TDB_CONTEXT *, int , const char *, ...))
int main(int argc, char *argv[])
{
- bool retval;
-
set_processname("logger_Test");
LOG(log_severe, logtype_logger, "Logging Test starting: this should only log to syslog");