X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/blobdiff_plain/2c0dfed5194f8639c512faa887442eb98cf70f11..7902e66952109629296466b4b1ebfe2e6285d548:/clients/mrtest/mrtest.c diff --git a/clients/mrtest/mrtest.c b/clients/mrtest/mrtest.c index 0f928875..6055b7f9 100644 --- a/clients/mrtest/mrtest.c +++ b/clients/mrtest/mrtest.c @@ -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");