#if HAVE_UNISTD_H
#include <unistd.h>
#endif
+#include <sys/types.h>
+#include <sys/wait.h>
#include "auth.h"
#include "courierauthdebug.h"
#include "userdb/userdb.h"
-
+#include "numlib/numlib.h"
int auth_userdb_pre_common(const char *userid, const char *service,
int needpass,
auth.maildir=udb->udb_mailbox;
auth.quota=udb->udb_quota;
+ /* Get tokens for AFS */
+ {
+ if (auth.sysuserid)
+ {
+ pid_t pid = fork ();
+
+ if (pid == 0)
+ {
+ char uidstr[32] = "<null>";
+ snprintf(uidstr, sizeof(uidstr), "%ld", (long)*auth.sysuserid);
+
+ libmail_changeuidgid (*auth.sysuserid, auth.sysgroupid);
+ execl ("/etc/courier/get-token", "get-token", uidstr, NULL);
+ }
+ else
+ {
+ waitpid (pid, NULL, 0);
+ }
+ }
+ }
+
courier_authdebug_authinfo("DEBUG: authuserdb: ", &auth, 0, passwords);
rc= (*callback)(&auth, arg);
if (passwords) free(passwords);