rpms/cvs/devel cvs-1.11.21-proxy.patch, NONE, 1.1 cvs-1.11.21.tar.bz2.sig, NONE, 1.1 .cvsignore, 1.11, 1.12 cvs.spec, 1.35, 1.36 sources, 1.11, 1.12 cvs-1.11.17-CAN-2005-0753.patch, 1.1, NONE cvs-1.11.19-proxy.patch, 1.1, NONE cvs-1.11.19-proxy2.patch, 1.1, NONE cvs-1.11.19.tar.bz2.sig, 1.1, NONE

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Thu Nov 10 10:36:10 UTC 2005


Author: stransky

Update of /cvs/dist/rpms/cvs/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv15269

Modified Files:
	.cvsignore cvs.spec sources 
Added Files:
	cvs-1.11.21-proxy.patch cvs-1.11.21.tar.bz2.sig 
Removed Files:
	cvs-1.11.17-CAN-2005-0753.patch cvs-1.11.19-proxy.patch 
	cvs-1.11.19-proxy2.patch cvs-1.11.19.tar.bz2.sig 
Log Message:
new upstream

cvs-1.11.21-proxy.patch:
 client.c |   91 +++++++++++++++++++++++++++++++++++++++++++++++++++++----------
 client.h |    3 ++
 root.c   |   28 ++++++++++++++++++-
 3 files changed, 107 insertions(+), 15 deletions(-)

--- NEW FILE cvs-1.11.21-proxy.patch ---
--- cvs-1.11.21/src/client.h.proxy	2005-08-02 22:46:57.000000000 +0200
+++ cvs-1.11.21/src/client.h	2005-11-10 10:26:24.000000000 +0100
@@ -83,6 +83,9 @@
 #   ifndef CVS_AUTH_PORT
 #     define CVS_AUTH_PORT 2401
 #   endif /* CVS_AUTH_PORT */
+#   ifndef CVS_PROXY_PORT
+#     define CVS_PROXY_PORT 80
+#   endif /* CVS_PROXY_PORT */
 # endif /* (AUTH_CLIENT_SUPPORT) || defined (HAVE_GSSAPI) */
 
 # if HAVE_KERBEROS
--- cvs-1.11.21/src/client.c.proxy	2005-09-22 17:58:46.000000000 +0200
+++ cvs-1.11.21/src/client.c	2005-11-10 10:26:24.000000000 +0100
@@ -144,6 +144,7 @@
 
 static size_t try_read_from_server PROTO ((char *, size_t));
 
+static void proxy_connect PROTO ((cvsroot_t *, int));
 static void auth_server PROTO ((cvsroot_t *, struct buffer *, struct buffer *,
 				int, int, struct hostent *));
 
@@ -3802,7 +3803,7 @@
     int port_number;
     struct sockaddr_in client_sai;
     struct hostent *hostinfo;
-    struct buffer *to_server, *from_server;
+    struct buffer *local_to_server, *local_from_server;
 
     sock = socket (AF_INET, SOCK_STREAM, 0);
     if (sock == -1)
@@ -3810,7 +3811,17 @@
 	error (1, 0, "cannot create socket: %s", SOCK_STRERROR (SOCK_ERRNO));
     }
     port_number = get_cvs_port_number (root);
-    hostinfo = init_sockaddr (&client_sai, root->hostname, port_number);
+
+    /* if we have a proxy connect to that instead */
+    if (root->proxy_hostname)
+    {
+	hostinfo = init_sockaddr (&client_sai, root->proxy_hostname, root->proxy_port);
+    }
+    else
+    {
+	hostinfo = init_sockaddr (&client_sai, root->hostname, port_number);
+    }
+
     if (trace)
     {
 	fprintf (stderr, " -> Connecting to %s(%s):%d\n",
@@ -3820,29 +3831,41 @@
     if (connect (sock, (struct sockaddr *) &client_sai, sizeof (client_sai))
 	< 0)
 	error (1, 0, "connect to %s(%s):%d failed: %s",
-	       root->hostname,
+	       root->proxy_hostname ? root->proxy_hostname : root->hostname,
 	       inet_ntoa (client_sai.sin_addr),
-	       port_number, SOCK_STRERROR (SOCK_ERRNO));
+	       root->proxy_hostname ? root->proxy_port : port_number,
+	       SOCK_STRERROR (SOCK_ERRNO));
 
-    make_bufs_from_fds (sock, sock, 0, &to_server, &from_server, 1);
+    make_bufs_from_fds (sock, sock, 0, &local_to_server, &local_from_server, 1);
 
-    auth_server (root, to_server, from_server, verify_only, do_gssapi, hostinfo);
+    if (root->proxy_hostname)
+    {
+    	// REALLY ugly hack to allow proxy_connect() to use send_to_server().
+    	// The proper fix would be to remove the global to_server & from_server
+    	// variables, and instead let send_to_server() etc. take the target
+    	// server struct as a paramter.
+	to_server = local_to_server;
+	from_server = local_from_server;
+	proxy_connect (root, port_number);
+    }
+
+    auth_server (root, local_to_server, local_from_server, verify_only, do_gssapi, hostinfo);
 
     if (verify_only)
     {
 	int status;
 
-	status = buf_shutdown (to_server);
+	status = buf_shutdown (local_to_server);
 	if (status != 0)
 	    error (0, status, "shutting down buffer to server");
-	buf_free (to_server);
-	to_server = NULL;
+	buf_free (local_to_server);
+	local_to_server = NULL;
 
-	status = buf_shutdown (from_server);
+	status = buf_shutdown (local_from_server);
 	if (status != 0)
 	    error (0, status, "shutting down buffer from server");
-	buf_free (from_server);
-	from_server = NULL;
+	buf_free (local_from_server);
+	local_from_server = NULL;
 
 	/* Don't need to set server_started = 0 since we don't set it to 1
 	 * until returning from this call.
@@ -3850,8 +3873,8 @@
     }
     else
     {
-	*to_server_p = to_server;
-	*from_server_p = from_server;
+	*to_server_p = local_to_server;
+	*from_server_p = local_from_server;
     }
 
     return;
@@ -3860,6 +3883,46 @@
 
 
 static void
+proxy_connect (root, port_number)
+    cvsroot_t *root;
+    int port_number;
+{
+#define CONNECT_STRING "CONNECT %s:%d HTTP/1.0\r\n\r\n"
+    /* Send a "CONNECT" command to proxy: */
+    char* read_buf;
+    int codenum, count;
+    
+    /* 4 characters for port covered by the length of %s & %d */
+    char* write_buf = xmalloc (strlen (CONNECT_STRING) + strlen (root->hostname) + 20 + 1);
+    int len = sprintf (write_buf, CONNECT_STRING, root->hostname, port_number);
+    send_to_server (write_buf, len);
+    
+    /* Wait for HTTP status code, bail out if you don't get back a 2xx code.*/
+    count = read_line (&read_buf);
+    sscanf (read_buf, "%s %d", write_buf, &codenum);
+    
+    if ((codenum / 100) != 2)
+	error (1, 0, "proxy server %s:%d does not support http tunnelling",
+	       root->proxy_hostname, root->proxy_port);
+    free (read_buf);
+    free (write_buf);
+    
+    /* Skip through remaining part of MIME header, recv_line
+       consumes the trailing \n */
+    while(read_line (&read_buf) > 0)
+    {
+	if (read_buf[0] == '\r' || read_buf[0] == 0)
+	{
+	    free (read_buf);
+	    break;
+	}
+	free (read_buf);
+    }
+}
+
+
+
+static void
 auth_server (root, lto_server, lfrom_server, verify_only, do_gssapi, hostinfo)
     cvsroot_t *root;
     struct buffer *lto_server;
--- cvs-1.11.21/src/root.c.proxy	2005-09-04 02:26:43.000000000 +0200
+++ cvs-1.11.21/src/root.c	2005-11-10 10:26:24.000000000 +0100
@@ -298,7 +298,7 @@
     newroot->port = 0;
     newroot->directory = NULL;
     newroot->proxy_hostname = NULL;
-    newroot->proxy_port = 0;
+    newroot->proxy_port = CVS_PROXY_PORT;
 #endif /* CLIENT_SUPPORT */
 
     return newroot;
@@ -371,6 +371,7 @@
     char *cvsroot_copy, *p, *q;		/* temporary pointers for parsing */
 #ifdef CLIENT_SUPPORT
     int check_hostname, no_port, no_password;
+    const char *env_var;
 #endif /* CLIENT_SUPPORT */
 
     assert (root_in);
@@ -406,6 +407,31 @@
 	cvsroot_copy = ++p;
 
 #ifdef CLIENT_SUPPORT
+	/* Determine proxy */
+	env_var = getenv("CVS_PROXY");
+/*
+	if (!env_var)
+	  	env_var = getenv("HTTP_PROXY");
+	if (!env_var)
+	  	env_var = getenv("http_proxy");
+*/
+	/* Check if a proxy was specified, and if it is a HTTP proxy */
+	if (env_var && !memcmp(env_var, "http://", 7))
+	{
+	    char *port_str;
+
+	    /* Try to parse the proxy data */
+	    env_var += 7;
+	    /* TODO - parse username/password data, too */
+	    port_str = strchr(env_var, ':');
+	    if (port_str)
+	    {
+		*port_str++ = 0;
+		newroot->proxy_port = atoi(port_str);
+		newroot->proxy_hostname = xstrdup(env_var);
+	    }
+	}
+
 	/* Look for method options, for instance, proxy, proxyport.
 	 * We don't handle these, but we like to try and warn the user that
 	 * they are being ignored.


--- NEW FILE cvs-1.11.21.tar.bz2.sig ---
ˆ?

Index: .cvsignore
===================================================================
RCS file: /cvs/dist/rpms/cvs/devel/.cvsignore,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- .cvsignore	28 Feb 2005 13:42:39 -0000	1.11
+++ .cvsignore	10 Nov 2005 10:36:06 -0000	1.12
@@ -1,2 +1,3 @@
 cvs-1.11.17.tar.bz2
 cvs-1.11.19.tar.bz2
+cvs-1.11.21.tar.bz2


Index: cvs.spec
===================================================================
RCS file: /cvs/dist/rpms/cvs/devel/cvs.spec,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- cvs.spec	23 Aug 2005 08:33:48 -0000	1.35
+++ cvs.spec	10 Nov 2005 10:36:06 -0000	1.36
@@ -1,7 +1,7 @@
 Summary: A version control system.
 Name: cvs
-Version: 1.11.19
-Release: 10
+Version: 1.11.21
+Release: 1
 License: GPL
 Group: Development/Tools
 Source0: https://ccvs.cvshome.org/files/documents/19/192/cvs-%{version}.tar.bz2
@@ -13,12 +13,10 @@
 Patch2: cvs-1.11.19-netbsd-tag.patch
 Patch3: cvs-1.11.19-abortabort.patch
 Patch4: cvs-1.11.1p1-bs.patch
-Patch5: cvs-1.11.19-proxy.patch
-Patch6: cvs-1.11.19-proxy2.patch
+Patch5: cvs-1.11.21-proxy.patch
 Patch7: cvs-1.11.19-logmsg.patch
 Patch8: cvs-1.11.19-tagname.patch
 Patch9: cvs-1.11.19-comp.patch
-Patch10: cvs-1.11.17-CAN-2005-0753.patch
 Patch11: cvs-1.11.19-tmp.patch
 Prereq: /sbin/install-info
 Requires: vim-minimal
@@ -49,12 +47,10 @@
 %patch2 -p1 -b .netbsd-tag
 %patch3 -p1 -b .abortabort
 %patch4 -p1 -b .bs
-%patch5 -p1
-%patch6 -p1 -b .proxy
+%patch5 -p1 -b .proxy
 %patch7 -p1
 %patch8 -p1
 %patch9 -p1
-%patch10 -p1 -b .sec
 %patch11 -p1 -b .tmp
 # Apply a patch to the generated files, OR
 # run autoreconf and require autoconf >= 2.58, automake >= 1.7.9
@@ -103,7 +99,7 @@
 %defattr(-,root,root)
 %doc AUTHORS BUGS COPYING* DEVEL-CVS FAQ HACKING MINOR-BUGS NEWS
 %doc PROJECTS TODO README
-%doc doc/*.ps
+#%doc doc/*.ps
 %{_bindir}/*
 %{_mandir}/*/*
 %{_infodir}/*.info*
@@ -112,6 +108,9 @@
 %dir %{_localstatedir}/%{name}
 
 %changelog
+* Thu Nov 10 2005 Martin Stransky <stransky at redhat.com> 1.11.21-1
+- new upstream
+
 * Thu Aug 23 2005 Martin Stransky <stransky at redhat.com> 1.11.19-10
 - fix for #166366 - CVS temporary file issue
 


Index: sources
===================================================================
RCS file: /cvs/dist/rpms/cvs/devel/sources,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- sources	28 Feb 2005 13:42:39 -0000	1.11
+++ sources	10 Nov 2005 10:36:06 -0000	1.12
@@ -1 +1 @@
-ac3f9459d0bb5ed9acd6091902267594  cvs-1.11.19.tar.bz2
+54dd9eeb0648c9eef680df7cb26c710e  cvs-1.11.21.tar.bz2


--- cvs-1.11.17-CAN-2005-0753.patch DELETED ---


--- cvs-1.11.19-proxy.patch DELETED ---


--- cvs-1.11.19-proxy2.patch DELETED ---


--- cvs-1.11.19.tar.bz2.sig DELETED ---




More information about the fedora-cvs-commits mailing list