On Thu, Dec 08, 2011 at 07:34:16PM +0100, Mike Belopuhov wrote:
> patches for portable openssh should go to the portable openssh mailing lists:
> http://mindrot.org/portable-openssh.html
> (you can't apply them to openbsd source tree)
> 
> and you should probably use unified diffs (diff -up).

Here is a patch against OpenBSD src:


Index: auth-krb5.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/auth-krb5.c,v
retrieving revision 1.19
diff -u -p -r1.19 auth-krb5.c
--- auth-krb5.c 3 Aug 2006 03:34:41 -0000       1.19
+++ auth-krb5.c 12 Dec 2011 19:08:05 -0000
@@ -47,8 +47,6 @@
 #ifdef KRB5
 #include <krb5.h>
 
-extern ServerOptions    options;
-
 static int
 krb5_init(void *context)
 {
Index: auth-options.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/auth-options.c,v
retrieving revision 1.56
diff -u -p -r1.56 auth-options.c
--- auth-options.c      18 Oct 2011 04:58:26 -0000      1.56
+++ auth-options.c      12 Dec 2011 19:08:05 -0000
@@ -56,8 +56,6 @@ int forced_tun_device = -1;
 /* "principals=" option. */
 char *authorized_principals = NULL;
 
-extern ServerOptions options;
-
 void
 auth_clear_options(void)
 {
Index: auth-passwd.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/auth-passwd.c,v
retrieving revision 1.43
diff -u -p -r1.43 auth-passwd.c
--- auth-passwd.c       21 Sep 2007 08:15:29 -0000      1.43
+++ auth-passwd.c       12 Dec 2011 19:08:05 -0000
@@ -54,7 +54,6 @@
 #include "auth-options.h"
 
 extern Buffer loginmsg;
-extern ServerOptions options;
 int sys_auth_passwd(Authctxt *, const char *);
 
 extern login_cap_t *lc;
Index: auth-rh-rsa.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/auth-rh-rsa.c,v
retrieving revision 1.43
diff -u -p -r1.43 auth-rh-rsa.c
--- auth-rh-rsa.c       4 Mar 2010 10:36:03 -0000       1.43
+++ auth-rh-rsa.c       12 Dec 2011 19:08:05 -0000
@@ -33,9 +33,6 @@
 #endif
 #include "monitor_wrap.h"
 
-/* import */
-extern ServerOptions options;
-
 int
 auth_rhosts_rsa_key_allowed(struct passwd *pw, char *cuser, char *chost,
     Key *client_host_key)
Index: auth-rhosts.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/auth-rhosts.c,v
retrieving revision 1.44
diff -u -p -r1.44 auth-rhosts.c
--- auth-rhosts.c       7 Mar 2010 11:57:13 -0000       1.44
+++ auth-rhosts.c       12 Dec 2011 19:08:05 -0000
@@ -38,7 +38,6 @@
 #include "misc.h"
 
 /* import */
-extern ServerOptions options;
 extern int use_privsep;
 
 /*
Index: auth-rsa.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/auth-rsa.c,v
retrieving revision 1.80
diff -u -p -r1.80 auth-rsa.c
--- auth-rsa.c  23 May 2011 03:30:07 -0000      1.80
+++ auth-rsa.c  12 Dec 2011 19:08:05 -0000
@@ -45,9 +45,6 @@
 #include "ssh.h"
 #include "misc.h"
 
-/* import */
-extern ServerOptions options;
-
 /*
  * Session identifier that is used to bind key exchange and authentication
  * responses to a particular session.
Index: auth.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/auth.c,v
retrieving revision 1.94
diff -u -p -r1.94 auth.c
--- auth.c      23 May 2011 03:33:38 -0000      1.94
+++ auth.c      12 Dec 2011 19:08:05 -0000
@@ -59,7 +59,6 @@
 #include "monitor_wrap.h"
 
 /* import */
-extern ServerOptions options;
 extern int use_privsep;
 
 /* Debugging messages */
Index: auth1.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/auth1.c,v
retrieving revision 1.75
diff -u -p -r1.75 auth1.c
--- auth1.c     31 Aug 2010 09:58:37 -0000      1.75
+++ auth1.c     12 Dec 2011 19:08:05 -0000
@@ -37,9 +37,6 @@
 #endif
 #include "monitor_wrap.h"
 
-/* import */
-extern ServerOptions options;
-
 static int auth1_process_password(Authctxt *, char *, size_t);
 static int auth1_process_rsa(Authctxt *, char *, size_t);
 static int auth1_process_rhosts_rsa(Authctxt *, char *, size_t);
Index: auth2-gss.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/auth2-gss.c,v
retrieving revision 1.17
diff -u -p -r1.17 auth2-gss.c
--- auth2-gss.c 10 Mar 2011 02:52:57 -0000      1.17
+++ auth2-gss.c 12 Dec 2011 19:08:05 -0000
@@ -41,8 +41,6 @@
 #include "ssh-gss.h"
 #include "monitor_wrap.h"
 
-extern ServerOptions options;
-
 static void input_gssapi_token(int type, u_int32_t plen, void *ctxt);
 static void input_gssapi_mic(int type, u_int32_t plen, void *ctxt);
 static void input_gssapi_exchange_complete(int type, u_int32_t plen, void 
*ctxt);
Index: auth2-hostbased.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/auth2-hostbased.c,v
retrieving revision 1.14
diff -u -p -r1.14 auth2-hostbased.c
--- auth2-hostbased.c   4 Aug 2010 05:42:47 -0000       1.14
+++ auth2-hostbased.c   12 Dec 2011 19:08:05 -0000
@@ -48,7 +48,6 @@
 #include "pathnames.h"
 
 /* import */
-extern ServerOptions options;
 extern u_char *session_id2;
 extern u_int session_id2_len;
 
Index: auth2-jpake.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/auth2-jpake.c,v
retrieving revision 1.4
diff -u -p -r1.4 auth2-jpake.c
--- auth2-jpake.c       31 Aug 2010 11:54:45 -0000      1.4
+++ auth2-jpake.c       12 Dec 2011 19:08:05 -0000
@@ -71,7 +71,6 @@ static void input_userauth_jpake_client_
 static int auth2_jpake_start(Authctxt *);
 
 /* import */
-extern ServerOptions options;
 extern u_char *session_id2;
 extern u_int session_id2_len;
 
Index: auth2-kbdint.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/auth2-kbdint.c,v
retrieving revision 1.5
diff -u -p -r1.5 auth2-kbdint.c
--- auth2-kbdint.c      3 Aug 2006 03:34:41 -0000       1.5
+++ auth2-kbdint.c      12 Dec 2011 19:08:05 -0000
@@ -34,9 +34,6 @@
 #include "buffer.h"
 #include "servconf.h"
 
-/* import */
-extern ServerOptions options;
-
 static int
 userauth_kbdint(Authctxt *authctxt)
 {
Index: auth2-none.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/auth2-none.c,v
retrieving revision 1.16
diff -u -p -r1.16 auth2-none.c
--- auth2-none.c        25 Jun 2010 08:46:17 -0000      1.16
+++ auth2-none.c        12 Dec 2011 19:08:05 -0000
@@ -40,9 +40,6 @@
 #endif
 #include "monitor_wrap.h"
 
-/* import */
-extern ServerOptions options;
-
 /* "none" is allowed only one time */
 static int none_enabled = 1;
 
Index: auth2-passwd.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/auth2-passwd.c,v
retrieving revision 1.9
diff -u -p -r1.9 auth2-passwd.c
--- auth2-passwd.c      3 Aug 2006 03:34:41 -0000       1.9
+++ auth2-passwd.c      12 Dec 2011 19:08:05 -0000
@@ -41,9 +41,6 @@
 #include "monitor_wrap.h"
 #include "servconf.h"
 
-/* import */
-extern ServerOptions options;
-
 static int
 userauth_passwd(Authctxt *authctxt)
 {
Index: auth2-pubkey.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/auth2-pubkey.c,v
retrieving revision 1.30
diff -u -p -r1.30 auth2-pubkey.c
--- auth2-pubkey.c      25 Sep 2011 05:44:47 -0000      1.30
+++ auth2-pubkey.c      12 Dec 2011 19:08:05 -0000
@@ -59,7 +59,6 @@
 #include "match.h"
 
 /* import */
-extern ServerOptions options;
 extern u_char *session_id2;
 extern u_int session_id2_len;
 
Index: auth2.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/auth2.c,v
retrieving revision 1.124
diff -u -p -r1.124 auth2.c
--- auth2.c     7 Dec 2011 05:44:38 -0000       1.124
+++ auth2.c     12 Dec 2011 19:08:05 -0000
@@ -53,7 +53,6 @@
 #include "monitor_wrap.h"
 
 /* import */
-extern ServerOptions options;
 extern u_char *session_id2;
 extern u_int session_id2_len;
 
Index: clientloop.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/clientloop.c,v
retrieving revision 1.237
diff -u -p -r1.237 clientloop.c
--- clientloop.c        10 Sep 2011 22:26:34 -0000      1.237
+++ clientloop.c        12 Dec 2011 19:08:05 -0000
@@ -103,9 +103,6 @@
 #include "msg.h"
 #include "roaming.h"
 
-/* import options */
-extern Options options;
-
 /* Flag indicating that stdin should be redirected from /dev/null. */
 extern int stdin_null_flag;
 
Index: monitor.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/monitor.c,v
retrieving revision 1.115
diff -u -p -r1.115 monitor.c
--- monitor.c   23 Jun 2011 23:35:42 -0000      1.115
+++ monitor.c   12 Dec 2011 19:08:05 -0000
@@ -81,7 +81,6 @@ static Gssctxt *gsscontext = NULL;
 #endif
 
 /* Imports */
-extern ServerOptions options;
 extern u_int utmp_len;
 extern Newkeys *current_keys[];
 extern z_stream incoming_stream;
Index: monitor_wrap.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/monitor_wrap.c,v
retrieving revision 1.73
diff -u -p -r1.73 monitor_wrap.c
--- monitor_wrap.c      17 Jun 2011 21:44:31 -0000      1.73
+++ monitor_wrap.c      12 Dec 2011 19:08:05 -0000
@@ -77,7 +77,6 @@ extern z_stream incoming_stream;
 extern z_stream outgoing_stream;
 extern struct monitor *pmonitor;
 extern Buffer loginmsg;
-extern ServerOptions options;
 
 void
 mm_log_handler(LogLevel level, const char *msg, void *ctx)
Index: mux.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/mux.c,v
retrieving revision 1.33
diff -u -p -r1.33 mux.c
--- mux.c       4 Dec 2011 23:16:12 -0000       1.33
+++ mux.c       12 Dec 2011 19:08:05 -0000
@@ -70,7 +70,6 @@
 
 /* from ssh.c */
 extern int tty_flag;
-extern Options options;
 extern int stdin_null_flag;
 extern char *host;
 extern int subsystem_flag;
Index: readconf.h
===================================================================
RCS file: /cvs/src/usr.bin/ssh/readconf.h,v
retrieving revision 1.91
diff -u -p -r1.91 readconf.h
--- readconf.h  23 Sep 2011 07:45:05 -0000      1.91
+++ readconf.h  12 Dec 2011 19:08:05 -0000
@@ -137,6 +137,8 @@ typedef struct {
        int     request_tty;
 }       Options;
 
+extern Options options;
+
 #define SSHCTL_MASTER_NO       0
 #define SSHCTL_MASTER_YES      1
 #define SSHCTL_MASTER_AUTO     2
Index: roaming_client.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/roaming_client.c,v
retrieving revision 1.4
diff -u -p -r1.4 roaming_client.c
--- roaming_client.c    7 Dec 2011 05:44:38 -0000       1.4
+++ roaming_client.c    12 Dec 2011 19:08:05 -0000
@@ -46,7 +46,6 @@
 #include "sshconnect.h"
 
 /* import */
-extern Options options;
 extern char *host;
 extern struct sockaddr_storage hostaddr;
 extern int session_resumed;
Index: servconf.h
===================================================================
RCS file: /cvs/src/usr.bin/ssh/servconf.h,v
retrieving revision 1.99
diff -u -p -r1.99 servconf.h
--- servconf.h  22 Jun 2011 21:57:01 -0000      1.99
+++ servconf.h  12 Dec 2011 19:08:05 -0000
@@ -166,6 +166,8 @@ typedef struct {
        char   *authorized_principals_file;
 }       ServerOptions;
 
+extern ServerOptions options;
+
 /*
  * These are string config options that must be copied between the
  * Match sub-config and the main config, and must be sent from the
Index: serverloop.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/serverloop.c,v
retrieving revision 1.160
diff -u -p -r1.160 serverloop.c
--- serverloop.c        15 May 2011 08:09:01 -0000      1.160
+++ serverloop.c        12 Dec 2011 19:08:05 -0000
@@ -76,8 +76,6 @@
 #include "misc.h"
 #include "roaming.h"
 
-extern ServerOptions options;
-
 /* XXX */
 extern Kex *xxx_kex;
 extern Authctxt *the_authctxt;
Index: session.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/session.c,v
retrieving revision 1.259
diff -u -p -r1.259 session.c
--- session.c   24 Oct 2011 02:13:13 -0000      1.259
+++ session.c   12 Dec 2011 19:08:05 -0000
@@ -115,7 +115,6 @@ static void do_authenticated2(Authctxt *
 static int session_pty_req(Session *);
 
 /* import */
-extern ServerOptions options;
 extern char *__progname;
 extern int log_stderr;
 extern int debug_flag;
Index: sshconnect.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/sshconnect.c,v
retrieving revision 1.234
diff -u -p -r1.234 sshconnect.c
--- sshconnect.c        24 May 2011 07:15:47 -0000      1.234
+++ sshconnect.c        12 Dec 2011 19:08:05 -0000
@@ -60,7 +60,6 @@ static int matching_host_key_dns = 0;
 static pid_t proxy_command_pid = 0;
 
 /* import */
-extern Options options;
 extern char *__progname;
 extern uid_t original_real_uid;
 extern uid_t original_effective_uid;
Index: sshconnect1.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/sshconnect1.c,v
retrieving revision 1.70
diff -u -p -r1.70 sshconnect1.c
--- sshconnect1.c       6 Nov 2006 21:25:28 -0000       1.70
+++ sshconnect1.c       12 Dec 2011 19:08:05 -0000
@@ -49,7 +49,6 @@
 u_char session_id[16];
 u_int supported_authentications = 0;
 
-extern Options options;
 extern char *__progname;
 
 /*
Index: sshconnect2.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/sshconnect2.c,v
retrieving revision 1.188
diff -u -p -r1.188 sshconnect2.c
--- sshconnect2.c       24 May 2011 07:15:47 -0000      1.188
+++ sshconnect2.c       12 Dec 2011 19:08:05 -0000
@@ -74,7 +74,6 @@
 /* import */
 extern char *client_version_string;
 extern char *server_version_string;
-extern Options options;
 
 /*
  * SSH2 key exchange
Index: sshlogin.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/sshlogin.c,v
retrieving revision 1.27
diff -u -p -r1.27 sshlogin.c
--- sshlogin.c  11 Jan 2011 06:06:09 -0000      1.27
+++ sshlogin.c  12 Dec 2011 19:08:05 -0000
@@ -59,7 +59,6 @@
 #include "servconf.h"
 
 extern Buffer loginmsg;
-extern ServerOptions options;
 
 /*
  * Returns the time when the user last logged in.  Returns 0 if the

Reply via email to