Bugzilla – Attachment 484 Details for
Bug 742
Allow sftp to read config file to honor "Protocol 1"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Rough quicky patch
sftp-patch.txt (text/plain), 1.90 KB, created by
Ben Lindstrom
on 2003-10-12 13:58:30 AEST
(
hide
)
Description:
Rough quicky patch
Filename:
MIME Type:
Creator:
Ben Lindstrom
Created:
2003-10-12 13:58:30 AEST
Size:
1.90 KB
patch
obsolete
>Index: sftp.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/sftp.c,v >retrieving revision 1.38 >diff -u -r1.38 sftp.c >--- sftp.c 8 Oct 2003 08:27:36 -0000 1.38 >+++ sftp.c 12 Oct 2003 03:58:22 -0000 >@@ -32,6 +32,12 @@ > #include "pathnames.h" > #include "misc.h" > >+/* XXX: This rats nest needs to be sorted out */ >+#define SSH_MAX_IDENTITY_FILES 100 >+#define SSH_MAX_FORWARDS_PER_DIRECTION 100 >+uid_t original_real_uid; >+#include "readconf.h" >+ > #include "sftp.h" > #include "sftp-common.h" > #include "sftp-client.h" >@@ -127,6 +133,8 @@ > arglist args; > extern int optind; > extern char *optarg; >+ Options options; >+ char *config; > > args.list = NULL; > addargs(&args, "ssh"); /* overwritten with ssh_program */ >@@ -149,6 +157,7 @@ > debug_level++; > break; > case 'F': >+ config = optarg; > case 'o': > addargs(&args, "-%c%s", ch, optarg); > break; >@@ -221,6 +230,34 @@ > if (!*host) { > fprintf(stderr, "Missing hostname\n"); > usage(); >+ } >+ >+ /* We just want any 'Protocol' defined in configuration files */ >+ initialize_options(&options); >+ >+ if (config != NULL) { >+ if (!read_config_file(config, host, &options)) >+ fatal("Can't open user config file %.100s: " >+ "%.100s", config, strerror(errno)); >+ } else { >+ char buf[256]; >+ struct passwd *pw; >+ pw = getpwuid(getuid()); >+ >+ snprintf(buf, sizeof buf, "%.100s/%.100s", pw->pw_dir, >+ _PATH_SSH_USER_CONFFILE); >+ (void)read_config_file(buf, host, &options); >+ (void)read_config_file(_PATH_HOST_CONFIG_FILE, host, &options); >+ } >+ >+ /* XXX: magic number 4 below is SSH_PROTO_2 */ >+ if (sshver == 2 && options.protocol != 4) { >+ sshver = 1; >+ >+ printf("Configuration override\n"); >+ if (sftp_server == NULL) >+ sftp_server = _PATH_SFTP_SERVER; >+ > } > > addargs(&args, "-oProtocol %d", sshver);
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 742
:
483
| 484