Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: OpenSSH: Dev

[patch] fix to ForceCommand to support additional arguments to internal-sftp

 

 

OpenSSH dev RSS feed   Index | Next | Previous | View Threaded


michael.barabanov at gmail

Aug 18, 2008, 9:40 PM

Post #1 of 2 (204 views)
Permalink
[patch] fix to ForceCommand to support additional arguments to internal-sftp

Hi,

This patch makes things like ForceCommand internal-sftp -l INFO work
(current code in 5.1 would just end the session). Please consider for
inclusion into mainline.

Michael.

--- /var/tmp/session.c 2008-08-18 21:07:10.000000000 -0700
+++ session.c 2008-08-18 21:12:51.000000000 -0700
@@ -781,7 +781,7 @@
if (options.adm_forced_command) {
original_command = command;
command = options.adm_forced_command;
- if (strcmp(INTERNAL_SFTP_NAME, command) == 0)
+ if (strncmp(INTERNAL_SFTP_NAME, command,
strlen(INTERNAL_SFTP_NAME)) == 0 && isspace(command[strlen(
INTERNAL_SFTP_NAME)]))
s->is_subsystem = SUBSYSTEM_INT_SFTP;
else if (s->is_subsystem)
s->is_subsystem = SUBSYSTEM_EXT;
@@ -789,7 +789,7 @@
} else if (forced_command) {
original_command = command;
command = forced_command;
- if (strcmp(INTERNAL_SFTP_NAME, command) == 0)
+ if (strncmp(INTERNAL_SFTP_NAME, command,
strlen(INTERNAL_SFTP_NAME)) == 0 &&
isspace(command[strlen(INTERNAL_SFTP_NAME)]))
s->is_subsystem = SUBSYSTEM_INT_SFTP;
else if (s->is_subsystem)
s->is_subsystem = SUBSYSTEM_EXT;
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev[at]mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev


michael.barabanov at gmail

Aug 18, 2008, 9:28 PM

Post #2 of 2 (187 views)
Permalink
[patch] fix to ForceCommand to support additional arguments to internal-sftp [In reply to]

Hi,

This patch makes things like ForceCommand internal-sftp -l INFO work
(current code in 5.1 would just end the session). Please consider for
inclusion into mainline.

Michael.

--- /var/tmp/session.c 2008-08-18 21:07:10.000000000 -0700
+++ session.c 2008-08-18 21:12:51.000000000 -0700
@@ -781,7 +781,7 @@
if (options.adm_forced_command) {
original_command = command;
command = options.adm_forced_command;
- if (strcmp(INTERNAL_SFTP_NAME, command) == 0)
+ if (strncmp(INTERNAL_SFTP_NAME, command,
strlen(INTERNAL_SFTP_NAME)) == 0 &&
isspace(command[strlen(INTERNAL_SFTP_NAME)]))
s->is_subsystem = SUBSYSTEM_INT_SFTP;
else if (s->is_subsystem)
s->is_subsystem = SUBSYSTEM_EXT;
@@ -789,7 +789,7 @@
} else if (forced_command) {
original_command = command;
command = forced_command;
- if (strcmp(INTERNAL_SFTP_NAME, command) == 0)
+ if (strncmp(INTERNAL_SFTP_NAME, command,
strlen(INTERNAL_SFTP_NAME)) == 0 &&
isspace(command[strlen(INTERNAL_SFTP_NAME)]))
s->is_subsystem = SUBSYSTEM_INT_SFTP;
else if (s->is_subsystem)
s->is_subsystem = SUBSYSTEM_EXT;
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev[at]mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev

OpenSSH dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.