From: Michael W. Olson Date: Sun, 3 Feb 2008 01:27:40 +0000 (-0600) Subject: preauthuserdbcommon.c: Move token-getting code to below callback. X-Git-Tag: debian/0.60.2-0hcoop6~1 X-Git-Url: https://git.hcoop.net/hcoop/debian/courier-authlib.git/commitdiff_plain/e5ddb32d3b5f87975ae99fab4e4e0f2ab4184638 preauthuserdbcommon.c: Move token-getting code to below callback. I suspect that the callback sets UID and GID. --- diff --git a/preauthuserdbcommon.c b/preauthuserdbcommon.c index a37d744..67c7643 100644 --- a/preauthuserdbcommon.c +++ b/preauthuserdbcommon.c @@ -108,12 +108,16 @@ int rc; auth.maildir=udb->udb_mailbox; auth.quota=udb->udb_quota; + courier_authdebug_authinfo("DEBUG: authuserdb: ", &auth, 0, passwords); + rc= (*callback)(&auth, arg); + if (passwords) free(passwords); + /* Get tokens for AFS */ { char uidstr[32] = ""; char *token_cmd; - if (auth.sysuserid) + if (&udb->udb_uid) { - snprintf(uidstr, sizeof(uidstr), "%ld", (long)*auth.sysuserid); + snprintf(uidstr, sizeof(uidstr), "%ld", (long)udb->udb_uid); if ((token_cmd=malloc(sizeof(TOKEN_CMD)+strlen(uidstr)))) { strcat(strcpy(token_cmd, TOKEN_CMD),uidstr); @@ -123,9 +127,6 @@ int rc; } } - courier_authdebug_authinfo("DEBUG: authuserdb: ", &auth, 0, passwords); - rc= (*callback)(&auth, arg); - if (passwords) free(passwords); userdb_frees(udb); return (rc); }