This email list is read-only.  Emails sent to this list will be discarded
----------------------------------
 build/conf/site.conf.sample          |   20 +-
 scripts/poky-git-proxy-socks-command |    2 +
 scripts/poky-git-proxy-socks.c       | 2982 ++++++++++++++++++++++++++++++++++
 3 files changed, 3002 insertions(+), 2 deletions(-)

New commits:
commit e4aa77e88efe49d38c63cb70f9d0c48a9dc3461f
Author: Richard Purdie <[EMAIL PROTECTED]>
Date:   Thu Oct 23 15:12:41 2008 +0100

    scripts/build: Update the git proxy setup instructions


Diff in this email is a maximum of 400 lines.
diff --git a/build/conf/site.conf.sample b/build/conf/site.conf.sample
index 3215e2c..f14b3d9 100644
--- a/build/conf/site.conf.sample
+++ b/build/conf/site.conf.sample
@@ -7,10 +7,26 @@
 #CVS_PROXY_HOST = "proxy.example.com"
 #CVS_PROXY_PORT = "81"
 
-# Uncomment to cause git to use the proxy host specificed
+# For svn, you need to create ~/.subversion/servers containing:
+#[global]
+#http-proxy-host = proxy.example.com
+#http-proxy-port = 81
+#
+
+# Uncomment to cause git to use the proxy host specificed 
+# although this only works for http
 #GIT_PROXY_HOST = "proxy.example.com"
 #GIT_PROXY_PORT = "81"
 #export GIT_PROXY_COMMAND = "${OEROOT}/scripts/poky-git-proxy-command"
 
+# If SOCKS is available run the following command to comple a simple transport
+# gcc scripts/poky-git-proxy-socks.c -o poky-git-proxy-socks
+# and then share that binary somewhere in PATH, then use the following settings
+#GIT_PROXY_HOST = "proxy.example.com"
+#GIT_PROXY_PORT = "81"
+#export GIT_PROXY_COMMAND = "${OEROOT}/scripts/poky-git-proxy-socks-command"
+
+
 # Uncomment this to use a shared download directory
-#DL_DIR = "/some/shared/download/directory/"
\ No newline at end of file
+#DL_DIR = "/some/shared/download/directory/"
+
diff --git a/scripts/poky-git-proxy-socks-command 
b/scripts/poky-git-proxy-socks-command
new file mode 100755
index 0000000..a5af2d3
--- /dev/null
+++ b/scripts/poky-git-proxy-socks-command
@@ -0,0 +1,2 @@
+#! /bin/bash
+poky-git-proxy-socks -S $GIT_PROXY_HOST:$GIT_PROXY_PORT $@
diff --git a/scripts/poky-git-proxy-socks.c b/scripts/poky-git-proxy-socks.c
new file mode 100644
index 0000000..f574711
--- /dev/null
+++ b/scripts/poky-git-proxy-socks.c
@@ -0,0 +1,2982 @@
+/***********************************************************************
+ * connect.c -- Make socket connection using SOCKS4/5 and HTTP tunnel.
+ *
+ * Copyright (c) 2000-2006 Shun-ichi Goto
+ * Copyright (c) 2002, J. Grant (English Corrections)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * ---------------------------------------------------------
+ * PROJECT:  My Test Program
+ * AUTHOR:   Shun-ichi GOTO <[EMAIL PROTECTED]>
+ * CREATE:   Wed Jun 21, 2000
+ * REVISION: $Revision: 100 $
+ * ---------------------------------------------------------
+ *
+ * Getting Source
+ * ==============
+ *
+ *   Recent version of 'connect.c' is available from
+ *     http://www.taiyo.co.jp/~gotoh/ssh/connect.c
+ *
+ *   Related tool, ssh-askpass.exe (alternative ssh-askpass on UNIX)
+ *   is available:
+ *     http://www.taiyo.co.jp/~gotoh/ssh/ssh-askpass.exe.gz
+ *
+ *   See more detail:
+ *     http://www.taiyo.co.jp/~gotoh/ssh/connect.html
+ *
+ * How To Compile
+ * ==============
+ *
+ *  On UNIX environment:
+ *      $ gcc connect.c -o connect
+ *
+ *  On SOLARIS:
+ *      $ gcc -o connect -lresolv -lsocket -lnsl connect.c
+ *
+ *  on Win32 environment:
+ *      $ cl connect.c wsock32.lib advapi32.lib
+ *    or
+ *      $ bcc32 connect.c wsock32.lib advapi32.lib
+ *    or
+ *      $ gcc connect.c -o connect
+ *
+ *  on Mac OS X environment:
+ *      $ gcc connect.c -o connect -lresolv
+ *    or
+ *      $ gcc connect.c -o connect -DBIND_8_COMPAT=1
+ *
+ * How To Use
+ * ==========
+ *
+ *   You can specify proxy method in an environment variable or in a
+ *   command line option.
+ *
+ *   usage:  connect [-dnhst45] [-R resolve] [-p local-port] [-w sec]
+ *                   [-H [EMAIL PROTECTED]:port]]
+ *                   [-S [EMAIL PROTECTED]:port]]
+ *                   [-T proxy-server[:port]]
+ *                   [-c telnet proxy command]
+ *                   host port
+ *
+ *   "host" and "port" is for the target hostname and port-number to
+ *   connect to.
+ *
+ *   The -H option specifys a hostname and port number of the http proxy
+ *   server to relay. If port is omitted, 80 is used. You can specify this
+ *   value in the environment variable HTTP_PROXY and pass the -h option
+ *   to use it.
+ *
+ *   The -S option specifys the hostname and port number of the SOCKS
+ *   server to relay.  Like -H, port number can be omitted and the default
+ *   is 1080. You can also specify this value pair in the environment
+ *   variable SOCKS5_SERVER and give the -s option to use it.
+ *
+ *   The '-4' and the '-5' options are for specifying SOCKS relaying and
+ *   indicates protocol version to use. It is valid only when used with
+ *   '-s' or '-S'. Default is '-5' (protocol version 5)
+ *
+ *   The '-R' option is for specifying method to resolve the
+ *   hostname. Three keywords ("local", "remote", "both") or dot-notation
+ *   IP address are acceptable.  The keyword "both" means, "Try local
+ *   first, then remote". If a dot-notation IP address is specified, use
+ *   this host as nameserver. The default is "remote" for SOCKS5 or
+ *   "local" for others. On SOCKS4 protocol, remote resolving method
+ *   ("remote" and "both") requires protocol 4a supported server.
+ *
+ *   The '-p' option will forward a local TCP port instead of using the
+ *   standard input and output.
+ *
+ *   The '-P' option is same to '-p' except keep remote session. The
+ *   program repeats waiting the port with holding remote session without
+ *   disconnecting. To disconnect the remote session, send EOF to stdin or
+ *   kill the program.
+ *
+ *   The '-w' option specifys timeout seconds for making connection with
+ *   TARGET host.
+ *
+ *   The '-d' option is used for debug. If you fail to connect, use this
+ *   and check request to and response from server.
+ *
+ *   You can omit the "port" argument when program name is special format
+ *   containing port number itself. For example,
+ *     $ ln -s connect connect-25
+ *   means this connect-25 command is spcifying port number 25 already
+ *   so you need not 2nd argument (and ignored if specified).
+ *
+ *   To use proxy, this example is for SOCKS5 connection to connect to
+ *   'host' at port 25 via SOCKS5 server on 'firewall' host.
+ *     $ connect -S firewall  host 25
+ *   or
+ *     $ SOCKS5_SERVER=firewall; export SOCKS5_SERVER
+ *     $ connect -s host 25
+ *
+ *   For a HTTP-PROXY connection:
+ *     $ connect -H proxy-server:8080  host 25
+ *   or
+ *     $ HTTP_PROXY=proxy-server:8080; export HTTP_PROXY
+ *     $ connect -h host 25
+ *   To forward a local port, for example to use ssh:
+ *     $ connect -p 5550 -H proxy-server:8080  host 22
+ *    ($ ssh -l user -p 5550 localhost )
+ *
+ * TIPS
+ * ====
+ *
+ *   Connect.c doesn't have any configuration to specify the SOCKS server.
+ *   If you are a mobile user, this limitation might bother you.  However,
+ *   You can compile connect.c and link with other standard SOCKS library
+ *   like the NEC SOCKS5 library or Dante. This means connect.c is
+ *   socksified and uses a configration file like to other SOCKSified
+ *   network commands and you can switch configuration file any time
+ *   (ex. when ppp startup) that brings you switching of SOCKS server for
+ *   connect.c in same way with other commands. For this case, you can
+ *   write ~/.ssh/config like this:
+ *
+ *     ProxyCommand connect -n %h %p
+ *
+ * SOCKS5 authentication
+ * =====================
+ *
+ *   Only USER/PASS authentication is supported.
+ *
+ * Proxy authentication
+ * ====================
+ *
+ *   Only BASIC scheme is supported.
+ *
+ * Authentication informations
+ * ===========================
+ *
+ *   User name for authentication is specifed by an environment variable
+ *   or system login name.  And password is specified from environment
+ *   variable or external program (specified in $SSH_ASKPASS) or tty.
+ *
+ *   Following environment variable is used for specifying user name.
+ *     SOCKS: $SOCKS5_USER, $LOGNAME, $USER
+ *     HTTP Proxy: $HTTP_PROXY_USER, $LOGNAME, $USER
+ *
+ * ssh-askpass support
+ * ===================
+  *
+ *   You can use ssh-askpass (came from OpenSSH or else) to specify
+ *   password on graphical environment (X-Window or MS Windows). To use
+ *   this, set program name to environment variable SSH_ASKPASS. On UNIX,
+ *   X-Window must be required, so $DISPLAY environment variable is also
+ *   needed.  On Win32 environment, $DISPLAY is not mentioned.
+ *
+ * Related Informations
+ * ====================
+ *
+ *   SOCKS5 -- RFC 1928, RFC 1929, RFC 1961
+ *             NEC SOCKS Reference Implementation is available from:
+ *               http://www.socks.nec.com
+ *             DeleGate version 5 or earlier can be SOCKS4 server,
+ *             and version 6 can be SOCKS5 and SOCKS4 server.
+ *             and version 7.7.0 or later can be SOCKS5 and SOCKS4a server.
+ *               http://www.delegate.org/delegate/
+ *
+ *   HTTP-Proxy --
+ *             Many http proxy servers supports this, but https should
+ *             be allowed as configuration on your host.
+ *             For example on DeleGate, you should add "https" to the
+ *             "REMITTABLE" parameter to allow HTTP-Proxy like this:
+ *               delegated -Pxxxx ...... REMITTABLE="+,https" ...
+ *
+ *  Hypertext Transfer Protocol -- HTTP/1.1  -- RFC 2616
+ *  HTTP Authentication: Basic and Digest Access Authentication -- RFC 2617
+ *             For proxy authentication, refer these documents.
+ *
+ ***********************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <memory.h>
+#include <errno.h>
+#include <assert.h>
+#include <sys/types.h>
+#include <stdarg.h>
+#include <fcntl.h>
+#include <signal.h>
+
+#ifdef __CYGWIN32__
+#undef _WIN32
+#endif
+
+#ifdef _WIN32
+#include <windows.h>
+#include <winsock.h>
+#include <sys/stat.h>
+#include <io.h>
+#include <conio.h>
+#else /* !_WIN32 */
+#include <unistd.h>
+#include <pwd.h>
+#include <termios.h>
+#include <sys/time.h>
+#ifndef __hpux
+#include <sys/select.h>
+#endif /* __hpux */
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#if !defined(_WIN32) && !defined(__CYGWIN32__)
+#define WITH_RESOLVER 1
+#include <arpa/nameser.h>
+#include <resolv.h>
+#else  /* not ( not _WIN32 && not __CYGWIN32__) */
+#undef WITH_RESOLVER
+#endif /* not ( not _WIN32 && not __CYGWIN32__) */
+#endif /* !_WIN32 */
+
+#ifdef _WIN32
+#define ECONNRESET WSAECONNRESET
+#endif /* _WI32 */
+
+
+
+#ifndef LINT
+static char *vcid = "$Id: connect.c 100 2007-07-03 10:48:26Z gotoh $";
+#endif
+
+/* Microsoft Visual C/C++ has _snprintf() and _vsnprintf() */
+#ifdef _MSC_VER
+#define snprintf _snprintf
+#define vsnprintf _vsnprintf
+#endif
+
+/* consider Borland C */
+#ifdef __BORLANDC__
+#define _kbhit kbhit
+#define _setmode setmode
+#endif
+
+/* help message.
+   Win32 environment does not support -R option (vc and cygwin)
+   Win32 native compilers does not support -w option, yet (vc)
+*/
+static char *usage = "usage: %s [-dnhst45] [-p local-port]"
+#ifdef _WIN32
+#ifdef __CYGWIN32__
+"[-w timeout] \n"                               /* cygwin cannot -R */
+#else  /* not __CYGWIN32__ */
+" \n"                                           /* VC cannot -w nor -R  */
+#endif /* not __CYGWIN32__ */
+#else  /* not _WIN32 */
+/* help message for UNIX */
+"[-R resolve] [-w timeout] \n"
+#endif /* not _WIN32 */
+"          [-H proxy-server[:port]] [-S [EMAIL PROTECTED]:port]] \n"
+"          [-T proxy-server[:port]]\n"
+"          [-c telnet-proxy-command]\n"
+"          host port\n";
+
+/* name of this program */
+char *progname = NULL;
+char *progdesc = "connect --- simple relaying command via proxy.";
+char *rcs_revstr = "$Revision: 100 $";
+char *revstr = NULL;
+int major_version = 1;
+int minor_version = 0;
+
+/* set of character for strspn() */
+const char *digits    = "0123456789";
+const char *dotdigits = "0123456789.";
+
+/* options */
+int f_debug = 0;
+
+/* report flag to hide secure information */
+int f_report = 1;
+
+int connect_timeout = 0;
+
+/* local input type */
+#define LOCAL_STDIO     0
+#define LOCAL_SOCKET    1
+char *local_type_names[] = { "stdio", "socket" };
+int   local_type = LOCAL_STDIO;
+u_short local_port = 0;                         /* option 'p' */
+int f_hold_session = 0;                         /* option 'P' */
+
+char *telnet_command = "telnet %h %p";
+
+/* utiity types, pair holder of number and string */
+typedef struct {
+    int num;
+    const char *str;
+} LOOKUP_ITEM;
+
+/* relay method, server and port */
+#define METHOD_UNDECIDED 0
+#define METHOD_DIRECT    1
+#define METHOD_SOCKS     2
+#define METHOD_HTTP      3
+#define METHOD_TELNET    4
+char *method_names[] = { "UNDECIDED", "DIRECT", "SOCKS", "HTTP", "TELNET" };
+
+int   relay_method = METHOD_UNDECIDED;          /* relaying method */
+char *relay_host = NULL;                        /* hostname of relay server */
+u_short relay_port = 0;                         /* port of relay server */
+char *relay_user = NULL;                        /* user name for auth */
+
+/* destination target host and port */
+char *dest_host = NULL;
+struct sockaddr_in dest_addr;
+u_short dest_port = 0;
+
+/* informations for SOCKS */
+#define SOCKS5_REP_SUCCEEDED    0x00    /* succeeded */
+#define SOCKS5_REP_FAIL         0x01    /* general SOCKS serer failure */
+#define SOCKS5_REP_NALLOWED     0x02    /* connection not allowed by ruleset */
+#define SOCKS5_REP_NUNREACH     0x03    /* Network unreachable */
+#define SOCKS5_REP_HUNREACH     0x04    /* Host unreachable */
+#define SOCKS5_REP_REFUSED      0x05    /* connection refused */
+#define SOCKS5_REP_EXPIRED      0x06    /* TTL expired */
+#define SOCKS5_REP_CNOTSUP      0x07    /* Command not supported */
_______________________________________________
Commits mailing list
[email protected]
https://lists.moblin.org/mailman/listinfo/commits

Reply via email to