}
static char qword_buf[8192];
-static char tmp_buf[8192];
void qword_print(FILE *f, char *str)
{
char *bp = qword_buf;
int len = sizeof(qword_buf);
qword_add(&bp, &len, str);
fwrite(qword_buf, bp-qword_buf, 1, f);
- /* XXX: */
- memcpy(tmp_buf, qword_buf, bp-qword_buf);
- tmp_buf[bp-qword_buf] = '\0';
- printerr(2, "%s", tmp_buf);
}
void qword_printhex(FILE *f, char *str, int slen)
int len = sizeof(qword_buf);
qword_addhex(&bp, &len, str, slen);
fwrite(qword_buf, bp-qword_buf, 1, f);
- /* XXX: */
- memcpy(tmp_buf, qword_buf, bp-qword_buf);
- tmp_buf[bp-qword_buf] = '\0';
- printerr(2, "%s", tmp_buf);
}
void qword_printint(FILE *f, int num)
{
fprintf(f, "%d ", num);
- printerr(2, "%d ", num);
}
int qword_eol(FILE *f)
int err;
fprintf(f,"\n");
err = fflush(f);
- printerr(2, "\n");
return err;
}
qword_printint(f, cred->cr_uid);
qword_printint(f, cred->cr_gid);
qword_printint(f, cred->cr_ngroups);
- for (i=0; i < cred->cr_ngroups; i++)
+ printerr(2, "mech: %s, hndl len: %d, ctx len %d, timeout: %d, "
+ "uid: %d, gid: %d, num aux grps: %d:\n",
+ fname, out_handle->length, context_token->length, 0x7fffffff,
+ cred->cr_uid, cred->cr_gid, cred->cr_ngroups);
+ for (i=0; i < cred->cr_ngroups; i++) {
qword_printint(f, cred->cr_groups[i]);
+ printerr(2, " (%4d) %d\n", i+1, cred->cr_groups[i]);
+ }
qword_print(f, fname);
qword_printhex(f, context_token->value, context_token->length);
err = qword_eol(f);