+Thu May 25 17:49:06 1995 Keith Vetter (keithv@fusion.com)
+
+ First pass to make the code compile cleanly on the PC.
+ * Makefile.in: made to work on the PC.
+ * adm_conn.c: used atoi instead of sscanf since it can't be
+ used in a windows DLL. Why not? Ask Microsoft.
+ * adm_kt_e.c, adm_kw_e.c, adm_rw.c: made the explicit the
+ cast to a char when pulling out bytes from an int.
+ * adm_kw_d.c: size_t != off_t on the PC. Fixed the equation.
+ * adm_rw.c: two parameters were declared as int but prototyped
+ as krb5_int32.
Tue May 16 13:58:30 EDT 1995 Paul Park (pjpark@mit.edu)
* configure.in - Check for srand48, srand and srandom along with
CFLAGS = $(CCOPTS) $(DEFS)
LDFLAGS = -g
-all:: $(OBJS)
+##DOSBUILDTOP = ..\..
+##DOSLIBNAME=kadm.lib
+##DOS!include $(BUILDTOP)\config\windows.in
-OBJS= adm_conn.o \
- adm_kw_dec.o \
- adm_kw_enc.o \
- adm_kt_dec.o \
- adm_kt_enc.o \
- adm_rw.o
+OBJS= adm_conn.$(OBJEXT) \
+ adm_kw_dec.$(OBJEXT) \
+ adm_kw_enc.$(OBJEXT) \
+ adm_kt_dec.$(OBJEXT) \
+ adm_kt_enc.$(OBJEXT) \
+ adm_rw.$(OBJEXT)
SRCS= $(srcdir)/adm_conn.c \
$(srcdir)/adm_kw_dec.c \
$(srcdir)/adm_kt_enc.c \
$(srcdir)/adm_rw.c
-libkadm.a: ${OBJS}
+all:: $(OBJS)
+
+libkadm.a: $(OBJS)
$(RM) $@
$(ARADD) $@ $(OBJS)
$(RANLIB) $@
$(RANLIB) $(DESTDIR)$(KRB5_LIBDIR)/libkadm.a
clean::
- $(RM) libkadm.a
+ $(RM) libkadm.$(LIBEXT)
#
# t_dbentry
if (cport) {
*cport = '\0';
cport++;
- if (sscanf(cport, "%d", &pport) != 1) {
+
+ pport = atoi (cport);
+ if (pport == 0) {
kret = KRB5_CONFIG_BADFORMAT;
goto cleanup;
}
(char *) malloc(sizeof(krb5_ui_4))) {
clist[KRB5_ADM_KT_TIMESTAMP].length = sizeof(krb5_ui_4);
clist[KRB5_ADM_KT_TIMESTAMP].data[0] =
- (ktentp->timestamp >> 24) & 0xff;
+ (char) ((ktentp->timestamp >> 24) & 0xff);
clist[KRB5_ADM_KT_TIMESTAMP].data[1] =
- (ktentp->timestamp >> 16) & 0xff;
+ (char) ((ktentp->timestamp >> 16) & 0xff);
clist[KRB5_ADM_KT_TIMESTAMP].data[2] =
- (ktentp->timestamp >> 8) & 0xff;
+ (char) ((ktentp->timestamp >> 8) & 0xff);
clist[KRB5_ADM_KT_TIMESTAMP].data[3] =
- ktentp->timestamp & 0xff;
+ (char) (ktentp->timestamp & 0xff);
nents++;
}
else {
kret = ENOENT;
if ((valueoff = keyword_value(dataentp, keyword, 1)) >= 0) {
kret = ENOMEM;
- len2copy = dataentp->length - valueoff;
+ len2copy = (size_t) ((off_t) dataentp->length - valueoff);
*stringp = (char *) malloc(len2copy+1);
if (*stringp) {
strncpy(*stringp, &dataentp->data[valueoff], len2copy);
kret = ENOENT;
if ((voff = keyword_value(dataentp, keyword, 1)) >= 0) {
kret = EINVAL;
- len2copy = dataentp->length - voff;
+ len2copy = (size_t) ((off_t) dataentp->length - voff);
if (len2copy == sizeof(krb5_ui_4)) {
*uintp = (((krb5_int32) ((unsigned char) dataentp->data[voff])
<< 24) +
if (datap->data) {
datap->length = strlen(fbuffer);
strcpy(datap->data, fbuffer);
- datap->data[datap->length] = (val >> 24) & 0xff;
- datap->data[datap->length+1] = (val >> 16) & 0xff;
- datap->data[datap->length+2] = (val >> 8) & 0xff;
- datap->data[datap->length+3] = val & 0xff;
+ datap->data[datap->length] = (char) ((val >> 24) & 0xff);
+ datap->data[datap->length+1] = (char) ((val >> 16) & 0xff);
+ datap->data[datap->length+2] = (char) ((val >> 8) & 0xff);
+ datap->data[datap->length+3] = (char) (val & 0xff);
datap->length += sizeof(krb5_ui_4);
retval = 0;
}
krb5_int32 outint;
char *cp;
{
- cp[0] = (outint >> 24) & 0xff;
- cp[1] = (outint >> 16) & 0xff;
- cp[2] = (outint >> 8) & 0xff;
- cp[3] = outint & 0xff;
+ cp[0] = (char) ((outint >> 24) & 0xff);
+ cp[1] = (char) ((outint >> 16) & 0xff);
+ cp[2] = (char) ((outint >> 8) & 0xff);
+ cp[3] = (char) (outint & 0xff);
}
\f
/*
krb5_context kcontext; /* Context handle (In ) */
krb5_pointer sock; /* Socket to write to (In ) */
krb5_auth_context *ctx; /* Auth context (In ) */
- int nargs; /* Number of arguments (In ) */
+ krb5_int32 nargs; /* Number of arguments (In ) */
krb5_data *arglist; /* Components to write (In ) */
{
int writebufsize;
krb5_pointer sock; /* Socket to write to (In ) */
krb5_auth_context *ctx; /* Auth context (In ) */
krb5_int32 cmd_stat; /* Command status (In ) */
- int ncomps; /* Number of arguments (In ) */
+ krb5_int32 ncomps; /* Number of arguments (In ) */
krb5_data *complist; /* Components to write (In ) */
{
int writebufsize;