summaryrefslogtreecommitdiff
path: root/clients/zwrite
diff options
context:
space:
mode:
authorGravatar Ray Link <rlink+git@cs.cmu.edu>2013-04-04 14:31:33 -0400
committerGravatar Karl Ramm <kcr@1ts.org>2013-04-07 13:53:27 -0400
commit49c66f1d9bde50d442bd65b30c927ebe6f420d29 (patch)
treea8222e55bd6ee2e91b8624c18ecfc8fa7c84b298 /clients/zwrite
parentd39179badeb5856f7ce2ef646b819ad7708acc44 (diff)
zwrite: Add -S for ZNOAUTH sender spoofing
zwrite: Manpage update for -S
Diffstat (limited to 'clients/zwrite')
-rw-r--r--clients/zwrite/zwrite.15
-rw-r--r--clients/zwrite/zwrite.c11
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);