X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=windows%2Fwinplink.c;h=99e269fdc106687e7edff5c51fb778ee22d545b7;hb=1de7240eb88fa24a8532ded116b4ec72dd213008;hp=78311b59ed7fa5c424905f87dd1fbcbe0de6e053;hpb=009ab4a20cfd685ff20b8f922068ffa6900b92c7;p=PuTTY.git diff --git a/windows/winplink.c b/windows/winplink.c index 78311b59..99e269fd 100644 --- a/windows/winplink.c +++ b/windows/winplink.c @@ -11,6 +11,7 @@ #include "putty.h" #include "storage.h" #include "tree234.h" +#include "winsecur.h" #define WM_AGENT_CALLBACK (WM_APP + 4) @@ -212,6 +213,9 @@ static void usage(void) printf(" -N don't start a shell/command (SSH-2 only)\n"); printf(" -nc host:port\n"); printf(" open tunnel in place of session (SSH-2 only)\n"); + printf(" -sshlog file\n"); + printf(" -sshrawlog file\n"); + printf(" log protocol details to a file\n"); printf(" -shareexists\n"); printf(" test whether a connection-sharing upstream exists\n"); exit(1); @@ -494,6 +498,22 @@ int main(int argc, char **argv) } } +#if !defined UNPROTECT && !defined NO_SECURITY + /* + * Protect our process. + */ + { + char *error = NULL; + if (!setprocessacl(error)) { + char *message = dupprintf("Could not restrict process ACL: %s", + error); + logevent(NULL, message); + sfree(message); + sfree(error); + } + } +#endif + if (errors) return 1; @@ -598,6 +618,17 @@ int main(int argc, char **argv) return 1; } + /* + * Plink doesn't provide any way to add forwardings after the + * connection is set up, so if there are none now, we can safely set + * the "simple" flag. + */ + if (conf_get_int(conf, CONF_protocol) == PROT_SSH && + !conf_get_int(conf, CONF_x11_forward) && + !conf_get_int(conf, CONF_agentfwd) && + !conf_get_str_nthstrkey(conf, CONF_portfwd, 0)) + conf_set_int(conf, CONF_ssh_simple, TRUE); + logctx = log_init(NULL, conf); console_provide_logctx(logctx);