bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] fix compilation of extracted clients w/--enable-encryption


From: Alexey Mahotkin
Subject: [PATCH] fix compilation of extracted clients w/--enable-encryption
Date: Fri, 02 May 2003 16:12:56 +0400
User-agent: Gnus/5.090006 (Oort Gnus v0.06) XEmacs/21.4 (Common Lisp, i386-debian-linux)

Ok, the thing goes out of control.  I will have to regenerate them all.
The only clean patch currently is socket-client (and even it has a
corresponding socket-client-fix).

Sequence will be like this:

 - common clients (socket, logging, rsh);

 - from_/to_server madness cleanup;

 - GSSAPI and Kerberos4 client extraction.

It will arrive to exactly the same sources, but with less patches, and in
more logical order.


2003-05-02  Alexey Mahotkin <address@hidden>

Remember to turn on encryption and fix compilation.


 src/client.c           |   25 +++----------------------
 src/gssapi-client.c    |   19 ++++++++++++++++---
 src/gssapi-client.h    |    4 ++++
 src/kerberos4-client.c |   14 ++++++++++++++
 src/kerberos4-client.h |    4 ++++
 5 files changed, 41 insertions(+), 25 deletions(-)

--- ccvs/src/client.c~encryption-fix    Fri May  2 15:42:51 2003
+++ ccvs-alexm/src/client.c     Fri May  2 15:58:11 2003
@@ -4016,12 +4016,7 @@ start_server ()
            if (! supported_request ("Kerberos-encrypt"))
                error (1, 0, "This server does not support encryption");
            send_to_server ("Kerberos-encrypt\012", 0);
-           to_server = krb_encrypt_buffer_initialize (to_server, 0, sched,
-                                                      kblock,
-                                                      (BUFMEMERRPROC) NULL);
-           from_server = krb_encrypt_buffer_initialize (from_server, 1,
-                                                        sched, kblock,
-                                                        (BUFMEMERRPROC) NULL);
+           initialize_kerberos4_encryption_buffers(&global_to_server, 
&global_from_server);
        }
        else
 #endif /* HAVE_KERBEROS4 */
@@ -4031,14 +4026,7 @@ start_server ()
            if (! supported_request ("Gssapi-encrypt"))
                error (1, 0, "This server does not support encryption");
            send_to_server ("Gssapi-encrypt\012", 0);
-           to_server = cvs_gssapi_wrap_buffer_initialize (to_server, 0,
-                                                          gcontext,
-                                                          ((BUFMEMERRPROC)
-                                                           NULL));
-           from_server = cvs_gssapi_wrap_buffer_initialize (from_server, 1,
-                                                            gcontext,
-                                                            ((BUFMEMERRPROC)
-                                                             NULL));
+           initialize_gssapi_buffers(&global_to_server, &global_from_server);
            cvs_gssapi_encrypt = 1;
        }
        else
@@ -4104,14 +4092,7 @@ start_server ()
                error (1, 0,
                       "This server does not support stream authentication");
            send_to_server ("Gssapi-authenticate\012", 0);
-           global_to_server = cvs_gssapi_wrap_buffer_initialize 
(global_to_server, 0,
-                                                          gcontext,
-                                                          ((BUFMEMERRPROC)
-                                                           NULL));
-           global_from_server = cvs_gssapi_wrap_buffer_initialize 
(global_from_server, 1,
-                                                            gcontext,
-                                                            ((BUFMEMERRPROC)
-                                                             NULL));
+           initialize_gssapi_buffers(&global_to_server, &global_from_server);
        }
        else
            error (1, 0, "Stream authentication is only supported when using 
GSSAPI");
--- ccvs/src/kerberos4-client.c~encryption-fix  Fri May  2 15:42:56 2003
+++ ccvs-alexm/src/kerberos4-client.c   Fri May  2 15:52:44 2003
@@ -14,6 +14,7 @@
 
 #include "cvs.h"
 
+#include "buffer.h"
 #include "socket-client.h"
 
 #   include <krb.h>
@@ -98,5 +99,18 @@ start_kerberos4_server (root, to_server_
 
     /* Give caller the values it wants. */
     make_bufs_from_fds (s, s, 0, to_server_p, from_server_p, 1);
+}
+
+void
+initialize_kerberos4_encryption_buffers (to_server_p, from_server_p)
+     struct buffer **to_server_p;
+     struct buffer **from_server_p;
+{
+  *to_server_p = krb_encrypt_buffer_initialize (*to_server_p, 0, sched,
+                                               kblock,
+                                               (BUFMEMERRPROC) NULL);
+  *from_server_p = krb_encrypt_buffer_initialize (*from_server_p, 1,
+                                                 sched, kblock,
+                                                 (BUFMEMERRPROC) NULL);
 }
 
--- ccvs/src/kerberos4-client.h~encryption-fix  Fri May  2 15:43:00 2003
+++ ccvs-alexm/src/kerberos4-client.h   Fri May  2 15:50:05 2003
@@ -17,5 +17,9 @@
 extern void start_kerberos4_server PROTO((cvsroot_t *root,
                                          struct buffer **to_server_p, struct 
buffer **from_server_p));
 
+extern void initialize_kerberos4_encryption_buffers PROTO((struct buffer 
**to_server_p,
+                                                          struct buffer 
**from_server_p));
+
+
 #endif
 
--- ccvs/src/gssapi-client.c~encryption-fix     Fri May  2 15:49:34 2003
+++ ccvs-alexm/src/gssapi-client.c      Fri May  2 15:57:21 2003
@@ -31,8 +31,6 @@ int cvs_gssapi_encrypt;
 #   endif
 
 
-#ifdef HAVE_GSSAPI
-
 /* Receive a given number of bytes.  */
 
 static void
@@ -302,4 +300,19 @@ cvs_gssapi_wrap_output (fnclosure, input
     return 0;
 }
 
-#endif /* HAVE_GSSAPI */
+void
+initialize_gssapi_buffers (to_server_p, from_server_p)
+     struct buffer **to_server_p;
+     struct buffer **from_server_p;
+{
+  *to_server_p = cvs_gssapi_wrap_buffer_initialize (*to_server_p, 0,
+                                                   gcontext,
+                                                   ((BUFMEMERRPROC)
+                                                    NULL));
+
+  *from_server_p = cvs_gssapi_wrap_buffer_initialize (*from_server_p, 1,
+                                                     gcontext,
+                                                     ((BUFMEMERRPROC)
+                                                      NULL));
+}
+
--- ccvs/src/gssapi-client.h~encryption-fix     Fri May  2 15:49:35 2003
+++ ccvs-alexm/src/gssapi-client.h      Fri May  2 15:57:41 2003
@@ -29,4 +29,8 @@ extern struct buffer *cvs_gssapi_wrap_bu
 
 int connect_to_gserver PROTO((cvsroot_t *, int, struct hostent *));
 
+extern void initialize_gssapi_buffers PROTO((struct buffer **to_server_p,
+                                            struct buffer **from_server_p));
+
+
 #endif

_


--alexm




reply via email to

[Prev in Thread] Current Thread [Next in Thread]