-
-/**
- ** followup_uuac - do signature, set_user_modtime
- **
- ** Inputs:
- ** argv[0] - login (add_user)
- ** argv[U_SIGNATURE] - sig
- **
- **/
-
-int followup_uuac(struct query *q, char *argv[], client *cl)
-{
- EXEC SQL BEGIN DECLARE SECTION;
- int who, status, id;
- char *entity, *name;
- EXEC SQL END DECLARE SECTION;
-#ifdef GDSS
- char databuf[USERS_LOGIN_SIZE + USERS_CLEARID_SIZE];
- EXEC SQL BEGIN DECLARE SECTION;
- char rawsig[512];
- char *login;
- int sigwho, timestamp;
- EXEC SQL END DECLARE SECTION;
- SigInfo si;
-#endif /* GDSS */
-
- id = *(int *)argv[0];
- who = cl->client_id;
- entity = cl->entity;
-
-#ifdef GDSS
- if (q->vcnt == U_MODTIME && *argv[U_SIGNATURE + 1])
- {
- login = malloc(0);
- status = id_to_name(id, USERS_TABLE, &login);
- sprintf(databuf, "%s:%s", login, argv[U_MITID + 1]);
- free(login);
- /* skip bytes for timestamp & kname */
- si.rawsig = (unsigned char *) rawsig;
- status = GDSS_Verify(databuf, strlen(databuf), argv[U_SIGNATURE + 1],
- &si);
- if (strlen(rawsig) > mr_sig_length)
- {
- com_err(whoami, 0, "GDSS signature would be truncated.");
- return MR_INTERNAL;
- }
- if (status == 0)
- {
- name = kname_unparse(si.pname, si.pinst, si.prealm);
- status = name_to_id(name, STRINGS_TABLE, &sigwho);
- if (status == MR_NO_MATCH)
- sigwho = add_string(name);
- else if (status)
- return status;
- timestamp = si.timestamp;
- }
- else
- return gdss2et(status);
- }
- else
- {
- rawsig[0] = '\0';
- sigwho = 0;
- timestamp = 0;
- }
-#endif /* GDSS */
-
- /* create finger entry, pobox & set modtime on user */
-
-#ifdef GDSS
- EXEC SQL UPDATE users SET modtime = SYSDATE, modby = :who, modwith = :entity,
- signature = NVL(:rawsig, CHR(0)), sigdate = :timestamp, sigwho = :sigwho
- WHERE users_id = :id;
-#else /* GDSS */
- EXEC SQL UPDATE users SET modtime = SYSDATE, modby = :who, modwith = :entity
- WHERE users_id = :id;
-#endif /* GDSS */
- return MR_SUCCESS;
-}
-
-
-/* followp_aprn: update counts in serverhosts. Also set modtime for aprn. */
-int followup_aprn(struct query *q, char *argv[], client *cl)
-{
- EXEC SQL BEGIN DECLARE SECTION;
- int mid, delta;
- EXEC SQL END DECLARE SECTION;
-
- /* See if we're doing aprn or dprn */
- if (q->name[0] == 'a')
- {
- delta = 1;
- set_modtime(q, argv, cl);
- }
- else
- delta = -1;
-
- mid = *(int *)argv[PRN_RM];
-
- EXEC SQL UPDATE serverhosts SET value1 = value1 + :delta
- WHERE service = 'PRINT' AND mach_id = :mid;
- if (dbms_errno)
- return mr_errcode;
-
- return MR_SUCCESS;
-}
-
-/* followup_gpob: fixes argv[2] based on the IDs currently there and the
- * type in argv[1]. Then completes the upcall to the user.