mirror of
https://github.com/tmate-io/tmate-ssh-server.git
synced 2020-11-18 19:53:51 -08:00
log executed commands
This commit is contained in:
parent
620740ce58
commit
d2ab60b40c
@ -195,6 +195,9 @@ static void tmate_exec_cmd(__unused struct tmate_session *session,
|
||||
char *cause;
|
||||
|
||||
cmd_str = unpack_string(uk);
|
||||
|
||||
tmate_info("Local cmd: %s", cmd_str);
|
||||
|
||||
if (cmd_string_parse(cmd_str, &cmdlist, NULL, 0, &cause) != 0) {
|
||||
free(cause);
|
||||
goto out;
|
||||
|
@ -143,6 +143,8 @@ int tmate_should_exec_cmd_locally(const struct cmd_entry *cmd)
|
||||
|
||||
void tmate_client_cmd(int client_id, const char *cmd)
|
||||
{
|
||||
tmate_info("Remote cmd (cid=%d): %s", client_id, cmd);
|
||||
|
||||
pack(array, 3);
|
||||
pack(int, TMATE_IN_EXEC_CMD);
|
||||
pack(int, client_id);
|
||||
|
@ -191,6 +191,8 @@ void tmate_proxy_exec(struct tmate_session *session, const char *command)
|
||||
void tmate_notify_client_join(__unused struct tmate_session *session,
|
||||
struct client *c)
|
||||
{
|
||||
tmate_notice("Client joined (cid=%d)", c->id);
|
||||
|
||||
if (!tmate_has_proxy())
|
||||
return;
|
||||
|
||||
@ -205,6 +207,8 @@ void tmate_notify_client_join(__unused struct tmate_session *session,
|
||||
void tmate_notify_client_left(__unused struct tmate_session *session,
|
||||
struct client *c)
|
||||
{
|
||||
tmate_notice("Client left (cid=%d)", c->id);
|
||||
|
||||
if (!tmate_has_proxy())
|
||||
return;
|
||||
|
||||
|
2
tmate.h
2
tmate.h
@ -92,7 +92,7 @@ extern void printflike(1, 2) tmate_notify(const char *fmt, ...);
|
||||
extern void printflike(2, 3) tmate_notify_later(int timeout, const char *fmt, ...);
|
||||
|
||||
extern void tmate_client_resize(u_int sx, u_int sy);
|
||||
extern void tmate_legacy_client_pane_key(int pane_id, int key);
|
||||
extern void tmate_client_legacy_pane_key(int pane_id, int key);
|
||||
extern void tmate_client_pane_key(int pane_id, key_code key);
|
||||
extern void tmate_client_cmd(int client_id, const char *cmd);
|
||||
extern void tmate_client_set_active_pane(int client_id, int win_idx, int pane_id);
|
||||
|
Loading…
x
Reference in New Issue
Block a user