diff options
author | runge <runge> | 2007-11-13 03:10:34 +0000 |
---|---|---|
committer | runge <runge> | 2007-11-13 03:10:34 +0000 |
commit | 2689647d6c7a9ab9c88faacf5dbc0200e9bc4a24 (patch) | |
tree | bacf8e52c94d8f9eb9dc123208c0921a33a88f56 /x11vnc/x11vnc.c | |
parent | e24cf9491ccf696bc6b1ac36574861a343408cd0 (diff) | |
download | libtdevnc-2689647d6c7a9ab9c88faacf5dbc0200e9bc4a24.tar.gz libtdevnc-2689647d6c7a9ab9c88faacf5dbc0200e9bc4a24.zip |
x11vnc: add clear_locks (Caps_Lock, etc) action.
Diffstat (limited to 'x11vnc/x11vnc.c')
-rw-r--r-- | x11vnc/x11vnc.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/x11vnc/x11vnc.c b/x11vnc/x11vnc.c index 3345db7..33953cd 100644 --- a/x11vnc/x11vnc.c +++ b/x11vnc/x11vnc.c @@ -1045,13 +1045,17 @@ void ssh_remote_tunnel(char *instr, int lport) { int bestpid = -1; int best = -1; char line[1024]; - char *ps = "ps -ef"; + char *psef = "ps -ef"; + char *psww = "ps wwwwwwaux"; + char *ps = psef; /* not portable... but it is really good to terminate the ssh when done. */ /* ps -ef | egrep 'ssh2.*-R.*5907:localhost:5900.*[email protected].*sleep 300' | grep -v grep | awk '{print $2}' */ if (strstr(UT.sysname, "Linux")) { - ps = "ps wwwwwaux"; + ps = psww; } else if (strstr(UT.sysname, "BSD")) { - ps = "ps wwwwwaux"; + ps = psww; + } else if (strstr(UT.sysname, "Darwin")) { + ps = psww; } sprintf(cmd, "env COLUMNS=256 %s | egrep '%s.*-R *%d:localhost:%d.*%s.*sleep *%d' | grep -v grep | awk '{print $2}'", ps, ssh, rport, lport, s, sleep); pipe = popen(cmd, "r"); @@ -2961,6 +2965,8 @@ int main(int argc, char* argv[]) { clear_mods = 1; } else if (!strcmp(arg, "-clear_keys")) { clear_mods = 2; + } else if (!strcmp(arg, "-clear_all")) { + clear_mods = 3; } else if (!strcmp(arg, "-remap")) { CHECK_ARGC remap_file = strdup(argv[++i]); |