src/server/ssh_server/ssh_callbacks.cc
/**
 * Handle SSH channel exec request
 *
 * Exec requests provide a command that needs to be executed.
 * The command is provided while starting a new terminal using
 * request_terminal().
 */
Handle SSH channel exec request
Exec requests provide a command that needs to be executed.
The command is provided while starting a new terminal using
request_terminal().
Handle SSH channel exec request Exec requests provide a command that needs to be executed . The command is provided while starting a new terminal using request_terminal () .
int channel_exec_request_cb(ssh_session session, ssh_channel channel,
                            const char *command,
                            void *userdata)
{
	using namespace Genode;
	Ssh::Server  &server = *reinterpret_cast<Ssh::Server*>(userdata);
	Ssh::Session *p      = server.lookup_session(session);
	if (!p || p->channel != channel) { return SSH_ERROR; }
	if (!p->terminal) {
		p->terminal = server.lookup_terminal(*p);
		if (!p->terminal) {
			return server.request_terminal(*p, command) ? SSH_OK
			                                            : SSH_ERROR;
		}
	}
	return SSH_ERROR;
}
int channel_exec_request_cb ( ssh_session session , ssh_channel channel , const char * command , void * userdata ) { using namespace Genode ; Ssh :: Server & server = * reinterpret_cast < Ssh :: Server * > ( userdata ) ; Ssh :: Session * p = server . lookup_session ( session ) ; if ( ! p || p -> channel != channel ) { return SSH_ERROR ; } if ( ! p -> terminal ) { p -> terminal = server . lookup_terminal ( * p ) ; if ( ! p -> terminal ) { return server . request_terminal ( * p , command ) ? SSH_OK : SSH_ERROR ; } } return SSH_ERROR ; }
Handle SSH channel exec request
 Exec requests provide a command that needs to be executed.
Handle SSH channel exec request Exec requests provide a command that needs to be executed .
/*
	 * Look up terminal and in case there is none, check
	 * if we have to wait for another subsystem to come up.
	 * In this case we return successfully to the client
	 * and wait for a Terminal session to be established.
	 */ /* exec commands can only be done with newly started terminals */