]> andersk Git - moira.git/blobdiff - clients/moira/zephyr.c
Fix typo.
[moira.git] / clients / moira / zephyr.c
index ef86803a21b76a47287d3d2c55ffaacabd0e0ed6..5d704c15ca2972c389dba60b3bb5b252791f5ff5 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id $
+/* $Id$
  *
  * Zephyr ACL routines for the Moira client
  *
@@ -27,14 +27,14 @@ void RealDeleteZephyr(char **info, Bool one_item);
 static char **SetDefaults(char **info, char *name)
 {
   info[ZA_CLASS] = strdup(name);
-  info[ZA_XMT_TYPE] = strdup("LIST");
-  info[ZA_SUB_TYPE] = strdup("LIST");
-  info[ZA_IWS_TYPE] = strdup("LIST");
-  info[ZA_IUI_TYPE] = strdup("LIST");
-  info[ZA_XMT_ID] = strdup("empty");
-  info[ZA_SUB_ID] = strdup("empty");
-  info[ZA_IWS_ID] = strdup("empty");
-  info[ZA_IUI_ID] = strdup("empty");
+  info[ZA_XMT_TYPE] = strdup("NONE");
+  info[ZA_SUB_TYPE] = strdup("NONE");
+  info[ZA_IWS_TYPE] = strdup("NONE");
+  info[ZA_IUI_TYPE] = strdup("NONE");
+  info[ZA_XMT_ID] = strdup("");
+  info[ZA_SUB_ID] = strdup("");
+  info[ZA_IWS_ID] = strdup("");
+  info[ZA_IUI_ID] = strdup("");
   info[ZA_MODTIME] = info[ZA_MODBY] = info[ZA_MODWITH] = NULL;
   info[ZA_END] = NULL;
   return info;
@@ -70,35 +70,15 @@ static char *PrintZephyrInfo(char **info)
     }
   sprintf(buf, "        Zephyr class: %s", info[ZA_CLASS]);
   Put_message(buf);
-  if (!strcmp(info[ZA_XMT_ID], "WILDCARD"))
-    {
-      free(info[ZA_XMT_ID]);
-      info[ZA_XMT_ID] = strdup("*.*@*");
-    }
   sprintf(buf, "Transmit ACL:           %s %s", info[ZA_XMT_TYPE],
          strcasecmp(info[ZA_XMT_TYPE], "NONE") ? info[ZA_XMT_ID] : "");
   Put_message(buf);
-  if (!strcmp(info[ZA_SUB_ID], "WILDCARD"))
-    {
-      free(info[ZA_SUB_ID]);
-      info[ZA_SUB_ID] = strdup("*.*@*");
-    }
   sprintf(buf, "Subscription ACL:       %s %s", info[ZA_SUB_TYPE],
          strcasecmp(info[ZA_SUB_TYPE], "NONE") ? info[ZA_SUB_ID] : "");
   Put_message(buf);
-  if (!strcmp(info[ZA_IWS_ID], "WILDCARD"))
-    {
-      free(info[ZA_IWS_ID]);
-      info[ZA_IWS_ID] = strdup("*.*@*");
-    }
   sprintf(buf, "Instance Wildcard ACL:  %s %s", info[ZA_IWS_TYPE],
          strcasecmp(info[ZA_IWS_TYPE], "NONE") ? info[ZA_IWS_ID] : "");
   Put_message(buf);
-  if (!strcmp(info[ZA_IUI_ID], "WILDCARD"))
-    {
-      free(info[ZA_IUI_ID]);
-      info[ZA_IUI_ID] = strdup("*.*@*");
-    }
   sprintf(buf, "Instance Indentity ACL: %s %s", info[ZA_IUI_TYPE],
          strcasecmp(info[ZA_IUI_TYPE], "NONE") ? info[ZA_IUI_ID] : "");
   Put_message(buf);
@@ -133,81 +113,45 @@ static char **AskZephyrInfo(char **info, Bool rename)
        }
     }
 
-  if (GetTypeFromUser("What kind of transmit restriction", "ace_type",
+  if (GetTypeFromUser("What kind of transmit restriction", "zace_type",
                      &info[ZA_XMT_TYPE]) == SUB_ERROR)
     return NULL;
-  if (strcasecmp(info[ZA_XMT_TYPE], "NONE"))
+  if (strcasecmp(info[ZA_XMT_TYPE], "NONE") &&
+      strcasecmp(info[ZA_XMT_TYPE], "ALL"))
     {
-      if (!strcmp(info[ZA_XMT_ID], "WILDCARD"))
-       {
-         free(info[ZA_XMT_ID]);
-         info[ZA_XMT_ID] = strdup("*.*@*");
-       }
       sprintf(buf, "Which %s: ", info[ZA_XMT_TYPE]);
       if (GetValueFromUser(buf, &info[ZA_XMT_ID]) == SUB_ERROR)
        return NULL;
-      if (!strcmp(info[ZA_XMT_ID], "*.*@*"))
-       {
-         free(info[ZA_XMT_ID]);
-         info[ZA_XMT_ID] = strdup("WILDCARD");
-       }
     }
-  if (GetTypeFromUser("What kind of subscription restriction", "ace_type",
+  if (GetTypeFromUser("What kind of subscription restriction", "zace_type",
                      &info[ZA_SUB_TYPE]) == SUB_ERROR)
     return NULL;
-  if (strcasecmp(info[ZA_SUB_TYPE], "NONE"))
+  if (strcasecmp(info[ZA_SUB_TYPE], "NONE") &&
+      strcasecmp(info[ZA_SUB_TYPE], "ALL"))
     {
-      if (!strcmp(info[ZA_SUB_ID], "WILDCARD"))
-       {
-         free(info[ZA_SUB_ID]);
-         info[ZA_SUB_ID] = strdup("*.*@*");
-       }
       sprintf(buf, "Which %s: ", info[ZA_SUB_TYPE]);
       if (GetValueFromUser(buf, &info[ZA_SUB_ID]) == SUB_ERROR)
        return NULL;
-      if (!strcmp(info[ZA_SUB_ID], "*.*@*"))
-       {
-         free(info[ZA_SUB_ID]);
-         info[ZA_SUB_ID] = strdup("WILDCARD");
-       }
     }
   if (GetTypeFromUser("What kind of wildcard instance restriction",
-                     "ace_type", &info[ZA_IWS_TYPE]) == SUB_ERROR)
+                     "zace_type", &info[ZA_IWS_TYPE]) == SUB_ERROR)
     return NULL;
-  if (strcasecmp(info[ZA_IWS_TYPE], "NONE") != 0)
+  if (strcasecmp(info[ZA_IWS_TYPE], "NONE") &&
+      strcasecmp(info[ZA_IWS_TYPE], "ALL"))
     {
-      if (!strcmp(info[ZA_IWS_ID], "WILDCARD"))
-       {
-         free(info[ZA_IWS_ID]);
-         info[ZA_IWS_ID] = strdup("*.*@*");
-       }
       sprintf(buf, "Which %s: ", info[ZA_IWS_TYPE]);
       if (GetValueFromUser(buf, &info[ZA_IWS_ID]) == SUB_ERROR)
        return NULL;
-      if (!strcmp(info[ZA_IWS_ID], "*.*@*"))
-       {
-         free(info[ZA_IWS_ID]);
-         info[ZA_IWS_ID] = strdup("WILDCARD");
-       }
     }
   if (GetTypeFromUser("What kind of instance identity restriction",
-                     "ace_type", &info[ZA_IUI_TYPE]) == SUB_ERROR)
+                     "zace_type", &info[ZA_IUI_TYPE]) == SUB_ERROR)
     return NULL;
-  if (strcasecmp(info[ZA_IUI_TYPE], "NONE"))
+  if (strcasecmp(info[ZA_IUI_TYPE], "NONE") &&
+      strcasecmp(info[ZA_IUI_TYPE], "ALL"))
     {
-      if (!strcmp(info[ZA_IUI_ID], "WILDCARD"))
-       {
-         free(info[ZA_IUI_ID]);
-         info[ZA_IUI_ID] = strdup("*.*@*");
-       }
       sprintf(buf, "Which %s: ", info[ZA_IUI_TYPE]);
       if (GetValueFromUser(buf, &info[ZA_IUI_ID]) == SUB_ERROR)
        return NULL;
-      if (!strcmp(info[ZA_IUI_ID], "*.*@*"))
-       {
-         free(info[ZA_IUI_ID]);
-         info[ZA_IUI_ID] = strdup("WILDCARD");
-       }
     }
   FreeAndClear(&info[ZA_MODTIME], TRUE);
   FreeAndClear(&info[ZA_MODBY], TRUE);
@@ -225,7 +169,7 @@ int GetZephyr(int argc, char **argv)
   struct mqelem *top;
 
   top = GetZephyrInfo(argv[1]);
-  Loop(top, (void *) PrintZephyrInfo);
+  Loop(top, (void (*)(char **)) PrintZephyrInfo);
   FreeQueue(top);
   return DM_NORMAL;
 }
This page took 0.09281 seconds and 4 git commands to generate.