Make itkacl-test print out error messages.
authorSteinar H. Gunderson <sesse@samfundet.no>
Thu, 20 Jun 2013 22:00:51 +0000 (00:00 +0200)
committerSteinar H. Gunderson <sesse@samfundet.no>
Thu, 20 Jun 2013 22:00:51 +0000 (00:00 +0200)
itkacl-2.0/itkacl-test.c

index 8ebdb95305c349301d0784c8e7dbfbddfe6183a9..49388d4ca0fb244d5197c1507f1398a32c948189 100644 (file)
@@ -5,8 +5,13 @@ int itkacl_check(const char * const realm, const char * const user,
        
 int main()
 {
-       if (itkacl_check("/login/unix-servers/cirkus", "sesse", NULL, 0) == 0) {
+       char errmsg[1024];
+       int ret = itkacl_check("/login/unix-servers/cirkus", "sesse", errmsg, sizeof(errmsg));
+
+       if (ret == 0) {
                printf("OK\n");
+       } else if (ret == -1) {
+               printf("Error: %s\n", errmsg);
        } else {
                printf("Not OK\n");
        }