Bugzilla – Attachment 1663 Details for
Bug 1621
[patch] support -oControlMaster=required
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
0001-Add-ControlMaster-required-option.patch
0001-Add-ControlMaster-required-option.patch (text/plain), 2.23 KB, created by
Colin Walters
on 2009-07-19 04:57:12 AEST
(
hide
)
Description:
0001-Add-ControlMaster-required-option.patch
Filename:
MIME Type:
Creator:
Colin Walters
Created:
2009-07-19 04:57:12 AEST
Size:
2.23 KB
patch
obsolete
>From 43d186ce7ce1be0c3b3aa9fec20d1eda9246daaf Mon Sep 17 00:00:00 2001 >From: Colin Walters <walters@verbum.org> >Date: Sat, 18 Jul 2009 14:49:26 -0400 >Subject: [PATCH] Add ControlMaster=required option > >If specified, we exit if the ControlMaster is not available. This >is useful for higher level programs which use multiplexing internally, >and want to ensure that we don't accidentally initiate multiple >connections. >--- > mux.c | 6 +++++- > readconf.c | 2 ++ > readconf.h | 1 + > 3 files changed, 8 insertions(+), 1 deletions(-) > >diff --git a/mux.c b/mux.c >index 79f8376..65e20b3 100644 >--- a/mux.c >+++ b/mux.c >@@ -514,6 +514,7 @@ muxclient(const char *path) > switch (options.control_master) { > case SSHCTL_MASTER_AUTO: > case SSHCTL_MASTER_AUTO_ASK: >+ case SSHCTL_MASTER_REQUIRED: > debug("auto-mux: Trying existing master"); > /* FALLTHROUGH */ > case SSHCTL_MASTER_NO: >@@ -546,6 +547,8 @@ muxclient(const char *path) > strerror(errno)); > } > close(sock); >+ if (options.control_master == SSHCTL_MASTER_REQUIRED) >+ cleanup_exit(255); > return; > } > >@@ -582,7 +585,8 @@ muxclient(const char *path) > muxerr: > close(sock); > buffer_free(&m); >- if (muxclient_command != SSHMUX_COMMAND_OPEN) >+ if (options.control_master == SSHCTL_MASTER_REQUIRED >+ || muxclient_command != SSHMUX_COMMAND_OPEN) > cleanup_exit(255); > logit("Falling back to non-multiplexed connection"); > xfree(options.control_path); >diff --git a/readconf.c b/readconf.c >index 53fc6c7..7bb08a9 100644 >--- a/readconf.c >+++ b/readconf.c >@@ -850,6 +850,8 @@ parse_int: > value = SSHCTL_MASTER_YES; > else if (strcmp(arg, "no") == 0 || strcmp(arg, "false") == 0) > value = SSHCTL_MASTER_NO; >+ else if (strcmp(arg, "required") == 0) >+ value = SSHCTL_MASTER_REQUIRED; > else if (strcmp(arg, "auto") == 0) > value = SSHCTL_MASTER_AUTO; > else if (strcmp(arg, "ask") == 0) >diff --git a/readconf.h b/readconf.h >index 8fb3a85..ee8f236 100644 >--- a/readconf.h >+++ b/readconf.h >@@ -130,6 +130,7 @@ typedef struct { > #define SSHCTL_MASTER_AUTO 2 > #define SSHCTL_MASTER_ASK 3 > #define SSHCTL_MASTER_AUTO_ASK 4 >+#define SSHCTL_MASTER_REQUIRED 5 > > void initialize_options(Options *); > void fill_default_options(Options *); >-- >1.6.2.5 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1621
: 1663