2005-09-30 [paul] 1.9.14cvs63
authorPaul Mangan <paul@claws-mail.org>
Fri, 30 Sep 2005 14:52:05 +0000 (14:52 +0000)
committerPaul Mangan <paul@claws-mail.org>
Fri, 30 Sep 2005 14:52:05 +0000 (14:52 +0000)
* src/addressbook.c
Fix sensitivity of a menu
* src/codeconv.c
Respect hidden pref for mails with no encoding
* src/common/xml.c
Fix memory corruption
* src/plugins/pgpcore/sgpgme.c
Fix segfault on incomplete sigs, and display
of S/Mime UIDs

Patches by Colin

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/addressbook.c
src/codeconv.c
src/common/xml.c
src/plugins/pgpcore/sgpgme.c

index 30c8f6a46ef8ab7b3badd1694b2c3976713b0289..c3be5cb7d01e5d5af3f649cc0aec6529d879b855 100644 (file)
@@ -1,3 +1,17 @@
+2005-09-30 [paul]      1.9.14cvs63
+
+       * src/addressbook.c
+               Fix sensitivity of a menu
+       * src/codeconv.c
+               Respect hidden pref for mails with no encoding
+       * src/common/xml.c
+               Fix memory corruption
+       * src/plugins/pgpcore/sgpgme.c
+               Fix segfault on incomplete sigs, and display
+               of S/Mime UIDs
+
+       Patches by Colin
+
 2005-09-30 [colin]     1.9.14cvs62
 
        * src/partial_download.c
 2005-09-30 [colin]     1.9.14cvs62
 
        * src/partial_download.c
index 78b29be5eed9b873df35492c8df5cc267c0d945b..8f804b188a4dd0798d060c8d3eda934917165fc9 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1.4.5 -r 1.1.4.6 src/plugins/trayicon/libeggtrayicon/eggtrayicon.c;  ) > 1.9.14cvs60.patchset
 ( cvs diff -u -r 1.1.2.5 -r 1.1.2.6 src/plugins/pgpinline/pgpinline.c;  ) > 1.9.14cvs61.patchset
 ( cvs diff -u -r 1.1.2.9 -r 1.1.2.10 src/partial_download.c;  cvs diff -u -r 1.56.2.40 -r 1.56.2.41 src/pop.c;  ) > 1.9.14cvs62.patchset
 ( cvs diff -u -r 1.1.4.5 -r 1.1.4.6 src/plugins/trayicon/libeggtrayicon/eggtrayicon.c;  ) > 1.9.14cvs60.patchset
 ( cvs diff -u -r 1.1.2.5 -r 1.1.2.6 src/plugins/pgpinline/pgpinline.c;  ) > 1.9.14cvs61.patchset
 ( cvs diff -u -r 1.1.2.9 -r 1.1.2.10 src/partial_download.c;  cvs diff -u -r 1.56.2.40 -r 1.56.2.41 src/pop.c;  ) > 1.9.14cvs62.patchset
+( cvs diff -u -r 1.60.2.32 -r 1.60.2.33 src/addressbook.c;  cvs diff -u -r 1.65.2.40 -r 1.65.2.41 src/codeconv.c;  cvs diff -u -r 1.1.4.13 -r 1.1.4.14 src/common/xml.c;  cvs diff -u -r 1.1.2.9 -r 1.1.2.10 src/plugins/pgpcore/sgpgme.c;  ) > 1.9.14cvs63.patchset
index fa9feb6d6aa5d54ef65efa9008268de8189e0463..64ed931325d4b75dc327715b6c881473332fb61f 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=14
 INTERFACE_AGE=0
 BINARY_AGE=0
 MICRO_VERSION=14
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=62
+EXTRA_VERSION=63
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index b152d3cae1a79d55c3fa124eca570caa7a06132f..6c9ced9099b5d61e8e245115ebd8513956c5eee1 100644 (file)
@@ -2135,7 +2135,7 @@ static gboolean addressbook_tree_button_pressed(GtkWidget *ctree,
                if( ! iface->readOnly ) {
                        canEdit = TRUE;
                        canDelete = TRUE;
                if( ! iface->readOnly ) {
                        canEdit = TRUE;
                        canDelete = TRUE;
-                       menu_set_sensitive( addrbook.tree_factory, "/New Address", TRUE );
+                       menu_set_sensitive( addrbook.list_factory, "/New Address", TRUE );
                        gtk_widget_set_sensitive( addrbook.reg_btn, TRUE );
                }
        }
                        gtk_widget_set_sensitive( addrbook.reg_btn, TRUE );
                }
        }
index 7827f042fb6026e9fae9b68e09615185b3720500..d1226ee3590e6923619cc0dea58e3b29f803e4bf 100644 (file)
@@ -1324,6 +1324,9 @@ static CharSet conv_get_locale_charset_no_utf8(void)
        gchar *tmp;
        gint i;
 
        gchar *tmp;
        gint i;
 
+       if (prefs_common.broken_are_utf8)
+               return conv_get_locale_charset();
+
        if (cur_charset != -1)
                return cur_charset;
 
        if (cur_charset != -1)
                return cur_charset;
 
index 279d08c316013fc52c9e4d74cc7e9e4bbe3dd769..f1b947bc0b19765cf000a1d1d4511e823d8677aa 100644 (file)
@@ -207,7 +207,7 @@ gint xml_parse_next_tag(XMLFile *file)
        /* end-tag */
        if (buf[0] == '/') {
                if (strcmp(xml_get_current_tag(file)->tag, buf + 1) != 0) {
        /* end-tag */
        if (buf[0] == '/') {
                if (strcmp(xml_get_current_tag(file)->tag, buf + 1) != 0) {
-                       g_warning("xml_parse_next_tag(): Tag name mismatch: %s\n", buf);
+                       g_warning("xml_parse_next_tag(): Tag name mismatch: %s (%s)\n", buf, xml_get_current_tag(file)->tag);
                        return -1;
                }
                xml_pop_tag(file);
                        return -1;
                }
                xml_pop_tag(file);
@@ -652,7 +652,7 @@ void xml_free_tag(XMLTag *tag)
                XMLAttr *attr = (XMLAttr *)tag->attr->data;
                tag->attr = g_list_remove(tag->attr, tag->attr->data);
                XML_STRING_FREE(attr->name);
                XMLAttr *attr = (XMLAttr *)tag->attr->data;
                tag->attr = g_list_remove(tag->attr, tag->attr->data);
                XML_STRING_FREE(attr->name);
-               XML_STRING_FREE(attr->value);
+               g_free(attr->value); /* __not__ XML_STRING_FREE */
                g_free(attr);
        }
        g_free(tag);
                g_free(attr);
        }
        g_free(tag);
index e9f5a208ad84f09de04a8096e3dc52c891cf288e..c0eacf1910fb240e7b82d77d6a28086f2de12333 100644 (file)
@@ -125,11 +125,30 @@ static const gchar *get_validity_str(unsigned long validity)
        }
 }
 
        }
 }
 
+static gchar *extract_name(const char *uid)
+{
+       if (uid == NULL)
+               return NULL;
+       if (!strncmp(uid, "CN=", 3)) {
+               gchar *result = g_strdup(uid+3);
+               if (strstr(result, ","))
+                       *(strstr(result, ",")) = '\0';
+               return result;
+       } else if (strstr(uid, ",CN=")) {
+               gchar *result = g_strdup(strstr(uid, ",CN=")+4);
+               if (strstr(result, ","))
+                       *(strstr(result, ",")) = '\0';
+               return result;
+       } else {
+               return g_strdup(uid);
+       }
+}
 gchar *sgpgme_sigstat_info_short(gpgme_ctx_t ctx, gpgme_verify_result_t status)
 {
        gpgme_signature_t sig = NULL;
        gchar *uname = NULL;
        gpgme_key_t key;
 gchar *sgpgme_sigstat_info_short(gpgme_ctx_t ctx, gpgme_verify_result_t status)
 {
        gpgme_signature_t sig = NULL;
        gchar *uname = NULL;
        gpgme_key_t key;
+       gchar *result = NULL;
 
        if (GPOINTER_TO_INT(status) == -GPG_ERR_SYSTEM_ERROR) {
                return g_strdup(_("The signature can't be checked - GPG error."));
 
        if (GPOINTER_TO_INT(status) == -GPG_ERR_SYSTEM_ERROR) {
                return g_strdup(_("The signature can't be checked - GPG error."));
@@ -145,27 +164,34 @@ gchar *sgpgme_sigstat_info_short(gpgme_ctx_t ctx, gpgme_verify_result_t status)
 
        gpgme_get_key(ctx, sig->fpr, &key, 0);
        if (key)
 
        gpgme_get_key(ctx, sig->fpr, &key, 0);
        if (key)
-               uname = key->uids->uid;
+               uname = extract_name(key->uids->uid);
        else
        else
-               uname = "<?>";
+               uname = g_strdup("<?>");
        switch (gpg_err_code(sig->status)) {
        case GPG_ERR_NO_ERROR:
        switch (gpg_err_code(sig->status)) {
        case GPG_ERR_NO_ERROR:
-       {
-               return g_strdup_printf(_("Good signature from %s (Trust: %s)."),
+               result = g_strdup_printf(_("Good signature from %s (Trust: %s)."),
                        uname, get_validity_str(sig->validity));
                        uname, get_validity_str(sig->validity));
-       }
+               break;
        case GPG_ERR_SIG_EXPIRED:
        case GPG_ERR_SIG_EXPIRED:
-               return g_strdup_printf(_("Expired signature from %s."), uname);
+               result = g_strdup_printf(_("Expired signature from %s."), uname);
+               break;
        case GPG_ERR_KEY_EXPIRED:
        case GPG_ERR_KEY_EXPIRED:
-               return g_strdup_printf(_("Expired key from %s."), uname);
+               result = g_strdup_printf(_("Expired key from %s."), uname);
+               break;
        case GPG_ERR_BAD_SIGNATURE:
        case GPG_ERR_BAD_SIGNATURE:
-               return g_strdup_printf(_("Bad signature from %s."), uname);
+               result = g_strdup_printf(_("Bad signature from %s."), uname);
+               break;
        case GPG_ERR_NO_PUBKEY:
        case GPG_ERR_NO_PUBKEY:
-               return g_strdup(_("No key available to verify this signature."));
+               result = g_strdup(_("No key available to verify this signature."));
+               break;
        default:
        default:
-               return g_strdup(_("The signature has not been checked."));
+               result = g_strdup(_("The signature has not been checked."));
+               break;
        }
        }
-       return g_strdup(_("Error"));
+       if (result == NULL)
+               result = g_strdup(_("Error"));
+       g_free(uname);
+       return result;
 }
 
 gchar *sgpgme_sigstat_info_full(gpgme_ctx_t ctx, gpgme_verify_result_t status)
 }
 
 gchar *sgpgme_sigstat_info_full(gpgme_ctx_t ctx, gpgme_verify_result_t status)
@@ -183,15 +209,22 @@ gchar *sgpgme_sigstat_info_full(gpgme_ctx_t ctx, gpgme_verify_result_t status)
                const gchar *keytype, *keyid, *uid;
                
                gpgme_get_key(ctx, sig->fpr, &key, 0);
                const gchar *keytype, *keyid, *uid;
                
                gpgme_get_key(ctx, sig->fpr, &key, 0);
-               user = key->uids;
 
 
-               keytype = gpgme_pubkey_algo_name(key->subkeys->pubkey_algo);
-               keyid = key->subkeys->keyid;
+               if (key) {
+                       user = key->uids;
+                       keytype = gpgme_pubkey_algo_name(
+                                       key->subkeys->pubkey_algo);
+                       keyid = key->subkeys->keyid;
+                       uid = user->uid;
+               } else {
+                       keytype = "?";
+                       keyid = "?";
+                       uid = "?";
+               }
                g_string_append_printf(siginfo,
                        _("Signature made using %s key ID %s\n"),
                        keytype, keyid);
                
                g_string_append_printf(siginfo,
                        _("Signature made using %s key ID %s\n"),
                        keytype, keyid);
                
-               uid = user->uid;
                switch (gpg_err_code(sig->status)) {
                case GPG_ERR_NO_ERROR:
                case GPG_ERR_KEY_EXPIRED:
                switch (gpg_err_code(sig->status)) {
                case GPG_ERR_NO_ERROR:
                case GPG_ERR_KEY_EXPIRED:
@@ -214,7 +247,7 @@ gchar *sgpgme_sigstat_info_full(gpgme_ctx_t ctx, gpgme_verify_result_t status)
                }
                if (sig->status != GPG_ERR_BAD_SIGNATURE) {
                        gint j = 1;
                }
                if (sig->status != GPG_ERR_BAD_SIGNATURE) {
                        gint j = 1;
-                       user = user->next;
+                       user = user ? user->next : NULL;
                        while (user != NULL) {
                                g_string_append_printf(siginfo,
                                        _("                aka \"%s\"\n"),
                        while (user != NULL) {
                                g_string_append_printf(siginfo,
                                        _("                aka \"%s\"\n"),
@@ -224,7 +257,7 @@ gchar *sgpgme_sigstat_info_full(gpgme_ctx_t ctx, gpgme_verify_result_t status)
                        }
                        g_string_append_printf(siginfo,
                                _("Primary key fingerprint: %s\n"), 
                        }
                        g_string_append_printf(siginfo,
                                _("Primary key fingerprint: %s\n"), 
-                               sig->fpr);
+                               sig ? sig->fpr: "?");
                }
                
                g_string_append(siginfo, "\n");
                }
                
                g_string_append(siginfo, "\n");