void phase1(void)
{
EXEC SQL BEGIN DECLARE SECTION;
- char name[81], name1[81], last[17], first[17], buf[257];
- int id, id1, id2, id3, aid, aid2, status;
- int sid, sid2, sid3, sid4, sid5;
+ int id;
EXEC SQL END DECLARE SECTION;
int i, q, retval, tmp;
struct save_queue *sq;
q = 0;
while (1)
{
+ EXEC SQL BEGIN DECLARE SECTION;
+ int id1, id2;
+ EXEC SQL END DECLARE SECTION;
+
EXEC SQL FETCH csr116 INTO :id1, :id2;
if (sqlca.sqlcode)
break;
q = 0;
while (1)
{
+ EXEC SQL BEGIN DECLARE SECTION;
+ int id;
+ char buf[STRINGS_STRING_SIZE];
+ EXEC SQL END DECLARE SECTION;
+
EXEC SQL FETCH csr101 INTO :id, :buf;
if (sqlca.sqlcode)
break;
EXEC SQL OPEN csr102;
while (1)
{
- EXEC SQL FETCH csr102 INTO :id, :name, :last, :first, :status,
- :buf, :id2, :id3, :sid, :sid2, :sid3, :sid4, :sid5;
+ EXEC SQL BEGIN DECLARE SECTION;
+ 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 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;
if (sqlca.sqlcode)
break;
u = malloc(sizeof(struct user));
if (!u)
out_of_mem("storing users");
- strcpy(u->login, strtrim(name));
- u->potype = buf[0];
- sprintf(buf, "%s, %s", strtrim(last), strtrim(first));
- u->fullname = strdup(buf);
+ strcpy(u->login, strtrim(login));
+ u->potype = potype[0];
+ sprintf(nbuf, "%s, %s", strtrim(last), strtrim(first));
+ u->fullname = strdup(nbuf);
u->status = status;
- u->users_id = id;
- u->modby = sid;
- u->fmodby = sid2;
- u->pmodby = sid3;
- u->comment = sid4;
- u->sigwho = sid5;
+ u->users_id = users_id;
+ u->modby = modby;
+ u->fmodby = fmodby;
+ u->pmodby = pmodby;
+ u->comment = comments;
+ u->sigwho = sigwho;
switch (u->potype)
{
case 'P':
- u->pobox_id = id2;
+ u->pobox_id = pop_id;
break;
case 'S':
/* If potype is SMTP, box_id is a string_id for the strings tbl */
- u->pobox_id = id3;
+ u->pobox_id = box_id;
break;
default:
u->pobox_id = 0;
}
- retval = hash_store(users, id, u);
+ retval = hash_store(users, users_id, u);
if (retval == -1)
out_of_mem("storing users in hash table");
else if (retval == 1)
{
- sq_save_data(sq, hash_lookup(users, id));
+ sq_save_data(sq, hash_lookup(users, users_id));
sq_save_data(sq, u);
}
}
EXEC SQL OPEN csr104;
while (1)
{
- EXEC SQL FETCH csr104 INTO :id, :name, :id2, :buf, :id3, :sid2,
- :sid3, :sid4, :sid;
+ EXEC SQL BEGIN DECLARE SECTION;
+ int mach_id, snet_id, owner_id, acomment, ocomment, creator, modby;
+ char name[MACHINE_NAME_SIZE], owner_type[MACHINE_OWNER_TYPE_SIZE];
+ EXEC SQL END DECLARE SECTION;
+
+ EXEC SQL FETCH csr104 INTO :mach_id, :name, :snet_id,
+ :owner_type, :owner_id, :acomment, :ocomment, :creator, :modby;
if (sqlca.sqlcode)
break;
if (!m)
out_of_mem("storing machines");
strcpy(m->name, strtrim(name));
- m->owner_type = buf[0];
- m->owner_id = id3;
- m->snet_id = id2;
- m->mach_id = id;
+ m->owner_type = owner_type[0];
+ m->owner_id = owner_id;
+ m->snet_id = snet_id;
+ m->mach_id = mach_id;
m->clucount = 0;
- m->acomment = sid2;
- m->ocomment = sid3;
- m->creator = sid4;
- m->modby = sid;
- retval = hash_store(machines, id, m);
+ m->acomment = acomment;
+ m->ocomment = ocomment;
+ m->creator = creator;
+ m->modby = modby;
+ retval = hash_store(machines, mach_id, m);
if (retval == -1)
out_of_mem("storing machines in hash table");
else if (retval == 1)
{
- sq_save_data(sq, hash_lookup(machines, id));
+ sq_save_data(sq, hash_lookup(machines, mach_id));
sq_save_data(sq, m);
}
}
if (!fast)
{
+ EXEC SQL BEGIN DECLARE SECTION;
+ char name[HOSTALIAS_NAME_SIZE];
+ int id1, id2;
+ EXEC SQL END DECLARE SECTION;
+
sq = sq_create();
if (!sq)
out_of_mem("looking for duplicate machine names");
EXEC SQL OPEN csr115;
while (1)
{
- EXEC SQL FETCH csr115 INTO :id, :name, :buf, :id2, :sid;
+ EXEC SQL BEGIN DECLARE SECTION;
+ char name[SUBNET_NAME_SIZE], owner_type[SUBNET_OWNER_TYPE_SIZE];
+ int snet_id, owner_id, modby;
+ EXEC SQL END DECLARE SECTION;
+
+ EXEC SQL FETCH csr115 INTO :snet_id, :name, :owner_type,
+ :owner_id, :modby;
if (sqlca.sqlcode)
break;
if (!sn)
out_of_mem("storing subnets");
strcpy(sn->name, strtrim(name));
- sn->owner_type = buf[0];
- sn->owner_id = id2;
- sn->snet_id = id;
- sn->modby = sid;
- retval = hash_store(subnets, id, sn);
+ sn->owner_type = owner_type[0];
+ sn->owner_id = owner_id;
+ sn->snet_id = snet_id;
+ sn->modby = modby;
+ retval = hash_store(subnets, snet_id, sn);
if (retval == -1)
out_of_mem("storing subnets in hash table");
else if (retval == 1)
EXEC SQL OPEN csr106;
while (1)
{
- EXEC SQL FETCH csr106 INTO :id, :name, :sid;
+ EXEC SQL BEGIN DECLARE SECTION;
+ int clu_id, modby;
+ char name[CLUSTERS_NAME_SIZE];
+ EXEC SQL END DECLARE SECTION;
+
+ EXEC SQL FETCH csr106 INTO :clu_id, :name, :modby;
if (sqlca.sqlcode)
break;
if (!c)
out_of_mem("storing clusters");
strcpy(c->name, strtrim(name));
- c->clu_id = id;
- c->modby = sid;
- retval = hash_store(clusters, id, c);
+ c->clu_id = clu_id;
+ c->modby = modby;
+ retval = hash_store(clusters, clu_id, c);
if (retval == -1)
out_of_mem("storing clusters in hash table");
else if (retval == 1)
{
- sq_save_data(sq, hash_lookup(clusters, id));
+ sq_save_data(sq, hash_lookup(clusters, clu_id));
sq_save_data(sq, c);
}
}
EXEC SQL OPEN csr108;
while (1)
{
- EXEC SQL FETCH csr108 INTO :id, :name, :aid, :buf, :sid;
+ EXEC SQL BEGIN DECLARE SECTION;
+ int list_id, acl_id, modby;
+ char name[LIST_NAME_SIZE], acl_type[LIST_ACL_TYPE_SIZE];
+ EXEC SQL END DECLARE SECTION;
+
+ EXEC SQL FETCH csr108 INTO :list_id, :name, :acl_id, :acl_type, :modby;
if (sqlca.sqlcode)
break;
l = malloc(sizeof(struct list));
if (!l)
out_of_mem("storing lists");
strcpy(l->name, strtrim(name));
- l->acl_type = buf[0];
- l->acl_id = aid;
- l->list_id = id;
+ l->acl_type = acl_type[0];
+ l->acl_id = acl_id;
+ l->list_id = list_id;
+ l->modby = modby;
l->members = 0;
- retval = hash_store(lists, id, l);
+ retval = hash_store(lists, list_id, l);
if (retval == -1)
out_of_mem("storing lists in hash table");
else if (retval == 1)
{
- sq_save_data(sq, hash_lookup(lists, id));
+ sq_save_data(sq, hash_lookup(lists, list_id));
sq_save_data(sq, l);
}
}
EXEC SQL OPEN csr110;
while (1)
{
- EXEC SQL FETCH csr110 INTO :id, :name, :aid, :aid2, :id2, :id3,
- :buf, :name1, :sid;
+ EXEC SQL BEGIN DECLARE SECTION;
+ int filsys_id, owner, owners, phys_id, mach_id, modby;
+ char label[FILESYS_LABEL_SIZE], type[FILESYS_TYPE_SIZE];
+ char name[FILESYS_NAME_SIZE];
+ EXEC SQL END DECLARE SECTION;
+
+ EXEC SQL FETCH csr110 INTO :filsys_id, :label, :owner, :owners,
+ :phys_id, :mach_id, :type, :name, :modby;
if (sqlca.sqlcode)
break;
f = malloc(sizeof(struct filesys));
if (!f)
out_of_mem("storing filesystems");
- strcpy(f->name, strtrim(name));
- strcpy(f->dir, strtrim(name1));
- f->filsys_id = id;
- f->owner = aid;
- f->owners = aid2;
- f->phys_id = id2;
- f->mach_id = id3;
- f->type = buf[0];
- retval = hash_store(filesys, id, f);
+ strcpy(f->name, strtrim(label));
+ strcpy(f->dir, strtrim(name));
+ f->filsys_id = filsys_id;
+ f->owner = owner;
+ f->owners = owners;
+ f->phys_id = phys_id;
+ f->mach_id = mach_id;
+ f->type = type[0];
+ retval = hash_store(filesys, filsys_id, f);
if (retval == -1)
out_of_mem("storing filesys in hash table");
else if (retval == 1)
{
- sq_save_data(sq, hash_lookup(filesys, id));
+ sq_save_data(sq, hash_lookup(filesys, filsys_id));
sq_save_data(sq, f);
}
}
EXEC SQL OPEN csr111;
while (1)
{
- EXEC SQL FETCH csr111 INTO :id, :name, :id2, :id3, :sid;
+ EXEC SQL BEGIN DECLARE SECTION;
+ int nfsphys_id, mach_id, allocated, modby;
+ char dir[NFSPHYS_DIR_SIZE];
+ EXEC SQL END DECLARE SECTION;
+
+ EXEC SQL FETCH csr111 INTO :nfsphys_id, :dir, :mach_id,
+ :allocated, :modby;
if (sqlca.sqlcode)
break;
n = malloc(sizeof(struct nfsphys));
if (!n)
out_of_mem("storing nfsphys");
- strcpy(n->dir, strtrim(name));
- n->mach_id = id2;
- n->nfsphys_id = id;
- n->allocated = id3;
+ strcpy(n->dir, strtrim(dir));
+ n->mach_id = mach_id;
+ n->nfsphys_id = nfsphys_id;
+ n->allocated = allocated;
+ n->modby = modby;
n->count = 0;
- retval = hash_store(nfsphys, id, n);
+ retval = hash_store(nfsphys, nfsphys_id, n);
if (retval == -1)
out_of_mem("storing nfsphys in hash table");
else if (retval == 1)
{
- sq_save_data(sq, hash_lookup(nfsphys, id));
+ sq_save_data(sq, hash_lookup(nfsphys, nfsphys_id));
sq_save_data(sq, n);
}
}
EXEC SQL OPEN csr119;
while (1)
{
+ EXEC SQL BEGIN DECLARE SECTION;
+ char name[PRINTCAP_NAME_SIZE];
+ EXEC SQL END DECLARE SECTION;
+
EXEC SQL FETCH csr119 INTO :name;
if (sqlca.sqlcode)
break;
{
EXEC SQL BEGIN DECLARE SECTION;
int iid = (int)id, found = 1;
- char name[33];
+ char name[CLUSTERS_NAME_SIZE];
EXEC SQL END DECLARE SECTION;
EXEC SQL DECLARE csr201 CURSOR FOR
{
EXEC SQL BEGIN DECLARE SECTION;
int iid = (int)id, found = 1;
- char name[33];
+ char name[MACHINE_NAME_SIZE];
EXEC SQL END DECLARE SECTION;
EXEC SQL DECLARE csr202 CURSOR FOR
{
EXEC SQL BEGIN DECLARE SECTION;
int iid = (int)id, found = 1;
- char name[33];
+ char name[HOSTALIAS_NAME_SIZE];
EXEC SQL END DECLARE SECTION;
EXEC SQL DECLARE csr234 CURSOR FOR
{
EXEC SQL BEGIN DECLARE SECTION;
int iid = (int)id, found = 1;
- char name[33];
+ char name[PRINTCAP_NAME_SIZE];
EXEC SQL END DECLARE SECTION;
EXEC SQL DECLARE csr235 CURSOR FOR
{
EXEC SQL BEGIN DECLARE SECTION;
int iid = (int)id, found = 1;
- char name[33];
+ char name[PRINTCAP_NAME_SIZE];
EXEC SQL END DECLARE SECTION;
EXEC SQL DECLARE csr236 CURSOR FOR
{
EXEC SQL BEGIN DECLARE SECTION;
int iid = (int)id, found = 1;
- char label[17], data[33];
+ char label[SVC_SERV_LABEL_SIZE], data[SVC_SERV_CLUSTER_SIZE];
EXEC SQL END DECLARE SECTION;
EXEC SQL DECLARE csr203 CURSOR FOR
{
struct list *l = list;
+ l->modby = maybe_fixup_modby(l->modby, id, l->name, "list",
+ "modby", "list_id");
+
switch (l->acl_type)
{
case 'L':
{
EXEC SQL BEGIN DECLARE SECTION;
int mid, iid = (int)id, found = 1;
- char mtype[9], *name = "";
+ char mtype[IMEMBERS_MEMBER_TYPE_SIZE], *name = "";
EXEC SQL END DECLARE SECTION;
EXEC SQL DECLARE csr204 CURSOR FOR
int show_sh(void *id)
{
EXEC SQL BEGIN DECLARE SECTION;
- char name[33];
+ char name[SERVERHOSTS_SERVICE_SIZE];
int iid = (int)id;
EXEC SQL END DECLARE SECTION;
int found = 1;
{
struct nfsphys *n = nfsphys;
+ n->modby = maybe_fixup_modby(n->modby, id, n->dir, "nfsphys",
+ "modby", "nfsphys_id");
+
if (!hash_lookup(machines, n->mach_id))
{
printf("NFSphys %d(%s) on non-existant machine %d\n",
{
EXEC SQL BEGIN DECLARE SECTION;
int iid = (int)id, id1, found = 1;
- char type[9];
+ char type[QUOTA_TYPE_SIZE];
EXEC SQL END DECLARE SECTION;
EXEC SQL DECLARE csr214 CURSOR FOR
{
EXEC SQL BEGIN DECLARE SECTION;
int iid = (int)id, id1, found = 1;
- char type[9];
+ char type[QUOTA_TYPE_SIZE];
EXEC SQL END DECLARE SECTION;
struct filesys *f;
int show_srv_user(void *id)
{
EXEC SQL BEGIN DECLARE SECTION;
- char name[33];
+ char name[SERVERS_NAME_SIZE];
int iid = (int)id;
EXEC SQL END DECLARE SECTION;
int found = 1;
int show_srv_list(void *id)
{
EXEC SQL BEGIN DECLARE SECTION;
- char name[33];
+ char name[SERVERS_NAME_SIZE];
int iid = (int)id;
EXEC SQL END DECLARE SECTION;
int found = 1;
int show_pdm_mach(void *id)
{
EXEC SQL BEGIN DECLARE SECTION;
- char name[33];
+ char name[PALLADIUM_NAME_SIZE];
int iid = (int)id;
EXEC SQL END DECLARE SECTION;
int found = 1;
void phase2(void)
{
- EXEC SQL BEGIN DECLARE SECTION;
- int id1, id2, id3, id4, id5;
- char type[9], name[33];
- EXEC SQL END DECLARE SECTION;
struct save_queue *sq, *sq1, *sq2, *sq3, *sq4, *sq5;
struct filesys *f;
struct list *l;
EXEC SQL OPEN csr221;
while (1)
{
- EXEC SQL FETCH csr221 INTO :id1, :id2;
+ EXEC SQL BEGIN DECLARE SECTION;
+ int mach_id, clu_id;
+ EXEC SQL END DECLARE SECTION;
+
+ EXEC SQL FETCH csr221 INTO :mach_id, :clu_id;
if (sqlca.sqlcode)
break;
- if (!(m = hash_lookup(machines, id1)))
- sq_save_unique_data(sq1, (void *)id1);
- else if (!hash_lookup(clusters, id2))
- sq_save_unique_data(sq2, (void *)id2);
+ if (!(m = hash_lookup(machines, mach_id)))
+ sq_save_unique_data(sq1, (void *)mach_id);
+ else if (!hash_lookup(clusters, clu_id))
+ sq_save_unique_data(sq2, (void *)clu_id);
if (m)
m->clucount++;
}
EXEC SQL OPEN csr222;
while (1)
{
- EXEC SQL FETCH csr222 INTO :id1;
+ EXEC SQL BEGIN DECLARE SECTION;
+ int clu_id;
+ EXEC SQL END DECLARE SECTION;
+
+ EXEC SQL FETCH csr222 INTO :clu_id;
if (sqlca.sqlcode)
break;
- if (!hash_lookup(clusters, id1))
- sq_save_unique_data(sq1, (void *)id1);
+ if (!hash_lookup(clusters, clu_id))
+ sq_save_unique_data(sq1, (void *)clu_id);
}
EXEC SQL CLOSE csr222;
generic_delete(sq1, show_svc, "svc", "clu_id", 1);
EXEC SQL OPEN csr223;
while (1)
{
- EXEC SQL FETCH csr223 INTO :id1, :type, :id2, :id3, :id4;
+ EXEC SQL BEGIN DECLARE SECTION;
+ int list_id, id, ref_count, direct;
+ char type[IMEMBERS_MEMBER_TYPE_SIZE];
+ EXEC SQL END DECLARE SECTION;
+
+ EXEC SQL FETCH csr223 INTO :list_id, :type, :id,
+ :ref_count, :direct;
if (sqlca.sqlcode)
break;
- if (!(l = hash_lookup(lists, id1)))
- sq_save_unique_data(sq1, (void *)id1);
- else if (type[0] == 'U' && !hash_lookup(users, id2))
- sq_save_unique_data(sq2, (void *)id2);
- else if (type[0] == 'L' && !hash_lookup(lists, id2))
- sq_save_unique_data(sq3, (void *)id2);
- else if (type[0] == 'S' && !maybe_fixup_unref_string2("imembers", "member_id", "csr223", id2))
- sq_save_unique_data(sq4, (void *)id2);
- else if (type[0] == 'K' && !maybe_fixup_unref_string2("imembers", "member_id", "csr223", id2))
- sq_save_unique_data(sq5, (void *)id2);
+ if (!(l = hash_lookup(lists, list_id)))
+ sq_save_unique_data(sq1, (void *)list_id);
+ else if (type[0] == 'U' && !hash_lookup(users, id))
+ sq_save_unique_data(sq2, (void *)id);
+ else if (type[0] == 'L' && !hash_lookup(lists, id))
+ sq_save_unique_data(sq3, (void *)id);
+ else if (type[0] == 'S' && !maybe_fixup_unref_string2("imembers", "member_id", "csr223", id))
+ sq_save_unique_data(sq4, (void *)id);
+ else if (type[0] == 'K' && !maybe_fixup_unref_string2("imembers", "member_id", "csr223", id))
+ sq_save_unique_data(sq5, (void *)id);
else
l->members++;
}
EXEC SQL OPEN csr224;
while (1)
{
- EXEC SQL FETCH csr224 INTO :name, :type, :id1, :id2;
+ EXEC SQL BEGIN DECLARE SECTION;
+ int acl_id, modby;
+ char name[SERVERS_NAME_SIZE], acl_type[SERVERS_ACL_TYPE_SIZE];
+ EXEC SQL END DECLARE SECTION;
+
+ EXEC SQL FETCH csr224 INTO :name, :acl_type, :acl_id, :modby;
if (sqlca.sqlcode)
break;
- maybe_fixup_modby2("servers", "modby", "csr224", id2);
- strtrim(type);
- if (!strcmp(type, "USER") && !hash_lookup(users, id1))
- sq_save_data(sq1, (void *)id1);
- else if (!strcmp(type, "LIST") && !hash_lookup(lists, id1))
- sq_save_data(sq2, (void *)id1);
+ maybe_fixup_modby2("servers", "modby", "csr224", modby);
+ strtrim(acl_type);
+ if (!strcmp(acl_type, "USER") && !hash_lookup(users, acl_id))
+ sq_save_data(sq1, (void *)acl_id);
+ else if (!strcmp(acl_type, "LIST") && !hash_lookup(lists, acl_id))
+ sq_save_data(sq2, (void *)acl_id);
}
EXEC SQL CLOSE csr224;
generic_fix(sq1, show_srv_user, "Fix", zero_srv_user, 1);
EXEC SQL OPEN csr225;
while (1)
{
- EXEC SQL FETCH csr225 INTO :id1, :id2;
+ EXEC SQL BEGIN DECLARE SECTION;
+ int mach_id, modby;
+ EXEC SQL END DECLARE SECTION;
+
+ EXEC SQL FETCH csr225 INTO :mach_id, :modby;
if (sqlca.sqlcode)
break;
- maybe_fixup_modby2("serverhosts", "modby", "csr225", id2);
- if (!hash_lookup(machines, id1))
- sq_save_data(sq, (void *)id1);
+ maybe_fixup_modby2("serverhosts", "modby", "csr225", modby);
+ if (!hash_lookup(machines, mach_id))
+ sq_save_data(sq, (void *)mach_id);
}
EXEC SQL CLOSE csr225;
generic_fix(sq, show_sh, "Delete", del_sh_mach, 0);
EXEC SQL OPEN csr226;
while (1)
{
- EXEC SQL FETCH csr226 INTO :id1, :id2;
+ EXEC SQL BEGIN DECLARE SECTION;
+ int group_id, filsys_id;
+ EXEC SQL END DECLARE SECTION;
+
+ EXEC SQL FETCH csr226 INTO :group_id, :filsys_id;
if (sqlca.sqlcode)
break;
- if (!(f = hash_lookup(filesys, id1)))
- sq_save_data(sq1, (void *)id1);
- if (!hash_lookup(filesys, id2))
- sq_save_data(sq3, (void *)id2);
+ if (!(f = hash_lookup(filesys, group_id)))
+ sq_save_data(sq1, (void *)group_id);
+ if (!hash_lookup(filesys, filsys_id))
+ sq_save_data(sq3, (void *)filsys_id);
}
EXEC SQL CLOSE csr226;
generic_delete(sq1, show_fsg_missing, "fsgroup", "group_id", 0);
EXEC SQL OPEN csr227;
while (1)
{
- EXEC SQL FETCH csr227 INTO :id1, :type, :id2, :id3, :id4, :id5;
+ EXEC SQL BEGIN DECLARE SECTION;
+ int entity_id, filsys_id, phys_id, quota, modby;
+ char type[QUOTA_TYPE_SIZE];
+ EXEC SQL END DECLARE SECTION;
+
+ EXEC SQL FETCH csr227 INTO :entity_id, :type, :filsys_id,
+ :phys_id, :quota, :modby;
if (sqlca.sqlcode)
break;
- maybe_fixup_modby2("quota", "modby", "csr227", id5);
- if (type[0] == 'U' && id1 != 0 && !hash_lookup(users, id1))
- sq_save_data(sq1, (void *)id1);
- else if (type[0] == 'G' && !hash_lookup(lists, id1))
- sq_save_data(sq4, (void *)id1);
- else if (!(f = hash_lookup(filesys, id2)))
- sq_save_data(sq2, (void *)id2);
- else if (id3 != f->phys_id || !(n = hash_lookup(nfsphys, id3)))
- sq_save_data(sq3, (void *)id2);
+ maybe_fixup_modby2("quota", "modby", "csr227", modby);
+ if (type[0] == 'U' && entity_id != 0 && !hash_lookup(users, entity_id))
+ sq_save_data(sq1, (void *)entity_id);
+ else if (type[0] == 'G' && !hash_lookup(lists, entity_id))
+ sq_save_data(sq4, (void *)entity_id);
+ else if (!(f = hash_lookup(filesys, filsys_id)))
+ sq_save_data(sq2, (void *)filsys_id);
+ else if (phys_id != f->phys_id || !(n = hash_lookup(nfsphys, phys_id)))
+ sq_save_data(sq3, (void *)phys_id);
else
- n->count += id4;
+ n->count += quota;
}
EXEC SQL CLOSE csr227;
generic_fix(sq1, show_quota_nouser, "Delete", fix_quota_nouser, 1);
EXEC SQL OPEN csr228;
while (1)
{
- EXEC SQL FETCH csr228 INTO :id1, :type, :id2, :id3;
+ EXEC SQL BEGIN DECLARE SECTION;
+ int mach_id, acl_id, modby;
+ char acl_type[HOSTACCESS_ACL_TYPE_SIZE];
+ EXEC SQL END DECLARE SECTION;
+
+ EXEC SQL FETCH csr228 INTO :mach_id, :acl_type, :acl_id, :modby;
if (sqlca.sqlcode)
break;
- maybe_fixup_modby2("hostaccess", "modby", "csr228", id3);
- strtrim(type);
- if (!hash_lookup(machines, id1))
+ maybe_fixup_modby2("hostaccess", "modby", "csr228", modby);
+ strtrim(acl_type);
+ if (!hash_lookup(machines, mach_id))
{
- printf("Hostaccess for non-existant host %d\n", id1);
+ printf("Hostaccess for non-existant host %d\n", mach_id);
printf("Not fixing this error\n");
}
- if (!strcmp(type, "USER") && !hash_lookup(users, id2))
+ if (!strcmp(acl_type, "USER") && !hash_lookup(users, acl_id))
{
- printf("Hostaccess for %d is non-existant user %d\n", id1, id2);
+ printf("Hostaccess for %d is non-existant user %d\n", mach_id, acl_id);
printf("Not fixing this error\n");
}
- else if (!strcmp(type, "LIST") && !hash_lookup(lists, id2))
+ else if (!strcmp(acl_type, "LIST") && !hash_lookup(lists, acl_id))
{
- printf("Hostaccess for %d is non-existant list %d\n", id1, id2);
+ printf("Hostaccess for %d is non-existant list %d\n", mach_id, acl_id);
printf("Not fixing this error\n");
}
}
EXEC SQL OPEN csr229;
while (1)
{
- EXEC SQL FETCH csr229 INTO :id1, :id2;
+ EXEC SQL BEGIN DECLARE SECTION;
+ int mach_id, modby;
+ EXEC SQL END DECLARE SECTION;
+
+ EXEC SQL FETCH csr229 INTO :mach_id, :modby;
if (sqlca.sqlcode)
break;
- maybe_fixup_modby2("palladium", "modby", "csr229", id2);
- if (!hash_lookup(machines, id1))
- sq_save_unique_data(sq1, (void *)id1);
+ maybe_fixup_modby2("palladium", "modby", "csr229", modby);
+ if (!hash_lookup(machines, mach_id))
+ sq_save_unique_data(sq1, (void *)mach_id);
}
EXEC SQL CLOSE csr229;
generic_delete(sq1, show_pdm_mach, "palladium", "mach_id", 1);
EXEC SQL OPEN csr230;
while (1)
{
- EXEC SQL FETCH csr230 INTO :id1, :id2;
+ EXEC SQL BEGIN DECLARE SECTION;
+ int users_id, string_id;
+ EXEC SQL END DECLARE SECTION;
+
+ EXEC SQL FETCH csr230 INTO :users_id, :string_id;
if (sqlca.sqlcode)
break;
- if (!hash_lookup(users, id1))
- sq_save_unique_data(sq1, (void *)id1);
- else if (!maybe_fixup_unref_string2("krbmap", "string_id", "csr230", id2))
- sq_save_unique_data(sq2, (void *)id2);
+ if (!hash_lookup(users, users_id))
+ sq_save_unique_data(sq1, (void *)users_id);
+ else if (!maybe_fixup_unref_string2("krbmap", "string_id", "csr230", string_id))
+ sq_save_unique_data(sq2, (void *)string_id);
}
EXEC SQL CLOSE csr230;
generic_delete(sq1, show_krb_usr, "krbmap", "users_id", 1);
EXEC SQL OPEN csr231;
while (1)
{
- EXEC SQL FETCH csr231 INTO :id1, :name;
+ EXEC SQL BEGIN DECLARE SECTION;
+ int list_id;
+ char tag[CAPACLS_TAG_SIZE];
+ EXEC SQL END DECLARE SECTION;
+
+ EXEC SQL FETCH csr231 INTO :list_id, :tag;
if (sqlca.sqlcode)
break;
- if (!hash_lookup(lists, id1))
+ if (!hash_lookup(lists, list_id))
{
- printf("Capacl for %s is non-existant list %d\n", name, id1);
+ printf("Capacl for %s is non-existant list %d\n", tag, list_id);
printf("Not fixing this error\n");
}
}
EXEC SQL OPEN csr232;
while (1)
{
- EXEC SQL FETCH csr232 INTO :id1;
+ EXEC SQL BEGIN DECLARE SECTION;
+ int mach_id;
+ EXEC SQL END DECLARE SECTION;
+
+ EXEC SQL FETCH csr232 INTO :mach_id;
if (sqlca.sqlcode)
break;
- if (!hash_lookup(machines, id1))
- sq_save_unique_data(sq1, (void *)id1);
+ if (!hash_lookup(machines, mach_id))
+ sq_save_unique_data(sq1, (void *)mach_id);
}
EXEC SQL CLOSE csr232;
generic_delete(sq1, show_hostalias, "hostalias", "mach_id", 1);
EXEC SQL OPEN csr233;
while (1)
{
- EXEC SQL FETCH csr233 INTO :id1, :id2, :id3;
+ EXEC SQL BEGIN DECLARE SECTION;
+ int mach_id, quotaserver, modby;
+ EXEC SQL END DECLARE SECTION;
+
+ EXEC SQL FETCH csr233 INTO :mach_id, :quotaserver, :modby;
if (sqlca.sqlcode)
break;
- maybe_fixup_modby2("printcap", "modby", "csr233", id3);
- if (!hash_lookup(machines, id1))
- sq_save_unique_data(sq1, (void *)id1);
- else if (!hash_lookup(machines, id2))
- sq_save_unique_data(sq2, (void *)id2);
+ maybe_fixup_modby2("printcap", "modby", "csr233", modby);
+ if (!hash_lookup(machines, mach_id))
+ sq_save_unique_data(sq1, (void *)mach_id);
+ else if (!hash_lookup(machines, quotaserver))
+ sq_save_unique_data(sq2, (void *)quotaserver);
}
EXEC SQL CLOSE csr233;
generic_delete(sq1, show_pcap_mach, "printcap", "mach_id", 1);