diff options
| author | Carson Fleming <cflems@cflems.net> | 2023-01-11 17:50:15 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-11 17:50:15 +0100 |
| commit | e047bd5998397bb3478abffa2d5946fb64bb6140 (patch) | |
| tree | c7e8da304a24e19f9436d33d5629b853d251ad52 | |
| parent | 470c145cdf91d6dbab3ff0985deb1a8c8d6eb2d6 (diff) | |
| parent | 2e73165802bdba6b3da81b351cf34b6f40ce2f72 (diff) | |
| download | pk-e047bd5998397bb3478abffa2d5946fb64bb6140.tar.gz | |
Merge pull request #1 from cflems/master
Merge PTY functionality into master
| -rw-r--r-- | LICENSE | 21 | ||||
| -rw-r--r-- | pkctl.py | 16 | ||||
| -rw-r--r-- | pkd_stub.py | 9 |
3 files changed, 28 insertions, 18 deletions
@@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Carson Fleming + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. @@ -2,17 +2,11 @@ import os, sys, signal, socket, selectors, time, tty # basic config -#SOCKET_FILE = "/run/pk/pk.sock" -#PID_FILE = "/run/pk/pk.pid" -#DAEMON_FILE = "/usr/bin/pkd" -#LOG_FILE = "/var/log/pk.log" -#KEY_FILE = "/etc/pk/server_key.json" - -SOCKET_FILE = "./pk.sock" -PID_FILE = "./pk.pid" -DAEMON_FILE = "python pkd.py" -LOG_FILE = "./pk.log" -KEY_FILE = "./default_key.json" +SOCKET_FILE = "/run/pk/pk.sock" +PID_FILE = "/run/pk/pk.pid" +DAEMON_FILE = "/usr/bin/pkd" +LOG_FILE = "/var/log/pk.log" +KEY_FILE = "/etc/pk/server_key.json" DAEMON_PORT = 2236 DAEMON_BITS = 4096 diff --git a/pkd_stub.py b/pkd_stub.py index c8e2ae4..db378a3 100644 --- a/pkd_stub.py +++ b/pkd_stub.py @@ -422,6 +422,8 @@ def screen_reader(screen): cmdq_lock.release() elif cmd == b'show-serverkey': resp = showcrypto() + elif cmd == b'\xc0\xdeprompt': + pass elif cmd == b'pty': resp = '[pk] Must specify a client to connect to via PTY.' elif cmd[:4] == b'pty ': @@ -444,13 +446,6 @@ def screen_reader(screen): detach_screen(screen) return resp = '[pk] %s' % pty_out - elif cmd == b'\xc0\xdeprompt': - try: - screen.sendall(prompt_str()) - except: - detach_screen(screen) - return - continue elif len(cmd) > 0: shcmd = True targets = [] |
