diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2018-12-23 13:56:39 +0100 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2018-12-23 13:56:39 +0100 |
commit | d1c216b79080ac6092c362504bcc44f5d4b929c4 (patch) | |
tree | de8c902e43e4d803f1ac35fa69fdd081995aa0dd /src | |
parent | abea0f617f6339f3eeedcc849ef690289d5bad80 (diff) |
improved error logging
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/pkt.c | 4 | ||||
-rw-r--r-- | src/ptunnel.c | 4 |
2 files changed, 5 insertions, 3 deletions
@@ -189,7 +189,9 @@ void handle_packet(char *buf, unsigned bytes, int is_pcap, struct sockaddr_in *a return; } else - pt_log(kLog_error, "Dropping duplicate proxy session request.\n"); + pt_log(kLog_error, "Dropping duplicate proxy session request " + "with ID %d and seq %d.\n", + pt_pkt->id_no, pt_pkt->seq_no); } else if (cur && pt_pkt->state == kProto_authenticate) { /* Sanity check packet length, and make sure it matches what we expect */ diff --git a/src/ptunnel.c b/src/ptunnel.c index a4c5ae5..af164c5 100644 --- a/src/ptunnel.c +++ b/src/ptunnel.c @@ -184,7 +184,7 @@ int main(int argc, char *argv[]) { if (opts.chroot) { pt_log(kLog_info, "Restricting file access to %s\n", opts.root_dir); if (-1 == chdir(opts.root_dir) || -1 == chroot(opts.root_dir)) { - pt_log(kLog_error, "%s: %s\n", opts.root_dir, strerror(errno)); + pt_log(kLog_error, "chdir/chroot `%s': %s\n", opts.root_dir, strerror(errno)); exit(1); } } @@ -210,7 +210,7 @@ int main(int argc, char *argv[]) { if (! freopen("/dev/null", "r", stdin) || ! freopen("/dev/null", "w", stdout) || ! freopen("/dev/null", "w", stderr)) - pt_log(kLog_error, "freopen: %s\n", strerror(errno)); + pt_log(kLog_error, "freopen `%s': %s\n", "/dev/null", strerror(errno)); } } } |