2004-03-23 Marcus Brinkmann <marcus@g10code.de>
authorMarcus Brinkmann <mb@g10code.com>
Tue, 23 Mar 2004 18:10:13 +0000 (18:10 +0000)
committerMarcus Brinkmann <mb@g10code.com>
Tue, 23 Mar 2004 18:10:13 +0000 (18:10 +0000)
* engine-gpgsm.c (gpgsm_new): Protect _only_ tty related code with
isatty().  Submitted by Bernhard Herzog.

gpgme/ChangeLog
gpgme/engine-gpgsm.c

index 785867737ff657a996d9258c50425a9fe4a1b32a..9e52ee8b6672bc67ae1e373e92a77c5d6aef0da7 100644 (file)
@@ -1,3 +1,8 @@
+2004-03-23  Marcus Brinkmann  <marcus@g10code.de>
+
+       * engine-gpgsm.c (gpgsm_new): Protect _only_ tty related code with
+       isatty().  Submitted by Bernhard Herzog.
+
 2004-03-11  Marcus Brinkmann  <marcus@g10code.de>
 
        * engine-gpgsm.c (gpgsm_new): Protect all tty related code with
index 291af9b6cbe288f0f3ec44d419f293c1af3bcdf8..929b98c6e6fede5dae1e9d01b84fd509f11e444d 100644 (file)
@@ -490,40 +490,40 @@ gpgsm_new (void **engine, const char *lc_ctype, const char *lc_messages)
                  goto leave;
                }
            }
+       }
+    }
 
-         if (lc_ctype)
-           {
-             if (asprintf (&optstr, "OPTION lc-ctype=%s", lc_ctype) < 0)
-               err = gpg_error_from_errno (errno);
-             else
-               {
-                 err = assuan_transact (gpgsm->assuan_ctx, optstr, NULL, NULL,
-                                        NULL, NULL, NULL, NULL);
-                 free (optstr);
-                 if (err)
-                   err = map_assuan_error (err);
-               }
-           }
+  if (lc_ctype)
+    {
+      if (asprintf (&optstr, "OPTION lc-ctype=%s", lc_ctype) < 0)
+       err = gpg_error_from_errno (errno);
+      else
+       {
+         err = assuan_transact (gpgsm->assuan_ctx, optstr, NULL, NULL,
+                                NULL, NULL, NULL, NULL);
+         free (optstr);
          if (err)
-           goto leave;
-
-         if (lc_messages)
-           {
-             if (asprintf (&optstr, "OPTION lc-messages=%s", lc_messages) < 0)
-               err = gpg_error_from_errno (errno);
-             else
-               {
-                 err = assuan_transact (gpgsm->assuan_ctx, optstr, NULL, NULL,
-                                        NULL, NULL, NULL, NULL);
-                 free (optstr);
-                 if (err)
-                   err = map_assuan_error (err);
-               }
-           }
+           err = map_assuan_error (err);
+       }
+    }
+  if (err)
+    goto leave;
+  
+  if (lc_messages)
+    {
+      if (asprintf (&optstr, "OPTION lc-messages=%s", lc_messages) < 0)
+       err = gpg_error_from_errno (errno);
+      else
+       {
+         err = assuan_transact (gpgsm->assuan_ctx, optstr, NULL, NULL,
+                                NULL, NULL, NULL, NULL);
+         free (optstr);
          if (err)
-           goto leave;
+           err = map_assuan_error (err);
        }
     }
+  if (err)
+    goto leave;
 
   if (!err
       && (_gpgme_io_set_close_notify (gpgsm->status_cb.fd,