PC bug fixes mostly 16 vs 32 which prototyping fixed
authorKeith Vetter <keithv@fusion.com>
Sat, 3 Jun 1995 01:36:16 +0000 (01:36 +0000)
committerKeith Vetter <keithv@fusion.com>
Sat, 3 Jun 1995 01:36:16 +0000 (01:36 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5936 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/kadm/ChangeLog
src/lib/kadm/adm_conn.c
src/lib/kadm/adm_rw.c

index 2498de3e96f46c2c457caf0ae5b94378533447eb..20ec998e26dcb8a4dd4281214552721a0f9e7ad8 100644 (file)
@@ -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
index 9acdf0ee29714700adbe29bb02d209417be81f38..058ca505129cc22629e3ca66b287c2c45f59eb2d 100644 (file)
  * 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.
@@ -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 {
index 32d5f7aeeb2d6c010ad37f3d8cf1f02b6308df13..dda6e7d617c29112c62e63b70a220334546222fb 100644 (file)
 #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.
  *
@@ -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 */