]> andersk Git - moira.git/blobdiff - clients/mrtest/mrtest.c
Add sponsor_type/sponsor_id column to users table, and client support for manipulatin...
[moira.git] / clients / mrtest / mrtest.c
index 0f928875e4698089c40a24f6cef45ab0e106a83e..6055b7f9cb9cecac43f091a968688d4fcb6f156e 100644 (file)
@@ -71,6 +71,7 @@ void test_dcm(void);
 void test_script(int argc, char **argv);
 void test_list_requests(void);
 void test_version(int argc, char **argv);
+void test_krb5_auth(void);
 void set_signal_handler(int, void (*handler)(int));
 void set_signal_blocking(int, int);
 
@@ -179,7 +180,7 @@ void execute_line(char *cmdbuf)
   else if (!strcmp(argv[0], "query") || !strcmp(argv[0], "qy"))
     test_query(argc, argv);
   else if (!strcmp(argv[0], "auth") || !strcmp(argv[0], "a"))
-    test_auth();
+    test_krb5_auth();
   else if (!strcmp(argv[0], "proxy") || !strcmp(argv[0], "p"))
     test_proxy(argc, argv);
   else if (!strcmp(argv[0], "access"))
@@ -195,6 +196,8 @@ void execute_line(char *cmdbuf)
     quit = 1;
   else if (!strcmp(argv[0], "version") || !strcmp(argv[0], "v"))
     test_version(argc, argv);
+  else if (!strcmp(argv[0], "krb4_auth") || !strcmp(argv[0], "4"))
+    test_auth();
   else
     {
       fprintf(stderr, "moira: Unknown request \"%s\".  "
@@ -256,8 +259,14 @@ int parse(char *buf, char *argv[MAXARGS])
          /* skip whitespace */
          for (*p++ = '\0'; *p == ' ' || *p == '\t'; p++)
            ;
-         if (*p && *p != '\n')
-           argv[++argc] = p--;
+         if (*p && *p != '\n') {
+           if (++argc >= MAXARGS) {
+             fprintf(stderr,
+                     "moira: Too many command line arguments\n");
+             return 0;
+           }
+           argv[argc] = p--;
+         }
        }
     }
   if (*p == '\n')
@@ -314,6 +323,15 @@ void test_auth(void)
     com_err("moira (auth)", status, "");
 }
 
+void test_krb5_auth(void)
+{
+  int status;
+
+  status = mr_krb5_auth("mrtest");
+  if (status)
+    com_err("moira (krb5_auth)", status, "");
+}
+
 void test_proxy(int argc, char *argv[])
 {
   int status;
@@ -513,7 +531,8 @@ void test_list_requests(void)
   printf("host\t\t\tIdentify the server host\n");
   printf("motd, m\t\t\tGet the Message of the Day\n");
   printf("query, qy\t\tMake a query.\n");
-  printf("auth, a\t\t\tAuthenticate to Moira.\n");
+  printf("auth, a\t\t\tAuthenticate to Moira via krb5.\n");
+  printf("krb4_auth, 4\t\tAuthenticate to Moira via krb4.\n");
   printf("proxy, p\t\tProxy authenticate to Moira.\n");
   printf("access\t\t\tCheck access to a Moira query.\n");
   printf("dcm\t\t\tTrigger the DCM\n");
This page took 0.064859 seconds and 4 git commands to generate.