diff options
author | Robert S. French <rfrench@mit.edu> | 1988-01-29 04:38:02 +0000 |
---|---|---|
committer | Robert S. French <rfrench@mit.edu> | 1988-01-29 04:38:02 +0000 |
commit | 4294ac2e255b1aba02ed4913a16a07592b3ccfcc (patch) | |
tree | c09d6b8fd2ffd97dd58fc221f709be6c693733ba /clients/zwrite/zwrite.c | |
parent | 0bd2a9c8f59ecfabaf4a1a297d8dd1846766fdec (diff) |
Added -c and now defaults to authenticated messages
Diffstat (limited to 'clients/zwrite/zwrite.c')
-rw-r--r-- | clients/zwrite/zwrite.c | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/clients/zwrite/zwrite.c b/clients/zwrite/zwrite.c index 9604c9e..98fc059 100644 --- a/clients/zwrite/zwrite.c +++ b/clients/zwrite/zwrite.c @@ -25,7 +25,7 @@ static char rcsid_zwrite_c[] = "$Header$"; #define URGENT "URGENT" int nrecips,everyone,msgarg,verbose,quiet; -char *whoami,*inst; +char *whoami,*inst,*class; int (*auth)(); main(argc,argv) @@ -50,9 +50,10 @@ main(argc,argv) bzero(¬ice,sizeof(ZNotice_t)); - auth = ZNOAUTH; + auth = ZAUTH; verbose = quiet = msgarg = nrecips = everyone = nocheck = 0; + class = MESSAGE_CLASS; inst = PERSONAL; arg = 1; @@ -66,8 +67,8 @@ main(argc,argv) if (strlen(argv[arg]) > 2) usage(whoami); switch (argv[arg][1]) { - case 'a': - auth = ZAUTH; + case 'd': + auth = ZNOAUTH; break; case 'v': verbose = 1; @@ -88,6 +89,12 @@ main(argc,argv) inst = argv[arg]; everyone = 1; break; + case 'c': + if (arg == argc-1) + usage(whoami); + arg++; + class = argv[arg]; + break; case 'm': if (arg == argc-1) usage(whoami); @@ -103,18 +110,18 @@ main(argc,argv) exit (1); } - if (!nocheck) { - notice.z_kind = ACKED; - notice.z_port = 0; - notice.z_class = MESSAGE_CLASS; - notice.z_class_inst = inst; - notice.z_opcode = "PING"; - notice.z_sender = 0; - notice.z_message_len = 0; - notice.z_recipient = ""; - notice.z_default_format = ""; + notice.z_kind = ACKED; + notice.z_port = 0; + notice.z_class = class; + notice.z_class_inst = inst; + notice.z_opcode = "PING"; + notice.z_sender = 0; + notice.z_message_len = 0; + notice.z_recipient = ""; + notice.z_default_format = ""; + + if (!nocheck) send_off(¬ice,argc,argv,0); - } if (!msgarg && isatty(0)) printf("Type your message now. End with control-D or a dot on a line by itself.\n"); @@ -184,6 +191,8 @@ send_off(notice,argc,argv,real) for (arg=1;everyone||(arg<argc&&!(msgarg&&arg>=msgarg));arg++) { if (*argv[arg] == '-' && !everyone) continue; + if (!strcmp(argv[arg-1],"-c")) + continue; if (!strcmp(argv[arg-1],"-i") && !everyone) continue; notice->z_recipient = everyone?"":argv[arg]; @@ -258,6 +267,6 @@ send_off(notice,argc,argv,real) usage(s) char *s; { - printf("Usage: %s [-a] [-v] [-q] [-u] [-i inst] [user ...] [-m message]\n",s); + printf("Usage: %s [-d] [-v] [-q] [-u] [-i inst] [-c class] [user ...] [-m message]\n",s); exit(1); } |