Chris Wolfe | 7 Feb 2012 21:01

[PATCH 0/2] Add slave option to do sftp over stdin and stdout

Hi all,

Simplified this to always use stdin/stdout, and took the "-o slave"
naming from last year's proposal.

The earlier patch has now been split into three: the whitespace
change posted earlier, a refactoring to support separate read and
write pipes, and code for the actual slave option.

Chris

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
Chris Wolfe | 7 Feb 2012 21:01

[PATCH 2/2] Add slave option to do sftp over stdin and stdout

---
 sshfs.1 |    2 ++
 sshfs.c |   15 ++++++++++++++-
 2 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/sshfs.1 b/sshfs.1
index 99d1e05..12cc974 100644
--- a/sshfs.1
+++ b/sshfs.1
 <at>  <at>  -127,6 +127,8  <at>  <at>  path to sftp server or subsystem (default: sftp)
 .TP
 \fB\-o\fR directport=PORT
 directly connect to PORT bypassing ssh
+\fB\-o\fR slave
+communicate over stdin and stdout bypassing network
 .TP
 \fB\-o\fR transform_symlinks
 transform absolute symlinks to relative
diff --git a/sshfs.c b/sshfs.c
index 1afefb8..77e2fd2 100644
--- a/sshfs.c
+++ b/sshfs.c
 <at>  <at>  -216,6 +216,7  <at>  <at>  struct sshfs {
 	int foreground;
 	int reconnect;
 	int delay_connect;
+	int slave;
 	char *host;
 	char *base_path;
 	GHashTable *reqtab;
(Continue reading)

Miklos Szeredi | 8 Feb 2012 10:27
Picon

Re: [PATCH 2/2] Add slave option to do sftp over stdin and stdout


You mentioned that this conflicts with the password_stdin option.
Shouldn't it exit with an error mesage if both are given?

Also could you please add a ChangeLog entry?

Other than that all looks good.

Thanks,
Miklos

Chris Wolfe <cwolfe <at> chromium.org> writes:

> ---
>  sshfs.1 |    2 ++
>  sshfs.c |   15 ++++++++++++++-
>  2 files changed, 16 insertions(+), 1 deletions(-)
>
> diff --git a/sshfs.1 b/sshfs.1
> index 99d1e05..12cc974 100644
> --- a/sshfs.1
> +++ b/sshfs.1
>  <at>  <at>  -127,6 +127,8  <at>  <at>  path to sftp server or subsystem (default: sftp)
>  .TP
>  \fB\-o\fR directport=PORT
>  directly connect to PORT bypassing ssh
> +\fB\-o\fR slave
> +communicate over stdin and stdout bypassing network
>  .TP
>  \fB\-o\fR transform_symlinks
(Continue reading)

Chris Wolfe | 7 Feb 2012 21:01

[PATCH 1/2] Split fd into separate read and write pipes

---
 sshfs.c |   27 +++++++++++++++++----------
 1 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/sshfs.c b/sshfs.c
index 32c0002..1afefb8 100644
--- a/sshfs.c
+++ b/sshfs.c
 <at>  <at>  -223,7 +223,8  <at>  <at>  struct sshfs {
 	pthread_mutex_t lock_write;
 	int processing_thread_started;
 	unsigned int randseed;
-	int fd;
+	int rfd;
+	int wfd;
 	int ptyfd;
 	int ptyslavefd;
 	int connver;
 <at>  <at>  -871,7 +872,7  <at>  <at>  static int pty_expect_loop(void)
 	while (1) {
 		struct pollfd fds[2];

-		fds[0].fd = sshfs.fd;
+		fds[0].fd = sshfs.rfd;
 		fds[0].events = POLLIN;
 		fds[1].fd = sshfs.ptyfd;
 		fds[1].events = POLLIN;
 <at>  <at>  -979,7 +980,8  <at>  <at>  static int start_ssh(void)
 		perror("failed to create socket pair");
 		return -1;
(Continue reading)


Gmane