]> andersk Git - moira.git/blobdiff - gen/hesiod.dc
also extract poboxes for users of status 5
[moira.git] / gen / hesiod.dc
index 68aacfae0c49e19e8d1d7fba05a3a95ef63e194d..59a08257a4e74be48b16381a45d459c0d61812ef 100644 (file)
@@ -197,7 +197,7 @@ do_passwd()
       SELECT login, uid, shell, fullname, nickname, office_addr,
             office_phone, home_phone, users_id, pop_id, potype, status
       FROM users
-      WHERE status = 1 or status = 6
+      WHERE status = 1 or status = 5 or status = 6
       ORDER BY users_id;
     EXEC SQL OPEN u_cursor;
     while (1) {
@@ -420,7 +420,7 @@ do_filsys()
     register char *p;
     struct stat sb;
     time_t ftime;
-    struct save_queue *sq, *sq_create();
+    struct save_queue *sq, *sq2, *sq_create();
     EXEC SQL BEGIN DECLARE SECTION;
     char name[33], type[9], loc[81], access[2], mount[33], trans[257];
     char comments[65];
@@ -454,6 +454,7 @@ do_filsys()
     fprintf(stderr, "Building filsys.db\n");
     get_mach();
     sq = sq_create();
+    sq2 = sq_create();
 
     EXEC SQL DECLARE f_cursor CURSOR FOR
       SELECT label, type, name, mach_id, access, mount, comments, filsys_id
@@ -481,6 +482,9 @@ do_filsys()
        } else if (!strcmp(type, "FSGROUP")) {
            sprintf(trans, "%s:%d", strtrim(name), fid);
            sq_save_data(sq, strsave(trans));
+       } else if (!strcmp(type, "MUL")) {
+           sprintf(trans, "%s:%d", strtrim(name), fid);
+           sq_save_data(sq2, strsave(trans));
        }
     }
     EXEC SQL CLOSE f_cursor;
@@ -521,6 +525,27 @@ do_filsys()
     }
     sq_destroy(sq);
 
+    while (sq_get_data(sq2, &group)) {
+        fid = atoi(index(group, ':') + 1);
+        *index(group, ':') = 0;
+        fprintf(out, "%s.filsys\tHS %s \"MUL", group, HTYPE);
+       EXEC SQL DECLARE f_cursor3 CURSOR FOR
+           SELECT DISTINCT f.label, g.key
+           FROM filesys f, fsgroup g
+           WHERE f.filsys_id = g.filsys_id AND g.group_id = :fid
+           ORDER BY key, label;
+       EXEC SQL OPEN f_cursor3;
+       while (1) {
+           EXEC SQL FETCH f_cursor3 INTO :name, :trans;
+           if (sqlca.sqlcode != 0) break;
+            fprintf(out, " %s", strtrim(name));
+       }
+       EXEC SQL CLOSE f_cursor3;
+        fprintf(out, "\"\n");
+        free(group);
+    }
+    sq_destroy(sq2);
+
     EXEC SQL DECLARE a_cursor CURSOR FOR
       SELECT name, trans
       FROM alias
This page took 0.075751 seconds and 4 git commands to generate.