+Fri Jun 2 17:56:03 1995 Keith Vetter (keithv@fusion.com)
+
+ * adm_conn.c: used SOCKET_ERRNO instead of errno and
+ added prototypes for the local functions.
+ * adm_rw.c: added prototypes for the local functions so that
+ ints get promoted to longs correctly on the PC.
+
Wed May 31 08:10:13 1995 Ezra Peisach <epeisach@kangaroo.mit.edu>
* Makefile.in (DB_OBJS): Change DBOBJS to DB_OBJS to match rest of
* Strings
*/
static char *kadm_cache_name_fmt = "FILE:/tmp/tkt_kpw_%d";
+
+/*
+ * Prototypes for local functions
+ */
+static krb5_error_code kadm_get_ccache
+ PROTOTYPE((krb5_context,
+ char *,
+ krb5_ccache *,
+ krb5_principal *));
+static krb5_error_code kadm_get_creds
+ PROTOTYPE((krb5_context,
+ krb5_ccache ,
+ krb5_principal,
+ krb5_creds *,
+ char *,
+ char *));
+static krb5_error_code kadm_contact_server
+ PROTOTYPE((krb5_context,
+ krb5_data *,
+ int *,
+ krb5_address **,
+ krb5_address **));
+static krb5_error_code kadm_get_auth
+ PROTOTYPE((krb5_context,
+ krb5_auth_context * *,
+ krb5_address *,
+ krb5_address *));
\f
/*
* kadm_get_ccache() - Initialze a credentials cache.
/* Open a tcp socket */
*sockp = socket(PF_INET, SOCK_STREAM, 0);
if (*sockp < 0) {
- kret = errno;
+ kret = SOCKET_ERRNO;
goto cleanup;
}
else kret = 0;
(struct sockaddr *) &in_remote,
sizeof(in_remote)) < 0) {
/* Failed, go to next address */
+ kret = SOCKET_ERRNO;
close(*sockp);
*sockp = -1;
continue;
(struct sockaddr *) &in_local,
&addr_len) < 0) {
/* Couldn't get our local address? */
- kret = errno;
+ kret = SOCKET_ERRNO;
goto cleanup;
}
else {
/* Open a tcp socket */
*sockp = socket(PF_INET, SOCK_STREAM, 0);
if (*sockp < 0) {
- kret = errno;
+ kret = SOCKET_ERRNO;
goto cleanup;
}
else kret = 0;
if (connect(*sockp,
(struct sockaddr *) &in_remote,
sizeof(in_remote)) < 0) {
+ kret = SOCKET_ERRNO;
close(*sockp);
*sockp = -1;
continue;
if (getsockname(*sockp,
(struct sockaddr *) &in_local,
&addr_len) < 0) {
- kret = errno;
+ kret = SOCKET_ERRNO;
goto cleanup;
}
else {
#include "k5-int.h"
#include "adm_proto.h"
+/*
+ * Local prototypes (needed or else the PC will pass fail).
+ */
+static void kadm_copyin_int32 PROTOTYPE((char *, krb5_int32 *));
+static void kadm_copyout_int32 PROTOTYPE((krb5_int32, char *));
+
/*
* Routines to [de]serialize integers.
*
krb5_error_code ret;
krb5_data msg_data;
krb5_replay_data replay_data;
- krb5_int32 ac_flags;
+ krb5_int32 ac_flags;
+ krb5_int32 len32;
/*
* First check that our auth context has the right flags in it.
/* First get the length of the reply component */
if (curr + sizeof(krb5_int32) - msg_data.data <=
msg_data.length) {
- kadm_copyin_int32(curr,
- &xarglist[i].length);
+
+ kadm_copyin_int32(curr, &len32);
+ xarglist[i].length = (int) len32;
curr += sizeof(krb5_int32);
/* Then get the memory for the actual data */
krb5_error_code ret;
krb5_data msg_data;
krb5_replay_data replay_data;
- krb5_int32 ac_flags;
+ krb5_int32 ac_flags;
+ krb5_int32 len32;
/*
* First check that our auth context has the right flags in it.
/* First get the length of the reply component */
if (curr + sizeof(krb5_int32) - msg_data.data <=
msg_data.length) {
- kadm_copyin_int32(curr,
- &xcomplist[i].length);
+ kadm_copyin_int32(curr, &len32);
+ xcomplist[i].length = (int) len32;
curr += sizeof(krb5_int32);
/* Then get the memory for the actual data */