+/* After retrieving a user account, fix the modby field and signature.
+ * The modby field is the second to last thing in the
+ * argv, the argv length is determined from the query structure. It is
+ * passed as a pointer to an integer. This will either turn it into a
+ * username, or # + the users_id. Only "gua*" queries have a signature,
+ * these are ones with U_END return values. "gub*" queries also use this
+ * routine but don't have a signature.
+ */
+followup_guax(q, sq, v, action, actarg, cl)
+ struct query *q;
+ register struct save_queue *sq;
+ struct validate *v;
+ register int (*action)();
+ register int actarg;
+ client *cl;
+{
+ register int i, j;
+ char **argv, *malloc();
+#ifdef GDSS
+ char sigbuf[256], *rawsig, *kname;
+ SigInfo si;
+#endif /* GDSS */
+ int id, status;
+
+ i = q->vcnt - 2;
+ while (sq_get_data(sq, &argv)) {
+ id = atoi(argv[i]);
+ if (id > 0)
+ status = id_to_name(id, "USER", &argv[i]);
+ else
+ status = id_to_name(-id, "STRING", &argv[i]);
+ if (status && status != MR_NO_MATCH)
+ return(status);
+#ifdef GDSS
+ if (q->vcnt == U_END) {
+ com_err(whoami, 0, "compressing signature");
+ rawsig = argv[U_SIGNATURE];
+ bcopy(&rawsig[0], &id, sizeof(int));
+ id = ntohl(id);
+ status = id_to_name(id, "STRING", &kname);
+ bcopy(&rawsig[4], &si.timestamp, sizeof(int));
+ si.timestamp = ntohl(si.timestamp);
+ si.SigInfoVersion = 0; /* XXXXX this isn't used */
+ kname_parse(si.pname, si.pinst, si.prealm, kname);
+ si.rawsig = (unsigned char *)&rawsig[8];
+ GDSS_Recompose(&si, sigbuf);
+ argv[U_SIGNATURE] = strsave(sigbuf);
+ }
+#endif /* GDSS */
+ (*action)(q->vcnt, argv, actarg);
+ for (j = 0; j < q->vcnt; j++)
+ free(argv[j]);
+ free(argv);
+ }
+ sq_destroy(sq);
+ return(MR_SUCCESS);
+}
+
+