]> andersk Git - moira.git/commitdiff
Care about public and hidden bits; look for MACHINE members of lists.
authorzacheiss <zacheiss>
Mon, 26 Jul 2004 20:17:10 +0000 (20:17 +0000)
committerzacheiss <zacheiss>
Mon, 26 Jul 2004 20:17:10 +0000 (20:17 +0000)
gen/winad.pc

index 0a78a4b80ba6397390de7d07e982d3904fdfbf34..48582d8ad6bb1fb6fe9547bb4876acabbcf38611 100644 (file)
@@ -222,7 +222,7 @@ int do_groups(void)
   char acltype[LIST_ACL_TYPE_SIZE];
   int aclid;
   char aclname[STRINGS_STRING_SIZE];
-  int list_id, active, maillist, grouplist;
+  int list_id, active, publicflg, hidden, maillist, grouplist;
   EXEC SQL END DECLARE SECTION;
 
   sprintf(foutf, "%s/wingroup.db", winad_dir);
@@ -236,16 +236,15 @@ int do_groups(void)
   }
 
   EXEC SQL DECLARE l_cursor CURSOR FOR
-    SELECT list_id, name, active, maillist, grouplist, description,
-acl_type, acl_id
+    SELECT list_id, name, active, publicflg, hidden, maillist,
+    grouplist, description, acl_type, acl_id
     FROM list
     ORDER BY list_id;
   EXEC SQL OPEN l_cursor;
   while (1)
     {
-      EXEC SQL FETCH l_cursor INTO :list_id, :listname, :active, :maillist,
-:grouplist,
-            :description, :acltype, :aclid;
+      EXEC SQL FETCH l_cursor INTO :list_id, :listname, :active, :publicflg,
+       :hidden, :maillist, :grouplist, :description, :acltype, :aclid;
       
       if (sqlca.sqlcode)
              break;
@@ -277,9 +276,9 @@ acl_type, acl_id
       
       strtrim(aclname);
        
-      fprintf(fout, "%d %s %d %d %d %s %s %s\n",
-                   list_id, listname, active, maillist, grouplist, acltype, aclname,
-description);
+      fprintf(fout, "%d %s %d %d %d %d %d %s %s %s\n",
+                   list_id, listname, active, publicflg, hidden, maillist,
+             grouplist, acltype, aclname, description);
        }
 
   if (sqlca.sqlcode < 0)
@@ -376,8 +375,29 @@ int do_groupmembership(void)
         db_error(sqlca.sqlcode);
 
       EXEC SQL CLOSE csr002;
+
+      /* get all the machines */
+      EXEC SQL DECLARE csr003 CURSOR FOR
+       SELECT i.member_type, m.name
+       FROM machine m, imembers i
+       WHERE i.list_id = :list_id AND i.member_type = 'MACHINE'
+       AND i.member_id = m.mach_id
+       ORDER BY m.name;
+
+      EXEC SQL OPEN csr003;
+      while (1)
+       {
+         EXEC SQL FETCH csr003 into :member_type, :member_name;
+         if (sqlca.sqlcode)
+           break;
+         fprintf(fout, "%d %s %s\n", list_id, member_type, member_name);
        }
 
+      if (sqlca.sqlcode < 0)
+       db_error(sqlca.sqlcode);
+       EXEC SQL CLOSE csr003;
+    }
+
   if (sqlca.sqlcode < 0)
     db_error(sqlca.sqlcode);
 
This page took 0.059071 seconds and 5 git commands to generate.