From 49c66f1d9bde50d442bd65b30c927ebe6f420d29 Mon Sep 17 00:00:00 2001 From: Ray Link Date: Thu, 4 Apr 2013 14:31:33 -0400 Subject: zwrite: Add -S for ZNOAUTH sender spoofing zwrite: Manpage update for -S --- clients/zwrite/zwrite.1 | 5 +++++ clients/zwrite/zwrite.c | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/clients/zwrite/zwrite.1 b/clients/zwrite/zwrite.1 index b6feab4..825e3cb 100644 --- a/clients/zwrite/zwrite.1 +++ b/clients/zwrite/zwrite.1 @@ -44,6 +44,8 @@ instance ] [ realm ] [ .BI \-f arg ] [ +.BI \-S +sender ] [ .BI user \ ... ] [ .BI \-m @@ -178,6 +180,9 @@ This argument may not be used in conjunction with the \-f option. Allows a user to specify a different realm for the message, if the server supports interrealm Zephyr. .TP +.B \-S \fIsender\fR +Specify a sender. The message will be sent unauthenticated. +.TP .B \-F \fIformat\fR Allows a user to specify a different default format for the message. .TP diff --git a/clients/zwrite/zwrite.c b/clients/zwrite/zwrite.c index f6780a5..0f1fcf9 100644 --- a/clients/zwrite/zwrite.c +++ b/clients/zwrite/zwrite.c @@ -29,7 +29,7 @@ static const char rcsid_zwrite_c[] = "$Id$"; #define MAXRECIPS 100 int nrecips, msgarg, verbose, quiet, nodot, cc; -char *whoami, *inst, *class, *opcode, *realm, *recips[MAXRECIPS]; +char *whoami, *inst, *class, *opcode, *realm, *recips[MAXRECIPS], *sender = 0; Z_AuthProc auth; void un_tabify(char **, int *); @@ -189,6 +189,13 @@ main(int argc, char *argv[]) arg++; charset = argv[arg]; break; + case 'S': + if (arg == argc-1) + usage(whoami); + arg++; + sender = argv[arg]; + auth = ZNOAUTH; + break; default: usage(whoami); } @@ -232,7 +239,7 @@ main(int argc, char *argv[]) notice.z_class = class; notice.z_class_inst = inst; notice.z_opcode = "PING"; - notice.z_sender = 0; + notice.z_sender = sender; notice.z_message_len = 0; notice.z_recipient = ""; notice.z_charset = ZGetCharset(charset); -- cgit v1.2.3