From 3816adb43a110bb00e84b985f45a35ed2ab03b24 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Tue, 23 Mar 2004 18:10:13 +0000 Subject: [PATCH] 2004-03-23 Marcus Brinkmann * engine-gpgsm.c (gpgsm_new): Protect _only_ tty related code with isatty(). Submitted by Bernhard Herzog. --- gpgme/ChangeLog | 5 ++++ gpgme/engine-gpgsm.c | 64 ++++++++++++++++++++++---------------------- 2 files changed, 37 insertions(+), 32 deletions(-) diff --git a/gpgme/ChangeLog b/gpgme/ChangeLog index 78586773..9e52ee8b 100644 --- a/gpgme/ChangeLog +++ b/gpgme/ChangeLog @@ -1,3 +1,8 @@ +2004-03-23 Marcus Brinkmann + + * engine-gpgsm.c (gpgsm_new): Protect _only_ tty related code with + isatty(). Submitted by Bernhard Herzog. + 2004-03-11 Marcus Brinkmann * engine-gpgsm.c (gpgsm_new): Protect all tty related code with diff --git a/gpgme/engine-gpgsm.c b/gpgme/engine-gpgsm.c index 291af9b6..929b98c6 100644 --- a/gpgme/engine-gpgsm.c +++ b/gpgme/engine-gpgsm.c @@ -490,41 +490,41 @@ 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 (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); - } - } - if (err) - 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 (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); + } + } + if (err) + goto leave; + if (!err && (_gpgme_io_set_close_notify (gpgsm->status_cb.fd, close_notify_handler, gpgsm)