arguments. (preparation for ANSI function declarations)
printf("%s entry %s(%d) has a %s with non-existant user %d\n",
table, oname, oid, field, sid);
if (single_fix("Delete", 1)) {
printf("%s entry %s(%d) has a %s with non-existant user %d\n",
table, oname, oid, field, sid);
if (single_fix("Delete", 1)) {
- sprintf(stmt_buf, "UPDATE %s SET %s = %d WHERE %s=%d",
- table, field, 0, idfield, oid);
+ sprintf(stmt_buf, "UPDATE %s SET %s = 0 WHERE %s = %d",
+ table, field, idfield, oid);
EXEC SQL EXECUTE IMMEDIATE :stmt_buf;
rowcount = sqlca.sqlerrd[2];
if (rowcount == 1)
EXEC SQL EXECUTE IMMEDIATE :stmt_buf;
rowcount = sqlca.sqlerrd[2];
if (rowcount == 1)
printf("%s entry has a %s with non-existant user %d\n",
table, field, id);
if (single_fix("Delete", 1)) {
printf("%s entry has a %s with non-existant user %d\n",
table, field, id);
if (single_fix("Delete", 1)) {
- sprintf(stmt_buf, "UPDATE %s SET %s = %d WHERE CURRENT OF %s",
- table, field, 0, cursor);
+ sprintf(stmt_buf, "UPDATE %s SET %s = 0 WHERE CURRENT OF %s",
+ table, field, cursor);
EXEC SQL EXECUTE IMMEDIATE :stmt_buf;
rowcount = sqlca.sqlerrd[2];
if (rowcount == 1)
EXEC SQL EXECUTE IMMEDIATE :stmt_buf;
rowcount = sqlca.sqlerrd[2];
if (rowcount == 1)
-EXEC SQL BEGIN DECLARE SECTION;
-EXEC SQL END DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
+ int iid = id, rowcount;
EXEC SQL END DECLARE SECTION;
EXEC SQL DELETE FROM imembers WHERE member_type='USER' AND
EXEC SQL END DECLARE SECTION;
EXEC SQL DELETE FROM imembers WHERE member_type='USER' AND
- member_id = :id AND direct = 1;
+ member_id = :iid AND direct = 1;
rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s deleted\n", rowcount, rowcount==1?"y":"ies");
rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s deleted\n", rowcount, rowcount==1?"y":"ies");
-EXEC SQL BEGIN DECLARE SECTION;
-EXEC SQL END DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
+ int iid = id, rowcount;
EXEC SQL END DECLARE SECTION;
EXEC SQL DELETE FROM imembers WHERE member_type='LIST' AND
EXEC SQL END DECLARE SECTION;
EXEC SQL DELETE FROM imembers WHERE member_type='LIST' AND
- member_id = :id AND direct=1;
+ member_id = :iid AND direct=1;
rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s deleted\n", rowcount, rowcount==1?"y":"ies");
rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s deleted\n", rowcount, rowcount==1?"y":"ies");
-EXEC SQL BEGIN DECLARE SECTION;
-EXEC SQL END DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
+ int iid = id, rowcount;
EXEC SQL END DECLARE SECTION;
EXEC SQL DELETE FROM imembers WHERE member_type='STRING' AND
EXEC SQL END DECLARE SECTION;
EXEC SQL DELETE FROM imembers WHERE member_type='STRING' AND
- member_id = :id AND direct=1;
+ member_id = :iid AND direct=1;
rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s deleted\n", rowcount, rowcount==1?"y":"ies");
rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s deleted\n", rowcount, rowcount==1?"y":"ies");
-EXEC SQL BEGIN DECLARE SECTION;
-EXEC SQL END DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
+ int iid = id, rowcount;
EXEC SQL END DECLARE SECTION;
EXEC SQL DELETE FROM imembers WHERE member_type='KERBEROS' AND
EXEC SQL END DECLARE SECTION;
EXEC SQL DELETE FROM imembers WHERE member_type='KERBEROS' AND
- member_id = :id AND direct=1;
+ member_id = :iid AND direct=1;
rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s deleted\n", rowcount, rowcount==1?"y":"ies");
rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s deleted\n", rowcount, rowcount==1?"y":"ies");
-EXEC SQL BEGIN DECLARE SECTION;
-EXEC SQL END DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
char name[33];
{
EXEC SQL BEGIN DECLARE SECTION;
char name[33];
EXEC SQL END DECLARE SECTION;
int found = 1;
EXEC SQL DECLARE csr209 CURSOR FOR
SELECT service FROM serverhosts
EXEC SQL END DECLARE SECTION;
int found = 1;
EXEC SQL DECLARE csr209 CURSOR FOR
SELECT service FROM serverhosts
EXEC SQL OPEN csr209;
while(1) {
EXEC SQL FETCH csr209 INTO :name;
EXEC SQL OPEN csr209;
while(1) {
EXEC SQL FETCH csr209 INTO :name;
-EXEC SQL BEGIN DECLARE SECTION;
-EXEC SQL END DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
+ int iid = id, rowcount;
EXEC SQL END DECLARE SECTION;
EXEC SQL END DECLARE SECTION;
- EXEC SQL DELETE FROM serverhosts WHERE mach_id = :id;
+ EXEC SQL DELETE FROM serverhosts WHERE mach_id = :iid;
rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s deleted\n", rowcount, rowcount==1?"y":"ies");
rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s deleted\n", rowcount, rowcount==1?"y":"ies");
-EXEC SQL BEGIN DECLARE SECTION;
-EXEC SQL END DECLARE SECTION;
register struct filesys *f;
int hint;
{
EXEC SQL BEGIN DECLARE SECTION;
register struct filesys *f;
int hint;
{
EXEC SQL BEGIN DECLARE SECTION;
- int id1, id2, id3, rowcount;
+ int iid = id, id1, id2, id3, rowcount;
char *dir;
EXEC SQL END DECLARE SECTION;
struct nfsphys *n;
char *dir;
EXEC SQL END DECLARE SECTION;
struct nfsphys *n;
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)) {
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)) {
- EXEC SQL UPDATE filesys SET mach_id = 0 WHERE filsys_id = :id;
+ EXEC SQL UPDATE filesys SET mach_id = 0 WHERE filsys_id = :iid;
rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s fixed\n",rowcount, rowcount==1?"y":"ies");
rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s fixed\n",rowcount, rowcount==1?"y":"ies");
printf("Unable to retrieve unique ID\n");
return;
}
printf("Unable to retrieve unique ID\n");
return;
}
- EXEC SQL INSERT INTO mfsphys (mfsphys_id, mach_id,
+ EXEC SQL INSERT INTO nfsphys (nfsphys_id, mach_id,
device, dir, status, allocated, size, modtime,
modby, modwith) VALUES (:id1, :id3, '\?\?\?', :dir,
0, 0, 0, SYSDATE, 0, 'dbck');
device, dir, status, allocated, size, modtime,
modby, modwith) VALUES (:id1, :id3, '\?\?\?', :dir,
0, 0, 0, SYSDATE, 0, 'dbck');
-EXEC SQL BEGIN DECLARE SECTION;
-EXEC SQL END DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
+ int iid = id, id1, found = 1;
EXEC SQL END DECLARE SECTION;
struct filesys *f;
EXEC SQL DECLARE csr210 CURSOR FOR
SELECT filsys_id FROM fsgroup
EXEC SQL END DECLARE SECTION;
struct filesys *f;
EXEC SQL DECLARE csr210 CURSOR FOR
SELECT filsys_id FROM fsgroup
EXEC SQL OPEN csr210;
while(1) {
EXEC SQL FETCH csr210 INTO :id1;
EXEC SQL OPEN csr210;
while(1) {
EXEC SQL FETCH csr210 INTO :id1;
-EXEC SQL BEGIN DECLARE SECTION;
-EXEC SQL END DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
+ int iid = id, id1, found = 1;
EXEC SQL END DECLARE SECTION;
struct filesys *f;
EXEC SQL DECLARE csr211 CURSOR FOR
SELECT group_id FROM fsgroup
EXEC SQL END DECLARE SECTION;
struct filesys *f;
EXEC SQL DECLARE csr211 CURSOR FOR
SELECT group_id FROM fsgroup
+ WHERE filsys_id = :iid;
EXEC SQL OPEN csr211;
while(1) {
EXEC SQL FETCH csr211 INTO :id1;
EXEC SQL OPEN csr211;
while(1) {
EXEC SQL FETCH csr211 INTO :id1;
-EXEC SQL BEGIN DECLARE SECTION;
-EXEC SQL END DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
+ int iid = id, id1, found = 1;
EXEC SQL END DECLARE SECTION;
EXEC SQL DECLARE csr212 CURSOR FOR
SELECT filsys_id FROM quota
EXEC SQL END DECLARE SECTION;
EXEC SQL DECLARE csr212 CURSOR FOR
SELECT filsys_id FROM quota
- WHERE entity_id = :id AND type='USER';
+ WHERE entity_id = :iid AND type='USER';
EXEC SQL OPEN csr212;
while(1) {
EXEC SQL FETCH csr212 INTO :id1;
EXEC SQL OPEN csr212;
while(1) {
EXEC SQL FETCH csr212 INTO :id1;
-EXEC SQL BEGIN DECLARE SECTION;
-EXEC SQL END DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
+ int iid = id, id1, found = 1;
EXEC SQL END DECLARE SECTION;
EXEC SQL DECLARE csr213 CURSOR FOR
SELECT filsys_id FROM quota
EXEC SQL END DECLARE SECTION;
EXEC SQL DECLARE csr213 CURSOR FOR
SELECT filsys_id FROM quota
- WHERE entity_id = :id AND type='GROUP';
+ WHERE entity_id = :iid AND type='GROUP';
EXEC SQL OPEN csr213;
while(1) {
EXEC SQL FETCH csr213 INTO :id1;
EXEC SQL OPEN csr213;
while(1) {
EXEC SQL FETCH csr213 INTO :id1;
-EXEC SQL BEGIN DECLARE SECTION;
-EXEC SQL END DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
+ int iid = id, rowcount, id1;
EXEC SQL END DECLARE SECTION;
id1 = ((struct filesys *)hash_lookup(filesys, id))->phys_id;
EXEC SQL DELETE FROM quota
EXEC SQL END DECLARE SECTION;
id1 = ((struct filesys *)hash_lookup(filesys, id))->phys_id;
EXEC SQL DELETE FROM quota
- WHERE entity_id = :id AND type = 'USER';
+ WHERE entity_id = :iid AND type = 'USER';
rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s deleted\n",rowcount, rowcount==1?"y":"ies");
rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s deleted\n",rowcount, rowcount==1?"y":"ies");
-EXEC SQL BEGIN DECLARE SECTION;
-EXEC SQL END DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
+ int iid = id, rowcount, id1;
EXEC SQL END DECLARE SECTION;
id1 = ((struct filesys *)hash_lookup(filesys, id))->phys_id;
EXEC SQL END DECLARE SECTION;
id1 = ((struct filesys *)hash_lookup(filesys, id))->phys_id;
- EXEC SQL DELETE FROM quota WHERE entity_id = :id AND type='GROUP';
+ EXEC SQL DELETE FROM quota WHERE entity_id = :iid AND type='GROUP';
rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s deleted\n",rowcount, rowcount==1?"y":"ies");
rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s deleted\n",rowcount, rowcount==1?"y":"ies");
-EXEC SQL BEGIN DECLARE SECTION;
-EXEC SQL END DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
+ int iid = id, id1, found = 1;
char type[9];
EXEC SQL END DECLARE SECTION;
EXEC SQL DECLARE csr214 CURSOR FOR
SELECT entity_id, type FROM quota
char type[9];
EXEC SQL END DECLARE SECTION;
EXEC SQL DECLARE csr214 CURSOR FOR
SELECT entity_id, type FROM quota
+ WHERE filsys_id = :iid;
EXEC SQL OPEN csr214;
while(1) {
EXEC SQL FETCH csr214 INTO :id1, :type;
EXEC SQL OPEN csr214;
while(1) {
EXEC SQL FETCH csr214 INTO :id1, :type;
}
show_quota_wrongpid(id)
}
show_quota_wrongpid(id)
-EXEC SQL BEGIN DECLARE SECTION;
-EXEC SQL END DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
+ int iid = id, id1, found = 1;
char type[9];
EXEC SQL END DECLARE SECTION;
struct user *u;
char type[9];
EXEC SQL END DECLARE SECTION;
struct user *u;
f = (struct filesys *)hash_lookup(filesys, id);
EXEC SQL DECLARE csr215 CURSOR FOR
SELECT entity_id, type FROM quota
f = (struct filesys *)hash_lookup(filesys, id);
EXEC SQL DECLARE csr215 CURSOR FOR
SELECT entity_id, type FROM quota
+ WHERE filsys_id = :iid;
EXEC SQL OPEN csr215;
while(1) {
EXEC SQL FETCH csr215 INTO :id1, :type;
EXEC SQL OPEN csr215;
while(1) {
EXEC SQL FETCH csr215 INTO :id1, :type;
-EXEC SQL BEGIN DECLARE SECTION;
-EXEC SQL END DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
+ int iid = id, rowcount, id1;
EXEC SQL END DECLARE SECTION;
id1 = ((struct filesys *)hash_lookup(filesys, id))->phys_id;
EXEC SQL UPDATE quota SET phys_id = :id1
EXEC SQL END DECLARE SECTION;
id1 = ((struct filesys *)hash_lookup(filesys, id))->phys_id;
EXEC SQL UPDATE quota SET phys_id = :id1
- WHERE filsys_id = :id AND phys_id != :id1;
+ WHERE filsys_id = :iid AND phys_id != :id1;
rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s fixed\n",rowcount, rowcount==1?"y":"ies");
rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s fixed\n",rowcount, rowcount==1?"y":"ies");
-EXEC SQL BEGIN DECLARE SECTION;
-EXEC SQL END DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
char name[33];
{
EXEC SQL BEGIN DECLARE SECTION;
char name[33];
EXEC SQL END DECLARE SECTION;
int found = 1;
EXEC SQL DECLARE csr216 CURSOR FOR
SELECT name FROM servers
EXEC SQL END DECLARE SECTION;
int found = 1;
EXEC SQL DECLARE csr216 CURSOR FOR
SELECT name FROM servers
- WHERE acl_type='USER' and acl_id = :id;
+ WHERE acl_type='USER' and acl_id = :iid;
EXEC SQL OPEN csr216;
while(1) {
EXEC SQL FETCH csr216 INTO :name;
EXEC SQL OPEN csr216;
while(1) {
EXEC SQL FETCH csr216 INTO :name;
-EXEC SQL BEGIN DECLARE SECTION;
-EXEC SQL END DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
char name[33];
{
EXEC SQL BEGIN DECLARE SECTION;
char name[33];
EXEC SQL END DECLARE SECTION;
int found = 1;
EXEC SQL DECLARE csr217 CURSOR FOR
SELECT name FROM servers
EXEC SQL END DECLARE SECTION;
int found = 1;
EXEC SQL DECLARE csr217 CURSOR FOR
SELECT name FROM servers
- WHERE acl_type='LIST' AND acl_id = :id;
+ WHERE acl_type='LIST' AND acl_id = :iid;
EXEC SQL OPEN csr217;
while(1) {
EXEC SQL FETCH csr217 INTO :name;
EXEC SQL OPEN csr217;
while(1) {
EXEC SQL FETCH csr217 INTO :name;
-EXEC SQL BEGIN DECLARE SECTION;
-EXEC SQL END DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
+ int iid = id, rowcount;
EXEC SQL END DECLARE SECTION;
EXEC SQL END DECLARE SECTION;
- EXEC SQL UPDATE servers SET acl_id=0 WHERE acl_id = :id AND
+ EXEC SQL UPDATE servers SET acl_id=0 WHERE acl_id = :iid AND
acl_type='USER';
rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
acl_type='USER';
rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
-EXEC SQL BEGIN DECLARE SECTION;
-EXEC SQL END DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
+ int iid = id, rowcount;
EXEC SQL END DECLARE SECTION;
EXEC SQL END DECLARE SECTION;
- EXEC SQL UPDATE servers SET acl_id=0 WHERE acl_id = :id AND
+ EXEC SQL UPDATE servers SET acl_id=0 WHERE acl_id = :iid AND
acl_type='LIST';
rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
acl_type='LIST';
rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
-EXEC SQL BEGIN DECLARE SECTION;
-EXEC SQL END DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
+ int iid = id, found = 1, id1;
EXEC SQL END DECLARE SECTION;
struct string *s;
char *ss;
EXEC SQL DECLARE csr218 CURSOR FOR
SELECT string_id FROM krbmap
EXEC SQL END DECLARE SECTION;
struct string *s;
char *ss;
EXEC SQL DECLARE csr218 CURSOR FOR
SELECT string_id FROM krbmap
+ WHERE users_id = :iid ;
EXEC SQL OPEN csr218;
while(1) {
EXEC SQL FETCH csr218 INTO :id1;
EXEC SQL OPEN csr218;
while(1) {
EXEC SQL FETCH csr218 INTO :id1;
-EXEC SQL BEGIN DECLARE SECTION;
-EXEC SQL END DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
+ int iid = id, found = 1, id1;
EXEC SQL END DECLARE SECTION;
struct user *u;
char *s;
EXEC SQL DECLARE csr219 CURSOR FOR
SELECT users_id FROM krbmap
EXEC SQL END DECLARE SECTION;
struct user *u;
char *s;
EXEC SQL DECLARE csr219 CURSOR FOR
SELECT users_id FROM krbmap
+ WHERE string_id = :iid;
EXEC SQL OPEN csr219;
while(1) {
EXEC SQL FETCH csr219 INTO :id1;
EXEC SQL OPEN csr219;
while(1) {
EXEC SQL FETCH csr219 INTO :id1;
-EXEC SQL BEGIN DECLARE SECTION;
-EXEC SQL END DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
char name[33];
{
EXEC SQL BEGIN DECLARE SECTION;
char name[33];
EXEC SQL END DECLARE SECTION;
int found = 1;
EXEC SQL DECLARE csr220 CURSOR FOR
SELECT name FROM palladium
EXEC SQL END DECLARE SECTION;
int found = 1;
EXEC SQL DECLARE csr220 CURSOR FOR
SELECT name FROM palladium
EXEC SQL OPEN csr220;
while(1) {
EXEC SQL FETCH csr220 INTO :name;
EXEC SQL OPEN csr220;
while(1) {
EXEC SQL FETCH csr220 INTO :name;
check_box_counts(id, cnt, counts)
check_box_counts(id, cnt, counts)
-EXEC SQL BEGIN DECLARE SECTION;
-EXEC SQL END DECLARE SECTION;
struct hash *counts;
{
EXEC SQL BEGIN DECLARE SECTION;
struct hash *counts;
{
EXEC SQL BEGIN DECLARE SECTION;
+ int oldval, rowcount, iid = id, icnt = cnt;
EXEC SQL END DECLARE SECTION;
oldval = (int) hash_lookup(counts, id);
EXEC SQL END DECLARE SECTION;
oldval = (int) hash_lookup(counts, id);
((struct machine *) hash_lookup(machines, id))->name,
oldval, cnt);
if (single_fix("Update", 1)) {
((struct machine *) hash_lookup(machines, id))->name,
oldval, cnt);
if (single_fix("Update", 1)) {
- EXEC SQL UPDATE serverhosts SET value1 = :cnt
- WHERE service='POP' AND mach_id = :id;
+ EXEC SQL UPDATE serverhosts SET value1 = :icnt
+ WHERE service='POP' AND mach_id = :iid;
rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s fixed\n", rowcount, rowcount==1?"y":"ies");
rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s fixed\n", rowcount, rowcount==1?"y":"ies");
check_nfs_counts(id, n, hint)
check_nfs_counts(id, n, hint)
-EXEC SQL BEGIN DECLARE SECTION;
-EXEC SQL END DECLARE SECTION;
struct nfsphys *n;
{
EXEC SQL BEGIN DECLARE SECTION;
struct nfsphys *n;
{
EXEC SQL BEGIN DECLARE SECTION;
+ int iid = id, val, rowcount;
EXEC SQL END DECLARE SECTION;
val = n->count;
EXEC SQL END DECLARE SECTION;
val = n->count;
n->dir, n->allocated, val);
if (single_fix("Update", 1)) {
EXEC SQL UPDATE nfsphys SET allocated = :val
n->dir, n->allocated, val);
if (single_fix("Update", 1)) {
EXEC SQL UPDATE nfsphys SET allocated = :val
- WHERE nfsphys_id = :id;
+ WHERE nfsphys_id = :iid;
rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s fixed\n", rowcount, rowcount==1?"y":"ies");
rowcount = sqlca.sqlerrd[2];
if (rowcount > 0)
printf("%d entr%s fixed\n", rowcount, rowcount==1?"y":"ies");
**/
int set_next_object_id(object, table, limit)
**/
int set_next_object_id(object, table, limit)
-EXEC SQL BEGIN DECLARE SECTION;
-EXEC SQL END DECLARE SECTION;
enum tables table;
int limit;
{
EXEC SQL BEGIN DECLARE SECTION;
int value;
enum tables table;
int limit;
{
EXEC SQL BEGIN DECLARE SECTION;
int value;
EXEC SQL END DECLARE SECTION;
int starting_value;
EXEC SQL END DECLARE SECTION;
int starting_value;
- EXEC SQL SELECT value INTO :value FROM numvalues WHERE name = :object;
+ EXEC SQL SELECT value INTO :value FROM numvalues WHERE name = :obj;
if (sqlca.sqlerrd[2] != 1)
return(MR_NO_ID);
if (sqlca.sqlerrd[2] != 1)
return(MR_NO_ID);
if (LOG_RES)
com_err(whoami, 0, "setting ID %s to %d", object, value);
if (LOG_RES)
com_err(whoami, 0, "setting ID %s to %d", object, value);
- EXEC SQL UPDATE numvalues SET value = :value WHERE name = :object;
+ EXEC SQL UPDATE numvalues SET value = :value WHERE name = :obj;
}
int do_for_all_rows(query, count, action, actarg)
}
int do_for_all_rows(query, count, action, actarg)
-EXEC SQL BEGIN DECLARE SECTION;
-EXEC SQL END DECLARE SECTION;
int count, (*action)(), actarg;
{
int i, rowcount=0;
int count, (*action)(), actarg;
{
int i, rowcount=0;
+ EXEC SQL BEGIN DECLARE SECTION;
+ char *q = query;
+ EXEC SQL END DECLARE SECTION;
- EXEC SQL PREPARE stmt FROM :query;
+ EXEC SQL PREPARE stmt FROM :q;
if(sqlca.sqlcode) return;
EXEC SQL DECLARE curs CURSOR FOR stmt;
EXEC SQL OPEN curs;
if(sqlca.sqlcode) return;
EXEC SQL DECLARE curs CURSOR FOR stmt;
EXEC SQL OPEN curs;
*/
int check_nfs(mach_id, name, access)
*/
int check_nfs(mach_id, name, access)
-EXEC SQL BEGIN DECLARE SECTION;
-EXEC SQL END DECLARE SECTION;
char *name, *access;
{
EXEC SQL BEGIN DECLARE SECTION;
char dir[81];
char *name, *access;
{
EXEC SQL BEGIN DECLARE SECTION;
char dir[81];
EXEC SQL END DECLARE SECTION;
register int status;
register char *cp1;
EXEC SQL END DECLARE SECTION;
register int status;
register char *cp1;
status = MR_NFS;
EXEC SQL DECLARE csr101 CURSOR FOR
SELECT nfsphys_id, dir FROM nfsphys
status = MR_NFS;
EXEC SQL DECLARE csr101 CURSOR FOR
SELECT nfsphys_id, dir FROM nfsphys
- WHERE mach_id = :mach_id
ORDER BY 2 DESC;
if (dbms_errno)
return(mr_errcode);
ORDER BY 2 DESC;
if (dbms_errno)
return(mr_errcode);
*/
int get_ace_internal(atype, aid, action, actarg)
*/
int get_ace_internal(atype, aid, action, actarg)
-EXEC SQL BEGIN DECLARE SECTION;
-EXEC SQL END DECLARE SECTION;
int aid, (*action)(), actarg;
{
char *rargv[2];
int found = 0;
EXEC SQL BEGIN DECLARE SECTION;
int aid, (*action)(), actarg;
{
char *rargv[2];
int found = 0;
EXEC SQL BEGIN DECLARE SECTION;
+ char name[33], *type = atype;
+ int id = aid;
EXEC SQL END DECLARE SECTION;
rargv[1] = name;
EXEC SQL END DECLARE SECTION;
rargv[1] = name;
rargv[0] = "FILESYS";
EXEC SQL DECLARE csr110 CURSOR FOR
SELECT label FROM filesys
rargv[0] = "FILESYS";
EXEC SQL DECLARE csr110 CURSOR FOR
SELECT label FROM filesys
if (dbms_errno)
return(mr_errcode);
EXEC SQL OPEN csr110;
if (dbms_errno)
return(mr_errcode);
EXEC SQL OPEN csr110;
rargv[0] = "QUERY";
EXEC SQL DECLARE csr111 CURSOR FOR
SELECT capability FROM capacls
rargv[0] = "QUERY";
EXEC SQL DECLARE csr111 CURSOR FOR
SELECT capability FROM capacls
if (dbms_errno)
return(mr_errcode);
EXEC SQL OPEN csr111;
if (dbms_errno)
return(mr_errcode);
EXEC SQL OPEN csr111;
rargv[0] = "FILESYS";
EXEC SQL DECLARE csr112 CURSOR FOR
SELECT label FROM filesys
rargv[0] = "FILESYS";
EXEC SQL DECLARE csr112 CURSOR FOR
SELECT label FROM filesys
if (dbms_errno)
return(mr_errcode);
EXEC SQL OPEN csr112;
if (dbms_errno)
return(mr_errcode);
EXEC SQL OPEN csr112;
rargv[0] = "LIST";
EXEC SQL DECLARE csr113 CURSOR FOR
SELECT name FROM list
rargv[0] = "LIST";
EXEC SQL DECLARE csr113 CURSOR FOR
SELECT name FROM list
- WHERE acl_type = :atype AND acl_id = :aid;
+ WHERE acl_type = :type AND acl_id = :id;
if (dbms_errno)
return(mr_errcode);
EXEC SQL OPEN csr113;
if (dbms_errno)
return(mr_errcode);
EXEC SQL OPEN csr113;
rargv[0] = "SERVICE";
EXEC SQL DECLARE csr114 CURSOR FOR
SELECT name FROM servers
rargv[0] = "SERVICE";
EXEC SQL DECLARE csr114 CURSOR FOR
SELECT name FROM servers
- WHERE acl_type = :atype AND acl_id = :aid;
+ WHERE acl_type = :type AND acl_id = :id;
if (dbms_errno)
return(mr_errcode);
EXEC SQL OPEN csr114;
if (dbms_errno)
return(mr_errcode);
EXEC SQL OPEN csr114;
rargv[0] = "HOSTACCESS";
EXEC SQL DECLARE csr115 CURSOR FOR
SELECT name FROM machine m, hostaccess ha
rargv[0] = "HOSTACCESS";
EXEC SQL DECLARE csr115 CURSOR FOR
SELECT name FROM machine m, hostaccess ha
- WHERE m.mach_id = ha.mach_id AND ha.acl_type = :atype
- AND ha.acl_id = :aid;
+ WHERE m.mach_id = ha.mach_id AND ha.acl_type = :type
+ AND ha.acl_id = :id;
if (dbms_errno)
return(mr_errcode);
EXEC SQL OPEN csr115;
if (dbms_errno)
return(mr_errcode);
EXEC SQL OPEN csr115;
rargv[0] = "ZEPHYR";
EXEC SQL DECLARE csr116 CURSOR FOR
SELECT class FROM zephyr z
rargv[0] = "ZEPHYR";
EXEC SQL DECLARE csr116 CURSOR FOR
SELECT class FROM zephyr z
- WHERE z.xmt_type = :atype AND z.xmt_id = :aid
- OR z.sub_type = :atype AND z.sub_id = :aid
- OR z.iws_type = :atype AND z.iws_id = :aid
- OR z.iui_type = :atype AND z.iui_id = :aid;
+ WHERE z.xmt_type = :type AND z.xmt_id = :id
+ OR z.sub_type = :type AND z.sub_id = :id
+ OR z.iws_type = :type AND z.iws_id = :id
+ OR z.iui_type = :type AND z.iui_id = :id;
if (dbms_errno)
return(mr_errcode);
EXEC SQL OPEN csr116;
if (dbms_errno)
return(mr_errcode);
EXEC SQL OPEN csr116;
**/
int set_pop_usage(id, cnt)
**/
int set_pop_usage(id, cnt)
-EXEC SQL BEGIN DECLARE SECTION;
-EXEC SQL END DECLARE SECTION;
+ EXEC SQL BEGIN DECLARE SECTION;
+ int iid = id, icnt = cnt;
+ EXEC SQL END DECLARE SECTION;
- EXEC SQL UPDATE serverhosts SET value1 = value1 + :cnt
- WHERE serverhosts.service = 'POP' AND serverhosts.mach_id = :id;
+ EXEC SQL UPDATE serverhosts SET value1 = value1 + :icnt
+ WHERE serverhosts.service = 'POP' AND serverhosts.mach_id = :iid;
if (dbms_errno) return(mr_errcode);
return(MR_SUCCESS);
if (dbms_errno) return(mr_errcode);
return(MR_SUCCESS);
/* Adds a string to the string table. Returns the id number.
*
*/
/* Adds a string to the string table. Returns the id number.
*
*/
-int add_string(name)
- EXEC SQL BEGIN DECLARE SECTION;
- char *name;
- EXEC SQL END DECLARE SECTION;
+int add_string(nm)
+ char *nm;
{
EXEC SQL BEGIN DECLARE SECTION;
{
EXEC SQL BEGIN DECLARE SECTION;
+ char buf[256], *name = nm;
int id;
EXEC SQL END DECLARE SECTION;
int id;
EXEC SQL END DECLARE SECTION;
id++;
EXEC SQL UPDATE numvalues SET value = :id WHERE name = 'strings_id';
id++;
EXEC SQL UPDATE numvalues SET value = :id WHERE name = 'strings_id';
- EXEC SQL INSERT INTO strings (string_id, string) VALUES (:id, :name);
+ EXEC SQL INSERT INTO strings (string_id, string) VALUES (:id, :nm);