struct string *s;
struct filesys *f;
struct nfsphys *n;
+ struct printserver *ps;
printf("Phase 1 - Looking for duplicates\n");
EXEC SQL DECLARE csr102 CURSOR FOR
SELECT users_id, login, last, first, status, potype, pop_id, box_id,
- modby, fmodby, pmodby, comments, sigwho FROM users
+ imap_id, modby, fmodby, pmodby, comments, sigwho FROM users
ORDER BY users_id;
EXEC SQL OPEN csr102;
while (1)
char login[USERS_LOGIN_SIZE], nbuf[USERS_FIRST_SIZE + USERS_LAST_SIZE];
char last[USERS_LAST_SIZE], first[USERS_FIRST_SIZE];
char potype[USERS_POTYPE_SIZE];
- int users_id, status, pop_id, box_id, modby, fmodby, pmodby;
+ int users_id, status, pop_id, box_id, imap_id, modby, fmodby, pmodby;
int comments, sigwho;
EXEC SQL END DECLARE SECTION;
EXEC SQL FETCH csr102 INTO :users_id, :login, :last, :first,
- :status, :potype, :pop_id, :box_id, :modby, :fmodby, :pmodby,
- :comments, :sigwho;
+ :status, :potype, :pop_id, :box_id, :imap_id, :modby, :fmodby,
+ :pmodby, :comments, :sigwho;
if (sqlca.sqlcode)
break;
/* If potype is SMTP, box_id is a string_id for the strings tbl */
u->pobox_id = box_id;
break;
+ case 'I':
+ u->pobox_id = imap_id;
+ break;
default:
u->pobox_id = 0;
}
out_of_mem("loading lists");
EXEC SQL DECLARE csr108 CURSOR FOR
- SELECT list_id, name, acl_id, acl_type, modby FROM list
+ SELECT list_id, name, acl_id, acl_type, memacl_id, memacl_type, modby
+ FROM list
ORDER BY list_id;
EXEC SQL OPEN csr108;
while (1)
{
EXEC SQL BEGIN DECLARE SECTION;
- int list_id, acl_id, modby;
+ int list_id, acl_id, memacl_id, modby;
char name[LIST_NAME_SIZE], acl_type[LIST_ACL_TYPE_SIZE];
+ char memacl_type[LIST_ACL_TYPE_SIZE];
EXEC SQL END DECLARE SECTION;
- EXEC SQL FETCH csr108 INTO :list_id, :name, :acl_id, :acl_type, :modby;
+ EXEC SQL FETCH csr108 INTO :list_id, :name, :acl_id, :acl_type,
+ :memacl_id, :memacl_type, :modby;
if (sqlca.sqlcode)
break;
l = malloc(sizeof(struct list));
strcpy(l->name, strtrim(name));
l->acl_type = acl_type[0];
l->acl_id = acl_id;
+ l->memacl_type = memacl_type[0];
+ l->memacl_id = memacl_id;
l->list_id = list_id;
l->modby = modby;
l->members = 0;
}
EXEC SQL CLOSE csr119;
}
+
+ dprintf("Loading printservers...\n");
+ printservers = create_hash(100);
+ if (!printservers)
+ out_of_mem("loading printservers");
+
+ EXEC SQL DECLARE csr_ps CURSOR FOR
+ SELECT mach_id, printer_types, owner_type, owner_id, lpc_acl, modby
+ FROM printservers;
+ EXEC SQL OPEN csr_ps;
+ while (1)
+ {
+ EXEC SQL BEGIN DECLARE SECTION;
+ int mach_id, printer_types, owner_id, lpc_acl, modby;
+ char owner_type[PRINTSERVERS_OWNER_TYPE_SIZE];
+ EXEC SQL END DECLARE SECTION;
+
+ EXEC SQL FETCH csr_ps INTO :mach_id, :printer_types, :owner_type,
+ :owner_id, :lpc_acl, :modby;
+ if (sqlca.sqlcode)
+ break;
+
+ ps = malloc(sizeof(struct printserver));
+ if (!ps)
+ out_of_mem("storing printserver");
+ ps->mach_id = mach_id;
+ ps->printer_types = printer_types;
+ ps->owner_type = owner_type[0];
+ ps->owner_id = owner_id;
+ ps->lpc_acl = lpc_acl;
+ ps->modby = modby;
+ retval = hash_store(printservers, mach_id, ps);
+ if (retval == -1)
+ out_of_mem("storing printserver in hash table");
+ else if (retval == 1)
+ {
+ printf("Duplicate printserver mach_id %d\n", mach_id);
+ cant_fix(0);
+ }
+ }
+ EXEC SQL CLOSE csr_ps;
+
+ if (!fast)
+ {
+ dprintf("Checking zephyr...\n");
+
+ EXEC SQL DECLARE csr120 CURSOR FOR
+ SELECT z1.class FROM zephyr z1, zephyr z2
+ WHERE (z1.class = z2.class AND z1.rowid < z1.rowid);
+ EXEC SQL OPEN csr120;
+ while (1)
+ {
+ EXEC SQL BEGIN DECLARE SECTION;
+ char class[ZEPHYR_CLASS_SIZE];
+ EXEC SQL END DECLARE SECTION;
+
+ EXEC SQL FETCH csr120 INTO :class;
+ if (sqlca.sqlcode)
+ break;
+
+ printf("Zephyr class %s has duplicate name\n", class);
+ cant_fix(0);
+ }
+ EXEC SQL CLOSE csr120;
+ }
}