]> andersk Git - moira.git/commitdiff
fix extraction of recursive members of specific credentials lists
authormar <mar>
Fri, 28 Oct 1988 15:30:56 +0000 (15:30 +0000)
committermar <mar>
Fri, 28 Oct 1988 15:30:56 +0000 (15:30 +0000)
gen/nfs.qc

index d071e08c23bd722e34692c2799ca4f8038506325..914f51e1ec539fd806e4630e31b9358e3dafc463 100644 (file)
@@ -130,7 +130,7 @@ int do_nfs()
 int do_lists(lists)
 struct save_queue *lists;
 ##{
-    struct save_queue *sq;
+    struct save_queue *sq, *members;
     char file[64], *u;
     struct hash *users, *do_everyone();
     struct stat sb;
@@ -177,19 +177,24 @@ struct save_queue *lists;
        }
        sq = sq_create();
        sq_save_data(sq, listname);
+       members = sq_create();
        while (sq_get_data(sq, &lsname)) {
 ##         repeat retrieve (lname = trim(l.name))
 ##             where m.list_id = l1.list_id and l1.name = @lsname and
 ##                   m.member_type = "LIST" and m.member_id = l.list_id {
-             sq_save_unique_string(sq, lname);
+             sq_save_unique_string(sq, strsave(lname));
 ##         }
 ##         repeat retrieve (id = m.member_id)
 ##             where m.list_id = l1.list_id and l1.name = @lsname and
 ##                   m.member_type = "USER" {
-             if (u = hash_lookup(users, id)) 
-               fprintf(fd, "%s\n", u);
+             if (u = hash_lookup(users, id)) {
+                 sq_save_unique_data(members, u);
+             }
 ##         }
        }
+       while (sq_get_data(members, &lsname))
+         fprintf(fd, "%s\n", lsname);
+       sq_destroy(members);
        sq_destroy(sq);
        if (fclose(fd)) {
            fprintf(stderr, "error closing %s\n", file);
This page took 0.156161 seconds and 5 git commands to generate.