summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKeith Vetter <keithv@fusion.com>1995-06-03 01:36:16 +0000
committerKeith Vetter <keithv@fusion.com>1995-06-03 01:36:16 +0000
commit99d5835b1362f2e3e9c52f2dbad0eaf17955dd2a (patch)
treeaea33d597d69c416b75e3e9befdf7bb7d62d32d2 /src
parentdb868db05e03eb15513def0c0998884d37ecc3cf (diff)
downloadkrb5-99d5835b1362f2e3e9c52f2dbad0eaf17955dd2a.tar.gz
krb5-99d5835b1362f2e3e9c52f2dbad0eaf17955dd2a.tar.xz
krb5-99d5835b1362f2e3e9c52f2dbad0eaf17955dd2a.zip
PC bug fixes mostly 16 vs 32 which prototyping fixed
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5936 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/lib/kadm/ChangeLog7
-rw-r--r--src/lib/kadm/adm_conn.c37
-rw-r--r--src/lib/kadm/adm_rw.c21
3 files changed, 55 insertions, 10 deletions
diff --git a/src/lib/kadm/ChangeLog b/src/lib/kadm/ChangeLog
index 2498de3e9..20ec998e2 100644
--- a/src/lib/kadm/ChangeLog
+++ b/src/lib/kadm/ChangeLog
@@ -1,3 +1,10 @@
+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
diff --git a/src/lib/kadm/adm_conn.c b/src/lib/kadm/adm_conn.c
index 9acdf0ee2..058ca5051 100644
--- a/src/lib/kadm/adm_conn.c
+++ b/src/lib/kadm/adm_conn.c
@@ -38,6 +38,33 @@
* 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 *));
/*
* kadm_get_ccache() - Initialze a credentials cache.
@@ -323,7 +350,7 @@ kadm_contact_server(kcontext, realmp, sockp, local, remote)
/* Open a tcp socket */
*sockp = socket(PF_INET, SOCK_STREAM, 0);
if (*sockp < 0) {
- kret = errno;
+ kret = SOCKET_ERRNO;
goto cleanup;
}
else kret = 0;
@@ -333,6 +360,7 @@ kadm_contact_server(kcontext, realmp, sockp, local, remote)
(struct sockaddr *) &in_remote,
sizeof(in_remote)) < 0) {
/* Failed, go to next address */
+ kret = SOCKET_ERRNO;
close(*sockp);
*sockp = -1;
continue;
@@ -344,7 +372,7 @@ kadm_contact_server(kcontext, realmp, sockp, local, remote)
(struct sockaddr *) &in_local,
&addr_len) < 0) {
/* Couldn't get our local address? */
- kret = errno;
+ kret = SOCKET_ERRNO;
goto cleanup;
}
else {
@@ -403,7 +431,7 @@ kadm_contact_server(kcontext, realmp, sockp, local, remote)
/* Open a tcp socket */
*sockp = socket(PF_INET, SOCK_STREAM, 0);
if (*sockp < 0) {
- kret = errno;
+ kret = SOCKET_ERRNO;
goto cleanup;
}
else kret = 0;
@@ -411,6 +439,7 @@ kadm_contact_server(kcontext, realmp, sockp, local, remote)
if (connect(*sockp,
(struct sockaddr *) &in_remote,
sizeof(in_remote)) < 0) {
+ kret = SOCKET_ERRNO;
close(*sockp);
*sockp = -1;
continue;
@@ -421,7 +450,7 @@ kadm_contact_server(kcontext, realmp, sockp, local, remote)
if (getsockname(*sockp,
(struct sockaddr *) &in_local,
&addr_len) < 0) {
- kret = errno;
+ kret = SOCKET_ERRNO;
goto cleanup;
}
else {
diff --git a/src/lib/kadm/adm_rw.c b/src/lib/kadm/adm_rw.c
index 32d5f7aee..dda6e7d61 100644
--- a/src/lib/kadm/adm_rw.c
+++ b/src/lib/kadm/adm_rw.c
@@ -30,6 +30,12 @@
#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.
*
* kadm_copyin_int32 - Move a 32-bit integer fron network byte order to
@@ -290,7 +296,8 @@ krb5_read_adm_cmd(kcontext, sock, ctx, nargs, arglist)
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.
@@ -341,8 +348,9 @@ krb5_read_adm_cmd(kcontext, sock, ctx, nargs, arglist)
/* 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 */
@@ -417,7 +425,8 @@ krb5_read_adm_reply(kcontext, sock, ctx, cmd_stat, ncomps, complist)
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.
@@ -470,8 +479,8 @@ krb5_read_adm_reply(kcontext, sock, ctx, cmd_stat, ncomps, complist)
/* 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 */