push username, homedir and tmpdir in lua too.
[apps/madmutt.git] / lib-crypt / pgp.c
index 297eb73..6b78ce4 100644 (file)
@@ -266,7 +266,7 @@ int pgp_application_pgp_handler (BODY * m, STATE * s)
       have_any_sigs = have_any_sigs || (clearsign && (s->flags & M_VERIFY));
 
       /* Copy PGP material to temporary file */
-      tmpfp = m_tempfile(tmpfname, sizeof(tmpfname), NONULL(Tempdir), NULL);
+      tmpfp = m_tempfile(tmpfname, sizeof(tmpfname), NONULL(MCore.tmpdir), NULL);
       if (tmpfp == NULL) {
         mutt_perror (tmpfname);
         return (-1);
@@ -295,7 +295,7 @@ int pgp_application_pgp_handler (BODY * m, STATE * s)
 
       /* Invoke PGP if needed */
       if (!clearsign || (s->flags & M_VERIFY)) {
-        pgpout = m_tempfile(outfile, sizeof(outfile), NONULL(Tempdir), NULL);
+        pgpout = m_tempfile(outfile, sizeof(outfile), NONULL(MCore.tmpdir), NULL);
         if (pgpout == NULL) {
           mutt_perror (outfile);
           return (-1);
@@ -466,7 +466,7 @@ static int pgp_check_traditional_one_body (FILE * fp, BODY * b,
   if (tagged_only && !b->tagged)
     return 0;
 
-  tempfd = m_tempfd(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+  tempfd = m_tempfd(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
   if (mutt_decode_save_attachment (fp, b, tempfd, 0) != 0) {
     unlink (tempfile);
     return 0;
@@ -548,7 +548,7 @@ int pgp_verify_one (BODY * sigbdy, STATE * s, const char *tempfile)
   mutt_copy_bytes (s->fpin, fp, sigbdy->length);
   m_fclose(&fp);
 
-  pgperr = m_tempfile(pgperrfile, sizeof(pgperrfile), NONULL(Tempdir), NULL);
+  pgperr = m_tempfile(pgperrfile, sizeof(pgperrfile), NONULL(MCore.tmpdir), NULL);
   if (pgperr == NULL) {
     mutt_perror (pgperrfile);
     unlink (sigfile);
@@ -594,7 +594,7 @@ static void pgp_extract_keys_from_attachment (FILE * fp, BODY * top)
   FILE *tempfp;
   char tempfname[_POSIX_PATH_MAX];
 
-  tempfp = m_tempfile(tempfname, sizeof(tempfname), NONULL(Tempdir), NULL);
+  tempfp = m_tempfile(tempfname, sizeof(tempfname), NONULL(MCore.tmpdir), NULL);
   if (tempfp == NULL) {
     mutt_perror (_("Can't create temporary file"));
     return;
@@ -649,14 +649,14 @@ BODY *pgp_decrypt_part (BODY * a, STATE * s, FILE * fpout, BODY * p)
   pid_t thepid;
   int rv;
 
-  pgperr = m_tempfile(pgperrfile, sizeof(pgperrfile), NONULL(Tempdir), NULL);
+  pgperr = m_tempfile(pgperrfile, sizeof(pgperrfile), NONULL(MCore.tmpdir), NULL);
   if (!pgperr) {
     mutt_perror (pgperrfile);
     return NULL;
   }
   unlink (pgperrfile);
 
-  pgptmp = m_tempfile(pgptmpfile, sizeof(pgptmpfile), NONULL(Tempdir), NULL);
+  pgptmp = m_tempfile(pgptmpfile, sizeof(pgptmpfile), NONULL(MCore.tmpdir), NULL);
   if (!pgptmp) {
     mutt_perror (pgptmpfile);
     m_fclose(&pgperr);
@@ -757,7 +757,7 @@ int pgp_decrypt_mime (FILE * fpin, FILE ** fpout, BODY * b, BODY ** cur)
 
   p_clear(&s, 1);
   s.fpin = fpin;
-  *fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+  *fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
   if (*fpout == NULL) {
     mutt_perror (_("Can't create temporary file"));
     return (-1);
@@ -798,7 +798,7 @@ int pgp_encrypted_handler (BODY * a, STATE * s)
    */
   a = a->next;
 
-  fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+  fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
   if (fpout == NULL) {
     if (s->flags & M_DISPLAY)
       state_attach_puts (_
@@ -868,12 +868,12 @@ BODY *pgp_sign_message (BODY * a)
 
   convert_to_7bit (a);          /* Signed data _must_ be in 7-bit format. */
 
-  fp = m_tempfile(sigfile, sizeof(sigfile), NONULL(Tempdir), NULL);
+  fp = m_tempfile(sigfile, sizeof(sigfile), NONULL(MCore.tmpdir), NULL);
   if (fp == NULL) {
     return (NULL);
   }
 
-  sfp = m_tempfile(signedfile, sizeof(signedfile), NONULL(Tempdir), NULL);
+  sfp = m_tempfile(signedfile, sizeof(signedfile), NONULL(MCore.tmpdir), NULL);
   if (sfp == NULL) {
     mutt_perror (signedfile);
     m_fclose(&fp);
@@ -1112,13 +1112,13 @@ BODY *pgp_encrypt_message (BODY * a, char *keylist, int sign)
   int empty = 0;
   pid_t thepid;
 
-  fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+  fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
   if (fpout == NULL) {
     mutt_perror (_("Can't create temporary file"));
     return (NULL);
   }
 
-  pgperr = m_tempfile(pgperrfile, sizeof(pgperrfile), NONULL(Tempdir), NULL);
+  pgperr = m_tempfile(pgperrfile, sizeof(pgperrfile), NONULL(MCore.tmpdir), NULL);
   if (pgperr == NULL) {
     mutt_perror (pgperrfile);
     m_fclose(&fpout);
@@ -1127,7 +1127,7 @@ BODY *pgp_encrypt_message (BODY * a, char *keylist, int sign)
   }
   unlink (pgperrfile);
 
-  fptmp = m_tempfile(pgpinfile, sizeof(pgpinfile), NONULL(Tempdir), NULL);
+  fptmp = m_tempfile(pgpinfile, sizeof(pgpinfile), NONULL(MCore.tmpdir), NULL);
   if (fptmp == NULL) {
     mutt_perror (pgpinfile);
     m_fclose(&fpout);
@@ -1251,7 +1251,7 @@ BODY *pgp_traditional_encryptsign (BODY * a, int flags, char *keylist)
     return NULL;
   }
 
-  pgpin = m_tempfile(pgpinfile, sizeof(pgpinfile), NONULL(Tempdir), NULL);
+  pgpin = m_tempfile(pgpinfile, sizeof(pgpinfile), NONULL(MCore.tmpdir), NULL);
   if (pgpin == NULL) {
     mutt_perror (pgpinfile);
     m_fclose(&fp);
@@ -1292,8 +1292,8 @@ BODY *pgp_traditional_encryptsign (BODY * a, int flags, char *keylist)
   m_fclose(&fp);
   m_fclose(&pgpin);
 
-  pgpout = m_tempfile(pgpoutfile, sizeof(pgpoutfile), NONULL(Tempdir), NULL);
-  pgperr = m_tempfile(pgperrfile, sizeof(pgperrfile), NONULL(Tempdir), NULL);
+  pgpout = m_tempfile(pgpoutfile, sizeof(pgpoutfile), NONULL(MCore.tmpdir), NULL);
+  pgperr = m_tempfile(pgperrfile, sizeof(pgperrfile), NONULL(MCore.tmpdir), NULL);
   if (pgpout == NULL || pgperr == NULL) {
     mutt_perror (pgpout ? pgperrfile : pgpoutfile);
     m_fclose(&pgpin);