struct timeval now;
EXEC SQL BEGIN DECLARE SECTION;
char login[9], sig[257], id[17], kname[257];
- int timestamp, cutoff;
+ int timestamp;
struct { char login[12];
char id[12];
char sig[256];
initialize_sms_error_table ();
#ifsql INGRES
- EXEC SQL CONNECT sms;
+ EXEC SQL CONNECT moira;
+ EXEC SQL SET LOCKMODE SESSION WHERE LEVEL=TABLE, READLOCK=SHARED;
#endsql
#ifsql INFORMIX
- EXEC SQL DATABASE sms;
+ EXEC SQL DATABASE moira;
#endsql
if (argc == 2) {
outf = NULL;
}
- /* the cutoff time is 14 days before now */
- gettimeofday(&now, NULL);
- cutoff = now.tv_sec - 14 * 24 * 60 * 60;
-
+ /* The following is declarative, not executed,
+ * and so is dependent on where it is in the file,
+ * not in the order of execution of statements.
+ */
EXEC SQL WHENEVER SQLERROR GOTO sqlerr;
EXEC SQL DECLARE x CURSOR FOR
- SELECT u.login, u.mit_id, u.signature, u.sigdate, s.string
+ SELECT u.login, u.clearid, u.signature, u.sigdate, s.string
FROM users u, strings s
WHERE u.status = 1 and u.sigwho = s.string_id and u.sigwho != 0
- and u.secure <= :cutoff and u.secure != 0;
+ and u.secure != 0;
EXEC SQL OPEN x;
while (1) {
EXEC SQL FETCH x INTO :login, :id, :sig, :timestamp, :kname;
si.timestamp = timestamp;
si.SigInfoVersion = 0; /* XXXXXX this isn't used */
kname_parse(si.pname, si.pinst, si.prealm, kname);
- si.rawsig = sig;
+ si.rawsig = (unsigned char *)sig;
GDSS_Recompose(&si, outrec.sig);
write(out, &outrec, sizeof(outrec));
}
sqlerr:
com_err(whoami, MR_INGRES_ERR, " code %d\n", sqlca.sqlcode);
#ifsql INGRES
- if (sqlca.sqlcode == 17700)
+ if (sqlca.sqlcode == 17700 || sqlca.sqlcode == -37000)
exit(MR_DEADLOCK);
#endsql
critical_alert("DCM", "SIS build encountered INGRES ERROR %d",