]> andersk Git - moira.git/blobdiff - gen/hesiod.dc
move zip code correctly
[moira.git] / gen / hesiod.dc
index 110e61030ad40c0a2fd8579a368959ed660b133e..8e7c5f6162b36d5cd47c0a7108d95d460b6e2457 100644 (file)
@@ -148,7 +148,7 @@ do_passwd()
     EXEC SQL BEGIN DECLARE SECTION;
     char login[9], shell[33], fullname[33], oa[17], op[13], hp[17];
     char nn[17], ptype[9];
-    int uid, flag1, flag2, id, pid;
+    int uid, flag1, flag2, id, pid, status;
     EXEC SQL END DECLARE SECTION;
 
     sprintf(poutf, "%s/passwd.db", hesiod_dir);
@@ -192,13 +192,13 @@ do_passwd()
     users = create_hash(12001);
     EXEC SQL DECLARE u_cursor CURSOR FOR
       SELECT login, uid, shell, fullname, nickname, office_addr,
-            office_phone, home_phone, users_id, pop_id, potype
+            office_phone, home_phone, users_id, pop_id, potype, status
       FROM users
-      WHERE status = 1;
+      WHERE status = 1 or status = 6;
     EXEC SQL OPEN u_cursor;
     while (1) {
         EXEC SQL FETCH u_cursor INTO :login, :uid, :shell, :fullname, :nn,
-                       :oa, :op, :hp, :id, :pid, :ptype;
+                       :oa, :op, :hp, :id, :pid, :ptype, :status;
             if (sqlca.sqlcode != 0) break;
            strtrim(login);
            dequote(fullname);
@@ -211,9 +211,12 @@ do_passwd()
            strcpy(u->name, login);
            u->lists = NULL;
            hash_store(users, id, u);
-           fprintf(pout, "%s.passwd\tHS %s \"%s:*:%d:101:%s,%s,%s,%s,%s:/mit/%s:%s\"\n",
-                   login, HTYPE, login, uid, fullname, nn, oa, op, hp, login, shell);
-           fprintf(uout, "%d.uid\tHS CNAME %s.passwd\n", uid, login);
+           if (status == 1) {
+               fprintf(pout, "%s.passwd\tHS %s \"%s:*:%d:101:%s,%s,%s,%s,%s:/mit/%s:%s\"\n",
+                       login, HTYPE, login, uid, fullname, nn, oa, op, hp,
+                       login, shell);
+               fprintf(uout, "%d.uid\tHS CNAME %s.passwd\n", uid, login);
+           }
            if (ptype[0] == 'P' && (mach = hash_lookup(machines, pid))) {
                fprintf(bout, "%s.pobox\tHS %s \"POP %s %s\"\n",
                        login, HTYPE, mach, login);
@@ -401,7 +404,7 @@ do_groups()
 do_filsys()
 {
     FILE *out;
-    char outf[64], outft[64], *mach, machbuf[128], *group;
+    char outf[64], outft[64], *mach, *group;
     register char *p;
     struct stat sb;
     time_t ftime;
@@ -451,15 +454,8 @@ do_filsys()
        strtrim(type);
        if (!strcmp(type, "NFS") || !strcmp(type, "RVD")) {
            if (mach = hash_lookup(machines, id)) {
-               for (p = machbuf; *mach && *mach != '.'; mach++) {
-                   if (isupper(*mach))
-                     *p++ = tolower(*mach);
-                   else
-                     *p++ = *mach;
-               }
-               *p = 0;
                fprintf(out, "%s.filsys\tHS %s \"%s %s %s %s %s\"\n",
-                       strtrim(name), HTYPE, type, strtrim(loc), machbuf,
+                       strtrim(name), HTYPE, type, strtrim(loc), mach,
                        strtrim(access), strtrim(mount));
            }
        } else if (!strcmp(type, "AFS")) {
@@ -494,15 +490,8 @@ do_filsys()
            strtrim(type);
            if (!strcmp(type, "NFS") || !strcmp(type, "RVD")) {
                if (mach = hash_lookup(machines, id)) {
-                   for (p = machbuf; *mach && *mach != '.'; mach++) {
-                       if (isupper(*mach))
-                         *p++ = tolower(*mach);
-                       else
-                         *p++ = *mach;
-                   }
-                   *p = 0;
                    fprintf(out, "%s.filsys\tHS %s \"%s %s %s %s %s\"\n",
-                           group, HTYPE, type, strtrim(loc), machbuf,
+                           group, HTYPE, type, strtrim(loc), mach,
                            strtrim(access), strtrim(mount));
                }
            } else if (!strcmp(type, "AFS")) {
This page took 0.038838 seconds and 4 git commands to generate.