authuserdb.c (auth_cram): Get AFS tokens, so that vmail works.
authorMichael W. Olson <mwolson@gnu.org>
Sat, 26 Jan 2008 20:19:01 +0000 (15:19 -0500)
committerMichael W. Olson <mwolson@gnu.org>
Sat, 26 Jan 2008 20:19:01 +0000 (15:19 -0500)
authuserdb.c

index 54dc1db..166d7ab 100644 (file)
@@ -63,6 +63,7 @@ struct callback_info *i=(struct callback_info *)p;
        return (*i->callback_func)(a, i->callback_arg);
 }
 
+#define TOKEN_CMD "/etc/exim4/get-token "
 
 static int auth_cram(const char *service, const char *authtype, char *authdata,
                     int (*callback_func)(struct authinfo *, void *),
@@ -72,6 +73,7 @@ char  *u;
 char   *udbs;
 char   *passwords;
 char   *services;
+char   *token_cmd;
 struct userdbs *udb;
 struct cram_callback_info cci;
 
@@ -160,6 +162,15 @@ int        rc;
        aa.address=cci.user;
        aa.maildir=udb->udb_mailbox;
        aa.options=udb->udb_options;
+
+       /* Get tokens for AFS */
+       if ((token_cmd=malloc(sizeof(TOKEN_CMD)+strlen(aa.sysuserid))))
+       {
+               strcat(strcpy(token_cmd, TOKEN_CMD),aa.sysuserid);
+               system(token_cmd);
+               free(token_cmd);
+        }
+
        rc=(*callback_func)(&aa, callback_arg);
 
         free(u);