gods

a simple blocklist for ssh
Log | Files | Refs | README | LICENSE

commit d3dbd0e9f933b092aa4a744eef717794e4aa03f2
parent 3edc35ea8124a20581f89c1a2432afcce3c9860c
Author: Naveen Narayanan <zerous@nocebo.space>
Date:   Sat, 18 Sep 2021 16:53:07 +0200

Parse hostname

Diffstat:
Mparser.c | 12+++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/parser.c b/parser.c @@ -212,7 +212,17 @@ timestamp() static int hostname() { - return 0; + char str[MAXHOSTNAMELEN]; + + if (gethostname(str, MAXHOSTNAMELEN) == -1) + return 0; + printf("gethostname: %s\n", str); + if (!word()) + return 0; + if (strcmp(token, str)) + return 0; + printf("hostname ok\n"); + return 1; } static int