]> andersk Git - moira.git/blobdiff - clients/mrtest/mrtest.c
fix dereferencing null problems in calls to ss_perror()
[moira.git] / clients / mrtest / mrtest.c
index f4df4e417d36690fa92b687638f104e9755685c1..8598f2d1f7b1b64aa7c4668bfc53f103796ccb4e 100644 (file)
@@ -43,8 +43,6 @@ sms()
 #endif __SABER__
        
        init_ss_err_tbl();
-       init_sms_err_tbl();
-       init_krb_err_tbl();
 
        ss = ss_create_invocation("sms", "2.0", (char *)NULL,
                                  &sms_test, &status);
@@ -63,7 +61,7 @@ sms()
 test_noop()
 {
        int status = sms_noop();
-       if (status) ss_perror(ss, status, 0);
+       if (status) ss_perror(ss, status, "");
 }
 
 test_new()
@@ -91,13 +89,26 @@ char *argv[];
            }
        }
        status = sms_connect(server);
-       if (status) ss_perror(ss, status, 0);
+       if (status) ss_perror(ss, status, "");
 }
 
 test_disconnect()
 {
        int status = sms_disconnect();
-       if (status) ss_perror(ss, status, 0);
+       if (status) ss_perror(ss, status, "");
+}
+
+test_host()
+{
+        char host[BUFSIZ];
+        int status;
+
+        bzero(host, sizeof(host));
+
+       if (status = sms_host(host, sizeof(host) - 1))
+           ss_perror(ss, status, "");
+       else
+           printf("You are connected to host %s\n", host);
 }
 
 test_auth()
@@ -105,7 +116,7 @@ test_auth()
        int status;
 
        status = sms_auth("smstest");
-       if (status) ss_perror(ss, status, 0);
+       if (status) ss_perror(ss, status, "");
 }
 
 test_script(argc, argv)
@@ -239,7 +250,7 @@ test_query(argc, argv)
        count = 0;
        status = sms_query(argv[1], argc-2, argv+2, print_reply, (char *)NULL);
        printf("%d tuple%s\n", count, ((count == 1) ? "" : "s"));
-       if (status) ss_perror(ss, status, 0);
+       if (status) ss_perror(ss, status, "");
 }
 
 test_access(argc, argv)
@@ -252,7 +263,7 @@ test_access(argc, argv)
                return;
        }
        status = sms_access(argv[1], argc-2, argv+2);
-       if (status) ss_perror(ss, status, 0);
+       if (status) ss_perror(ss, status, "");
 }
 
 
@@ -265,3 +276,19 @@ test_dcm(argc, argv)
        if (status = sms_do_update())
          ss_perror(ss, status, " while triggering dcm");
 }
+
+
+test_motd(argc, argv)
+       int argc;
+       char **argv;
+{
+       int status;
+       char *motd;
+
+       if (status = sms_motd(&motd))
+         ss_perror(ss, status, " while getting motd");
+       if (motd)
+         printf("%s\n", motd);
+       else
+         printf("No message of the day.\n");
+}
This page took 0.100993 seconds and 4 git commands to generate.