int id = uu->users_id, rowcount;
EXEC SQL END DECLARE SECTION;
-/* replace users (login = "#"+text(users.uid), status = 0)
- * where users.users_id = id */
EXEC SQL UPDATE users SET login = '#'+CHAR(users.uid),
status=0 WHERE users_id = :id;
EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
EXEC SQL OPEN csr101;
while(1) {
EXEC SQL FETCH csr101 INTO :id, :buf;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
s = (struct string *) malloc(sizeof(struct string));
if (s == NULL)
while(1) {
EXEC SQL FETCH csr102 INTO :id, :name, :last, :first, :status,
:buf, :id2, :id3, :sid, :sid2, :sid3, :sid4, :sid5;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
u = (struct user *) malloc(sizeof(struct user));
if (u == NULL)
EXEC SQL OPEN csr103;
while(1) {
EXEC SQL FETCH csr103 INTO :id;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
sq_save_data(sq, hash_lookup(users, id));
}
EXEC SQL CLOSE csr103;
EXEC SQL OPEN csr104;
while(1) {
EXEC SQL FETCH csr104 INTO :id, :name, :sid;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
m = (struct machine *) malloc(sizeof(struct machine));
if (m == NULL)
EXEC SQL OPEN csr105;
while(1) {
EXEC SQL FETCH csr105 INTO :id;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
sq_save_data(sq, hash_lookup(machines, id));
}
EXEC SQL OPEN csr106;
while(1) {
EXEC SQL FETCH csr106 INTO :id, :name, :sid;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
c = (struct cluster *) malloc(sizeof(struct cluster));
if (c == NULL)
sq = sq_create();
EXEC SQL DECLARE csr107 CURSOR FOR
- SELECT clu_id FROM cluster c1, cluster c2
+ SELECT c1.clu_id FROM cluster c1, cluster c2
WHERE c1.name=c2.name AND c1.tid != c2.tid;
EXEC SQL OPEN csr107;
while(1) {
EXEC SQL FETCH csr107 INTO :id;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
sq_save_data(sq, hash_lookup(clusters, id));
}
EXEC SQL OPEN csr108;
while(1) {
EXEC SQL FETCH csr108 INTO :id, :name, :aid, :buf, :sid;
- if (sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
l = (struct list *) malloc(sizeof(struct list));
if (l == NULL)
out_of_mem("storing lists");
sq = sq_create();
EXEC SQL DECLARE csr109 CURSOR FOR
- SELECT list_id FROM list l1, list l2
+ SELECT l1.list_id FROM list l1, list l2
WHERE l1.name=l2.name AND l1.tid != l2.tid;
EXEC SQL OPEN csr109;
while(1) {
EXEC SQL FETCH csr109 INTO :id;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
sq_save_data(sq, hash_lookup(lists, id));
}
while(1) {
EXEC SQL FETCH csr110 INTO :id, :name, :aid, :aid2, :id2, :id3,
:buf, :name1, :sid;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
f = (struct filesys *) malloc(sizeof(struct filesys));
if (f == NULL)
EXEC SQL OPEN csr111;
while(1) {
EXEC SQL FETCH csr111 INTO :id, :name, :id2, :id3, :sid;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
n = (struct nfsphys *) malloc(sizeof(struct nfsphys));
if (n == NULL)
EXEC SQL OPEN csr112;
while(1) {
EXEC SQL FETCH csr112 INTO :id, :buf;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
printf("String %s(%d) is a duplicate!\n", strtrim(buf), id);
printf("Not fixing this error\n");
EXEC SQL OPEN csr113;
while(1) {
EXEC SQL FETCH csr113 INTO :id;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
printf("User %d is in the krbmap more than once!\n", id);
printf("Not fixing this error\n");
EXEC SQL OPEN csr114;
while(1) {
EXEC SQL FETCH csr114 INTO :id;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
printf("Principal %d is in the krbmap more than once!\n", id);
printf("Not fixing this error\n");
char name[33];
EXEC SQL END DECLARE SECTION;
-/* retrieve (name = cluster.#name) where cluster.clu_id = mcmap.clu_id
- * and mcmap.mach_id = iid { */
EXEC SQL DECLARE csr201 CURSOR FOR
SELECT cluster.name FROM cluster, mcmap
WHERE cluster.clu_id=mcmap.clu_id AND mcmap.mach_id = :iid;
EXEC SQL OPEN csr201;
while(1) {
EXEC SQL FETCH csr201 INTO :name;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
strtrim(name);
found = 0;
char name[33];
EXEC SQL END DECLARE SECTION;
-/* retrieve (name = machine.#name) where machine.mach_id = mcmap.mach_id
- * and mcmap.clu_id = iid { */
EXEC SQL DECLARE csr202 CURSOR FOR
SELECT machine.name FROM machine, mcmap
WHERE machine.mach_id=mcmap.mach_id AND mcmap.clu_id=:iid;
EXEC SQL OPEN csr202;
while(1) {
EXEC SQL FETCH csr202 INTO :name;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
strtrim(name);
found = 0;
EXEC SQL BEGIN DECLARE SECTION;
int rowcount, iid = id;
EXEC SQL END DECLARE SECTION;
-/* replace users (potype = "NONE") where users.users_id = iid */
+
EXEC SQL UPDATE users SET potype='NONE' WHERE users.users_id = :iid;
EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
if (rowcount > 0)
char label[17], data[33];
EXEC SQL END DECLARE SECTION;
-/* retrieve (label = svc.serv_label, data = svc.serv_cluster)
- * where svc.clu_id = iid { */
EXEC SQL DECLARE csr203 CURSOR FOR
SELECT serv_label, serv_cluster FROM svc
WHERE clu_id = :iid;
EXEC SQL OPEN csr203;
while(1) {
EXEC SQL FETCH csr203 INTO :label, :data;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
strtrim(label);
strtrim(data);
int rowcount, iid = id;
EXEC SQL END DECLARE SECTION;
-/* replace list (acl_id = iid, acl_type = "LIST") where list.list_id = iid */
EXEC SQL UPDATE list SET acl_id = :iid, acl_type='LIST'
WHERE list_id = :iid;
EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
char mtype[9], *name = "";
EXEC SQL END DECLARE SECTION;
-/* retrieve (mtype = imembers.member_type, mid = imembers.member_id)
- * where imembers.list_id = iid and imembers.direct = 1 { */
EXEC SQL DECLARE csr204 CURSOR FOR
SELECT member_type, member_id FROM imembers
WHERE list_id = :iid AND direct=1;
EXEC SQL OPEN csr204;
while(1) {
EXEC SQL FETCH csr204 INTO :mtype, :mid;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
strtrim(mtype);
found = 0;
char name[33];
EXEC SQL END DECLARE SECTION;
-/* retrieve (lid = imembers.list_id)
- * where imembers.member_id = iid and imembers.member_type = "USER" and
- * imembers.direct = 1 { */
EXEC SQL DECLARE csr205 CURSOR FOR
SELECT list_id FROM imembers
WHERE member_id = :iid AND member_type='USER' AND direct=1;
EXEC SQL OPEN csr205;
while(1) {
EXEC SQL FETCH csr205 INTO :lid;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
found = 0;
printf("List %s has non-existant user member, id %d\n",
char name[33];
EXEC SQL END DECLARE SECTION;
-/* retrieve (lid = imembers.list_id)
- * where imembers.member_id = iid and imembers.member_type = "LIST" and
- * imembers.direct = 1 { */
EXEC SQL DECLARE csr206 CURSOR FOR
SELECT list_id FROM imembers
WHERE member_id = :iid AND member_type='LIST' AND direct=1;
EXEC SQL OPEN csr206;
while(1) {
EXEC SQL FETCH csr206 INTO :lid;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
found = 0;
printf("List %s has non-existant list member, id %d\n",
char name[33];
EXEC SQL END DECLARE SECTION;
-/* retrieve (lid = imembers.list_id)
- * where imembers.member_id = iid and imembers.member_type = "STRING" and
- * imembers.direct = 1 { */
EXEC SQL DECLARE csr207 CURSOR FOR
SELECT list_id FROM imembers
WHERE member_id = :iid AND member_type='STRING' AND direct=1;
EXEC SQL OPEN csr207;
while(1) {
EXEC SQL FETCH csr207 INTO :lid;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
found = 0;
printf("List %s has non-existant string member, id %d\n",
char name[33];
EXEC SQL END DECLARE SECTION;
-/* retrieve (lid = imembers.list_id)
- * where imembers.member_id = iid and imembers.member_type = "KERBEROS" and
- * imembers.direct = 1 { */
EXEC SQL DECLARE csr208 CURSOR FOR
SELECT list_id FROM imembers
WHERE member_id = :iid AND member_type='KERBEROS' AND direct=1;
EXEC SQL OPEN csr208;
while(1) {
EXEC SQL FETCH csr208 INTO :lid;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
found = 0;
printf("List %s has non-existant kerberos member, id %d\n",
int rowcount;
EXEC SQL END DECLARE SECTION;
-/* delete imembers where imembers.member_type = "USER" and
- * imembers.member_id = id and imembers.direct = 1 */
EXEC SQL DELETE FROM imembers WHERE member_type='USER' AND
member_id = :id AND direct = 1;
EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
int rowcount;
EXEC SQL END DECLARE SECTION;
-/* delete imembers where imembers.member_type = "LIST" and
- * imembers.member_id = id and imembers.direct = 1 */
EXEC SQL DELETE FROM imembers WHERE member_type='LIST' AND
member_id = :id AND direct=1;
EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
int rowcount;
EXEC SQL END DECLARE SECTION;
-/* delete imembers where imembers.member_type = "STRING" and
- * imembers.member_id = id and imembers.direct = 1 */
EXEC SQL DELETE FROM imembers WHERE member_type='STRING' AND
member_id = :id AND direct=1;
EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
int rowcount;
EXEC SQL END DECLARE SECTION;
-/* delete imembers where imembers.member_type = "KERBEROS" and
- * imembers.member_id = id and imembers.direct = 1 */
EXEC SQL DELETE FROM imembers WHERE member_type='KERBEROS' AND
member_id = :id AND direct=1;
EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
EXEC SQL END DECLARE SECTION;
int found = 1;
-/* retrieve (name = serverhosts.service) where serverhosts.mach_id = id { */
EXEC SQL DECLARE csr209 CURSOR FOR
SELECT service FROM serverhosts
WHERE mach_id = :id;
EXEC SQL OPEN csr209;
while(1) {
EXEC SQL FETCH csr209 INTO :name;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
found = 0;
printf("ServerHost entry for service %s non-existant host %d\n",
int rowcount;
EXEC SQL END DECLARE SECTION;
-/* delete serverhosts where serverhosts.mach_id = id */
EXEC SQL DELETE FROM serverhosts WHERE mach_id = :id;
EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
if (rowcount > 0)
if (!hash_lookup(machines, f->mach_id)) {
printf("Filesys %s with bad machine %d\n", f->name, f->mach_id);
if (single_fix("Fix", 0)) {
-/* replace filesys (mach_id = 0) where filesys.filsys_id = id */
EXEC SQL UPDATE filesys SET mach_id = 0 WHERE filsys_id = :id;
EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
if (rowcount > 0)
id1 = f->phys_id;
id2 = f->filsys_id;
id3 = f->mach_id;
-/* replace filesys (phys_id = id1) where filesys.filsys_id = id2 */
EXEC SQL UPDATE filesys SET phys_id = :id1 WHERE filsys_id = :id2;
EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
if (rowcount > 0)
printf("Unable to assign unique ID\n");
return;
}
-/* retrieve (id1 = values.value)
- * where values.name = "nfsphys_id"
- * inquire_equel(rowcount = "rowcount")
- */
EXEC SQL SELECT COUNT(*) INTO :rowcount FROM numvalues
WHERE name='nfsphys_id';
if (rowcount != 1) {
printf("Unable to retrieve unique ID\n");
return;
}
-/* append nfsphys (nfsphys_id = id1, mach_id = id3,
- * device = "???", #dir = dir, status = 0,
- * allocated = 0, size = 0,
- * modtime = "now", modby = 0,
- * modwith = "dbck")
- */
EXEC SQL INSERT INTO mfsphys (mfsphys_id, mach_id,
device, dir, status, allocated, size, modtime,
modby, modwith) VALUES (:id1, :id3, '???', :dir,
n->allocated = 0;
n->count = 0;
hash_store(nfsphys, id1, n);
-/* replace filesys (phys_id = id1)
- * where filesys.filsys_id = id2 */
EXEC SQL UPDATE filesys SET phys_id = :id1
WHERE filsys_id = :id2;
EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
EXEC SQL END DECLARE SECTION;
struct filesys *f;
-/* retrieve (id1 = fsgroup.filsys_id) where fsgroup.group_id = id { */
EXEC SQL DECLARE csr210 CURSOR FOR
SELECT filsys_id FROM fsgroup
WHERE group_id = :id;
EXEC SQL OPEN csr210;
while(1) {
EXEC SQL FETCH csr210 INTO :id1;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
found = 0;
if (f = (struct filesys *) hash_lookup(filesys, id1))
int rowcount, id = f->filsys_id;
EXEC SQL END DECLARE SECTION;
-/* replace filesys (type = "FSGROUP") where filesys.filsys_id = id */
EXEC SQL UPDATE filesys SET type='FSGROUP' WHERE filsys_id = :id;
EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
if (rowcount > 0)
EXEC SQL END DECLARE SECTION;
struct filesys *f;
-/* retrieve (id1 = fsgroup.group_id) where fsgroup.filsys_id = id { */
EXEC SQL DECLARE csr211 CURSOR FOR
SELECT group_id FROM fsgroup
WHERE filsys_id = :id;
EXEC SQL OPEN csr211;
while(1) {
EXEC SQL FETCH csr211 INTO :id1;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
found = 0;
if (f = (struct filesys *) hash_lookup(filesys, id1))
int id1, found = 1;
EXEC SQL END DECLARE SECTION;
-/* retrieve (id1 = quota.filsys_id) where quota.entity_id = id and
- * quota.type = "USER" { */
EXEC SQL DECLARE csr212 CURSOR FOR
SELECT filsys_id FROM quota
WHERE entity_id = :id AND type='USER';
EXEC SQL OPEN csr212;
while(1) {
EXEC SQL FETCH csr212 INTO :id1;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
found = 0;
printf("Quota on fs %d for non-existant user %d\n", id1, id);
int id1, found = 1;
EXEC SQL END DECLARE SECTION;
-/* retrieve (id1 = quota.filsys_id) where quota.entity_id = id and
- * quota.type = "GROUP" { */
EXEC SQL DECLARE csr213 CURSOR FOR
SELECT filsys_id FROM quota
WHERE entity_id = :id AND type='GROUP';
EXEC SQL OPEN csr213;
while(1) {
EXEC SQL FETCH csr213 INTO :id1;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
found = 0;
printf("Quota on fs %d for non-existant list %d\n", id1, id);
EXEC SQL END DECLARE SECTION;
id1 = ((struct filesys *)hash_lookup(filesys, id))->phys_id;
-/* delete quota where quota.entity_id = id and quota.type = "USER" */
EXEC SQL DELETE FROM quota
WHERE entity_id = :id AND type = 'USER';
EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
EXEC SQL END DECLARE SECTION;
id1 = ((struct filesys *)hash_lookup(filesys, id))->phys_id;
-/* delete quota where quota.entity_id = id and quota.type = "GROUP" */
EXEC SQL DELETE FROM quota WHERE entity_id = :id AND type='GROUP';
EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
if (rowcount > 0)
char type[9];
EXEC SQL END DECLARE SECTION;
-/* retrieve (id1 = quota.entity_id, type = quota.#type)
- * where quota.filsys_id = id { */
EXEC SQL DECLARE csr214 CURSOR FOR
SELECT entity_id, type FROM quota
WHERE filsys_id = :id;
EXEC SQL OPEN csr214;
while(1) {
EXEC SQL FETCH csr214 INTO :id1, :type;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
found = 0;
printf("Quota for %s %d on non-existant filesys %d\n", type, id1, id);
struct filesys *f;
f = (struct filesys *)hash_lookup(filesys, id);
-/* retrieve (id1 = quota.entity_id, type = quota.#type)
- * where quota.filsys_id = id { */
EXEC SQL DECLARE csr215 CURSOR FOR
SELECT entity_id, type FROM quota
WHERE filsys_id = :id;
EXEC SQL OPEN csr215;
while(1) {
EXEC SQL FETCH csr215 INTO :id1, :type;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
found = 0;
printf("Quota for %s %d on filesys %s has wrong phys_id %d\n",
EXEC SQL END DECLARE SECTION;
id1 = ((struct filesys *)hash_lookup(filesys, id))->phys_id;
-/* replace quota (phys_id = id1) where quota.filsys_id = id and
- * quota.phys_id != id1 */
EXEC SQL UPDATE quota SET phys_id = :id1
WHERE filsys_id = :id AND phys_id != :id1;
EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
EXEC SQL END DECLARE SECTION;
int found = 1;
-/* retrieve (name = s.#name) where s.acl_type = "USER" and s.acl_id = id { */
EXEC SQL DECLARE csr216 CURSOR FOR
SELECT name FROM servers
WHERE acl_type='USER' and acl_id = :id;
EXEC SQL OPEN csr216;
while(1) {
EXEC SQL FETCH csr216 INTO :name;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
strtrim(name);
printf("Service %s has acl non-existant user %d\n", name, id);
EXEC SQL END DECLARE SECTION;
int found = 1;
-/* retrieve (name = s.#name) where s.acl_type = "LIST" and s.acl_id = id { */
EXEC SQL DECLARE csr217 CURSOR FOR
SELECT name FROM servers
WHERE acl_type='LIST' AND acl_id = :id;
EXEC SQL OPEN csr217;
while(1) {
EXEC SQL FETCH csr217 INTO :name;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
strtrim(name);
printf("Service %s has acl non-existant list %d\n", name, id);
int rowcount;
EXEC SQL END DECLARE SECTION;
-/* replace servers (acl_id = 0) where servers.acl_id = id and
- * servers.acl_type = "USER" */
EXEC SQL UPDATE servers SET acl_id=0 WHERE acl_id = :id AND
acl_type='USER';
EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
int rowcount;
EXEC SQL END DECLARE SECTION;
-/* replace servers (acl_id = 0) where servers.acl_id = id and
- * servers.acl_type = "LIST" */
EXEC SQL UPDATE servers SET acl_id=0 WHERE acl_id = :id AND
acl_type='LIST';
EXEC SQL INQUIRE_SQL(:rowcount = rowcount);
struct string *s;
char *ss;
-/* retrieve (id1 = krbmap.string_id) where krbmap.users_id = id { */
EXEC SQL DECLARE csr218 CURSOR FOR
SELECT string_id FROM krbmap
WHERE users_id = :id ;
EXEC SQL OPEN csr218;
while(1) {
EXEC SQL FETCH csr218 INTO :id1;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
if (s = ((struct string *)hash_lookup(strings, id1)))
ss = s->name;
struct user *u;
char *s;
-/* retrieve (id1 = krbmap.users_id) where krbmap.string_id = id { */
EXEC SQL DECLARE csr219 CURSOR FOR
SELECT users_id FROM krbmap
WHERE string_id = :id;
EXEC SQL OPEN csr219;
while(1) {
EXEC SQL FETCH csr219 INTO :id1;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
if (u = ((struct user *)hash_lookup(users, id1)))
s = u->login;
EXEC SQL END DECLARE SECTION;
int found = 1;
-/* retrieve (name = palladium.#name) where palladium.mach_id = id { */
EXEC SQL DECLARE csr220 CURSOR FOR
SELECT name FROM palladium
WHERE mach_id = :id;
EXEC SQL OPEN csr220;
while(1) {
EXEC SQL FETCH csr220 INTO :name;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
strtrim(name);
printf("Palladium server/supervisor %s is on non-existant machine %d\n",
dprintf("Checking mcmap...\n");
sq1 = sq_create();
sq2 = sq_create();
-/* retrieve (id1 = mcmap.mach_id, id2 = mcmap.clu_id) { */
EXEC SQL DECLARE csr221 CURSOR FOR
SELECT mach_id, clu_id FROM mcmap;
EXEC SQL OPEN csr221;
while(1) {
EXEC SQL FETCH csr221 INTO :id1, :id2;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
if (!(m = (struct machine *)hash_lookup(machines, id1)))
sq_save_unique_data(sq1, id1);
dprintf("Checking service clusters...\n");
sq1 = sq_create();
-/* retrieve (id1 = svc.clu_id) { */
EXEC SQL DECLARE csr222 CURSOR FOR
SELECT clu_id FROM svc;
EXEC SQL OPEN csr222;
while(1) {
EXEC SQL FETCH csr222 INTO :id1;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
if (!hash_lookup(clusters, id1))
sq_save_unique_data(sq1, id1);
EXEC SQL OPEN csr223;
while(1) {
EXEC SQL FETCH csr223 INTO :id1, :type, :id2, :id3, :id4;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
if ((l = (struct list *) hash_lookup(lists, id1)) == NULL)
sq_save_unique_data(sq1, id1);
dprintf("Checking servers...\n");
sq1 = sq_create();
sq2 = sq_create();
-/* range of s is servers
- * retrieve (name = s.#name, type = s.acl_type, id1 = s.acl_id) { */
EXEC SQL DECLARE csr224 CURSOR FOR
SELECT name, acl_type, acl_id FROM servers;
EXEC SQL OPEN csr224;
while(1) {
EXEC SQL FETCH csr224 INTO :name, :type, :id1;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
strtrim(type);
if (!strcmp(type, "USER") && !hash_lookup(users, id1)) {
generic_fix(sq1, show_srv_user, "Fix", zero_srv_user, 1);
generic_fix(sq2, show_srv_list, "Fix", zero_srv_list, 1);
- dprintf("Checking servershosts...\n");
+ dprintf("Checking serverhosts...\n");
sq = sq_create();
-/* retrieve (id1 = serverhosts.mach_id) { */
EXEC SQL DECLARE csr225 CURSOR FOR
- SELECT mach_id FROM servrhosts;
+ SELECT mach_id FROM serverhosts;
EXEC SQL OPEN csr225;
while(1) {
EXEC SQL FETCH csr225 INTO :id1;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
if (!hash_lookup(machines, id1))
sq_save_data(sq, id1);
sq1 = sq_create();
sq2 = sq_create();
sq3 = sq_create();
-/* retrieve (id1 = fsgroup.group_id, id2 = fsgroup.filsys_id) { */
EXEC SQL DECLARE csr226 CURSOR FOR
SELECT group_id, filsys_id FROM fsgroup;
EXEC SQL OPEN csr226;
while(1) {
EXEC SQL FETCH csr226 INTO :id1, :id2;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
if (!(f = (struct filesys *) hash_lookup(filesys, id1)))
sq_save_data(sq1, id1);
sq2 = sq_create();
sq3 = sq_create();
sq4 = sq_create();
-/* retrieve (id1 = quota.entity_id, type = quota.#type, id2 = quota.filsys_id,
- * id3 = quota.phys_id, id4 = quota.quota) { */
EXEC SQL DECLARE csr227 CURSOR FOR
SELECT entity_id, type, filsys_id, phys_id, quota FROM quota;
EXEC SQL OPEN csr227;
while(1) {
EXEC SQL FETCH csr227 INTO :id1, :type, :id2, :id3, :id4;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
if (type[0] == 'U' && id1 != 0 && !hash_lookup(users, id1))
sq_save_data(sq1, id1);
dprintf("Not checking zephyr.\n");
dprintf("Checking hostaccess...\n");
-/* range of h is hostaccess
- * retrieve (id1 = h.mach_id, type = h.acl_type, id2 = h.acl_id) { */
EXEC SQL DECLARE csr228 CURSOR FOR
SELECT mach_id, acl_type, acl_id FROM hostaccess;
EXEC SQL OPEN csr228;
while(1) {
EXEC SQL FETCH csr228 INTO :id1, :type, :id2;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
strtrim(type);
if (!hash_lookup(machines, id1)) {
dprintf("Checking palladium...\n");
sq1 = sq_create();
-/* range of p is palladium
- * retrieve (id1 = p.mach_id) { */
EXEC SQL DECLARE csr229 CURSOR FOR
SELECT mach_id FROM palladium;
EXEC SQL OPEN csr229;
while(1) {
EXEC SQL FETCH csr229 INTO :id1;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
if (!hash_lookup(machines, id1)) {
sq_save_unique_data(sq1, id1);
dprintf("Checking krbmap...\n");
sq1 = sq_create();
sq2 = sq_create();
-/* range of k is krbmap
- * retrieve (id1 = k.users_id, id2 = k.string_id) { */
EXEC SQL DECLARE csr230 CURSOR FOR
SELECT users_id, string_id FROM krbmap;
EXEC SQL OPEN csr230;
while(1) {
EXEC SQL FETCH csr230 INTO :id1, :id2;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
if (!hash_lookup(users, id1))
sq_save_unique_data(sq1, id1);
generic_delete(sq2, show_krb_str, "krbmap", "string_id", 1);
dprintf("Checking capacls...\n");
-/* retrieve (id1 = capacls.list_id, name = capacls.tag) { */
EXEC SQL DECLARE csr231 CURSOR FOR
SELECT list_id, tag FROM capacls;
EXEC SQL OPEN csr231;
while(1) {
EXEC SQL FETCH csr231 INTO :id1, :name;
- if(sqlca.sqlcode != 0) break;
+ if (sqlca.sqlcode != 0) {
+ ingerr(&sqlca.sqlcode);
+ break;
+ }
if (!hash_lookup(lists, id1)) {
printf("Capacl for %s is non-existant list %d\n", name, id1);