Add command line option to set message
authorJohn Carr <jfc@mit.edu>
Tue, 16 Apr 1991 08:23:52 +0000 (08:23 +0000)
committerJohn Carr <jfc@mit.edu>
Tue, 16 Apr 1991 08:23:52 +0000 (08:23 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1990 dc483132-0cff-0310-8789-dd5450dbe970

src/appl/simple/client/sim_client.c

index 2cb4535e9c46b647febe4daf78338530bc277a28..ef67c15ed9f46019e956dff63ecd5a4ffe9a5ea2 100644 (file)
@@ -64,8 +64,8 @@ char *argv[];
     krb5_rcache rcache;
     extern krb5_deltat krb5_clockskew;
 
-    if (argc != 2) {
-       fprintf(stderr, "usage: %s <hostname>\n",PROGNAME);
+    if (argc != 2 && argc != 3) {
+       fprintf(stderr, "usage: %s <hostname> [message]\n",PROGNAME);
        exit(1);
     }
     
@@ -263,8 +263,8 @@ char *argv[];
     }
 
     /* Make the safe message */
-    inbuf.length = strlen(MSG);
-    inbuf.data = MSG;
+    inbuf.data = argc == 3 ? argv[2] : MSG;
+    inbuf.length = strlen (inbuf.data);
 
     if (retval = krb5_mk_safe(&inbuf,
                              CKSUMTYPE_RSA_MD4_DES,