2005-05-04 [colin] 1.9.6cvs50
authorColin Leroy <colin@colino.net>
Wed, 4 May 2005 16:49:23 +0000 (16:49 +0000)
committerColin Leroy <colin@colino.net>
Wed, 4 May 2005 16:49:23 +0000 (16:49 +0000)
* src/partial_download.c
* src/pop.c
Escape login when writing uidl file
fixes bug #736

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/partial_download.c
src/pop.c

index b9f3aa44ff0c8b87f915e5f070bddfb3d9a869bc..74c7723ead6bcf8d05fd958ad0fb75f805cec3b4 100644 (file)
@@ -1,3 +1,10 @@
+2005-05-04 [colin]     1.9.6cvs50
+
+       * src/partial_download.c
+       * src/pop.c
+               Escape login when writing uidl file
+               fixes bug #736
+
 2005-05-03 [colin]     1.9.6cvs49
 
        * src/procmime.c
index 76a6cdf3fdceb719705d8b49de0c1f03b1cdd157..bf8803067d041622f76f39142352044592655cab 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.49.2.10 -r 1.49.2.11 src/prefs_account.h; cvs diff -u -r 1.150.2.22 -r 1.150.2.23 src/procmsg.c; cvs diff -u -r 1.17.2.8 -r 1.17.2.9 src/send_message.c; cvs diff -u -r 1.11.2.9 -r 1.11.2.10 src/common/smtp.c; cvs diff -u -r 1.6.2.5 -r 1.6.2.6 src/common/smtp.h; ) > 1.9.6cvs47.patchset
 ( cvs diff -u -r 1.382.2.118 -r 1.382.2.119 src/compose.c; ) > 1.9.6cvs48.patchset
 ( cvs diff -u -r 1.49.2.38 -r 1.49.2.39 src/procmime.c; ) > 1.9.6cvs49.patchset
+( cvs diff -u -r 1.1.2.4 -r 1.1.2.5 src/partial_download.c; cvs diff -u -r 1.56.2.33 -r 1.56.2.34 src/pop.c; ) > 1.9.6cvs50.patchset
index 103f7f53085caecd9186385ce5b3ba6f1b98d330..fa9e5ce2fd0bcc12e9af0987bd49d4be5a459046 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=6
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=49
+EXTRA_VERSION=50
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 57d565a1730a4cf4746ed9b0137a85f605392fb6..fb28994f4add5f48135c27184f80ebfea4fc21e5 100644 (file)
@@ -72,7 +72,10 @@ int partial_msg_in_uidl_list(MsgInfo *msginfo)
        time_t recv_time;
        time_t now;
        gint partial_recv;
+       gchar *sanitized_uid = g_strdup(msginfo->account_login);
        
+       subst_for_filename(sanitized_uid);
+
        if (!msginfo->account_server
        ||  !msginfo->account_login
        ||  !msginfo->partial_recv)
@@ -86,13 +89,15 @@ int partial_msg_in_uidl_list(MsgInfo *msginfo)
                g_free(path);
                path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                                   "uidl-", msginfo->account_server,
-                                  "-", msginfo->account_login, NULL);
+                                  "-", sanitized_uid, NULL);
                if ((fp = fopen(path, "rb")) == NULL) {
                        if (ENOENT != errno) FILE_OP_ERROR(path, "fopen");
+                       g_free(sanitized_uid);
                        g_free(path);
                        return FALSE;
                }
        }
+       g_free(sanitized_uid);
        g_free(path);
 
        now = time(NULL);
@@ -134,9 +139,13 @@ static int partial_uidl_mark_mail(MsgInfo *msginfo, int download)
        int start = TRUE;
        gchar partial_recv[POPBUFSIZE];
        int err = -1;
-
        gchar *filename;
        MsgInfo *tinfo;
+       gchar *sanitized_uid = g_strdup(tinfo->account_login);
+       
+       subst_for_filename(sanitized_uid);
+       
+
        filename = procmsg_get_message_file_path(msginfo);
        if (!filename) {
                g_warning("can't get message file path.\n");
@@ -151,7 +160,8 @@ static int partial_uidl_mark_mail(MsgInfo *msginfo, int download)
        }
        path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                           "uidl", G_DIR_SEPARATOR_S, tinfo->account_server,
-                          "-", tinfo->account_login, NULL);
+                          "-", sanitized_uid, NULL);
+
        if ((fp = fopen(path, "rb")) == NULL) {
                perror("fopen1");
                if (ENOENT != errno) FILE_OP_ERROR(path, "fopen");
@@ -168,7 +178,10 @@ static int partial_uidl_mark_mail(MsgInfo *msginfo, int download)
 
        pathnew = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                           "uidl", G_DIR_SEPARATOR_S, tinfo->account_server,
-                          "-", tinfo->account_login, ".new", NULL);
+                          "-", sanitized_uid, ".new", NULL);
+       
+       g_free(sanitized_uid);
+
        if ((fpnew = fopen(pathnew, "wb")) == NULL) {
                perror("fopen2");
                fclose(fp);
@@ -321,22 +334,27 @@ gchar *partial_get_filename(const gchar *server, const gchar *login,
        time_t recv_time;
        time_t now;
        gint partial_recv;
-       
+       gchar *sanitized_uid = g_strdup(login); 
+
+       subst_for_filename(sanitized_uid);
+
        path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                           "uidl", G_DIR_SEPARATOR_S, 
-                          server, "-", login, NULL);
+                          server, "-", sanitized_uid, NULL);
        if ((fp = fopen(path, "rb")) == NULL) {
                if (ENOENT != errno) FILE_OP_ERROR(path, "fopen");
                g_free(path);
                path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                                   "uidl-", server,
-                                  "-", login, NULL);
+                                  "-", sanitized_uid, NULL);
                if ((fp = fopen(path, "rb")) == NULL) {
                        if (ENOENT != errno) FILE_OP_ERROR(path, "fopen");
+                       g_free(sanitized_uid);
                        g_free(path);
                        return result;
                }
        }
+       g_free(sanitized_uid);
        g_free(path);
 
        now = time(NULL);
index 0742da51169a630d1bf9ce10e16bd9b3244079e4..9daf02b597e841296aa04c25d531d6837bd9695a 100644 (file)
--- a/src/pop.c
+++ b/src/pop.c
@@ -563,13 +563,18 @@ void pop3_get_uidl_table(PrefsAccount *ac_prefs, Pop3Session *session)
        time_t recv_time;
        time_t now;
        gint partial_recv;
+       gchar *sanitized_uid = g_strdup(ac_prefs->userid);
+       
+       subst_for_filename(sanitized_uid);
        
        table = g_hash_table_new(g_str_hash, g_str_equal);
        partial_recv_table = g_hash_table_new(g_str_hash, g_str_equal);
 
        path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                           "uidl", G_DIR_SEPARATOR_S, ac_prefs->recv_server,
-                          "-", ac_prefs->userid, NULL);
+                          "-", sanitized_uid, NULL);
+                          
+       g_free(sanitized_uid);
        if ((fp = fopen(path, "rb")) == NULL) {
                if (ENOENT != errno) FILE_OP_ERROR(path, "fopen");
                g_free(path);
@@ -633,13 +638,20 @@ gint pop3_write_uidl_list(Pop3Session *session)
        FILE *fp;
        Pop3MsgInfo *msg;
        gint n;
+       gchar *sanitized_uid = g_strdup(session->ac_prefs->userid);
+       
+       subst_for_filename(sanitized_uid);
+       
 
        if (!session->uidl_is_valid) return 0;
 
        path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                           "uidl", G_DIR_SEPARATOR_S,
                           session->ac_prefs->recv_server,
-                          "-", session->ac_prefs->userid, NULL);
+                          "-", sanitized_uid, NULL);
+       
+       g_free(sanitized_uid);
+
        if ((fp = fopen(path, "wb")) == NULL) {
                FILE_OP_ERROR(path, "fopen");
                g_free(path);