]> andersk Git - moira.git/blobdiff - dbck/phase2.pc
check that imap poboxes exist, and are of type IMAP. Do nfsphys checks
[moira.git] / dbck / phase2.pc
index da78b03c94c5479944216e0be185d74683c1dd2e..89982100b2a18a6dbda05334d03bc1a556519812 100644 (file)
@@ -530,6 +530,8 @@ int maybe_fixup_modby2(char *table, char *field, char *rowid, int id)
 
 void pobox_check(int id, struct user *u)
 {
+  struct filesys *fs;
+
   switch (u->potype)
     {
     case 'P':
@@ -544,6 +546,7 @@ void pobox_check(int id, struct user *u)
            }
        }
       break;
+
     case 'S':
       if (hash_lookup(string_dups, u->pobox_id))
        {
@@ -570,6 +573,31 @@ void pobox_check(int id, struct user *u)
            }
        }
       break;
+
+    case 'I':
+      fs = hash_lookup(filesys, u->pobox_id);
+      if (!fs)
+       {
+         printf("User %s(%s) has P.O.Box on non-existant filesystem %d\n",
+                u->login, u->fullname, u->pobox_id);
+         if (single_fix("Delete", 0))
+           {
+             remove_pobox(u->users_id);
+             u->potype = 'N';
+           }
+       }
+      else if (fs->type != 'I')
+       {
+         printf("User %s(%s) has IMAP P.O.Box on non-IMAP filesystem %s\n",
+                u->login, u->fullname, fs->name);
+         if (single_fix("Delete", 0))
+           {
+             remove_pobox(u->users_id);
+             u->potype = 'N';
+           }
+       }
+      break;
+
     default:
       ;
     }
@@ -1162,7 +1190,7 @@ void check_fs(int id, void *filesys, void *hint)
        }
     }
 
-  if (f->type == 'N')
+  if (f->type == 'N' || f->type == 'I')
     {
       if (!hash_lookup(nfsphys, f->phys_id))
        {
This page took 0.060136 seconds and 4 git commands to generate.