]> Pileus Git - ~andy/fetchmail/commitdiff
Limit damage from bad UIDL handling.
authorEric S. Raymond <esr@thyrsus.com>
Sat, 1 Jul 2000 10:58:23 +0000 (10:58 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Sat, 1 Jul 2000 10:58:23 +0000 (10:58 -0000)
svn path=/trunk/; revision=2921

NEWS
fetchmail.c
fetchmail.h
uid.c

diff --git a/NEWS b/NEWS
index c812dbb18fb8db2bffbc36098d0ba67f287dd804..12c6d4ac1a75bcc6ef2866640034440710876979 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,8 @@
 * Fixed Debian bug #63667, fetchmailconf: doesn't write .fetchmailrc properly.
 * RFC2177 IDLE should now be done even when there are no messages.
 * Joerg Plate's SSL typo fix.
+* Try to limit the damage bad UIDL handling can do by refusing to mess with
+  the UIDL state if there has been an error.
 
 fetchmail-5.4.2 (Wed Jun 28 07:21:04 EDT 2000), 19069 lines:
 
index f2f3cff6eff12ca2e9541b8f44d8e41c03a7bcdb..b1cf9cb8d9d0ac56aab308db6e63cf8b9507ae9c 100644 (file)
@@ -648,8 +648,9 @@ int main(int argc, char **argv)
                querystatus = query_host(ctl);
 
 #ifdef POP3_ENABLE
-               if (!check_only)
-                   uid_end_query(ctl);
+               /* leave the UIDL state alone if there have been any errors */
+               if (!check_only && !querystatus)
+                   uid_swap_lists(ctl);
 #endif  /* POP3_ENABLE */
 
                if (querystatus == PS_SUCCESS)
index 1603f4e6bd62589c00e5623489cca27361908e78..980bd47bb922a58cc51c64f8048aeac8d852624b 100644 (file)
@@ -453,7 +453,7 @@ char *str_find(struct idlist **, int);
 char *idpair_find(struct idlist **, const char *);
 void append_str_list(struct idlist **, struct idlist **);
 void expunge_uids(struct query *);
-void uid_end_query(struct query *);
+void uid_swap_lists(struct query *);
 void write_saved_lists(struct query *, const char *);
 
 /* rcfile_y.y */
diff --git a/uid.c b/uid.c
index cf8a008b51faf602213269f26599979aa75a7f8a..124055199ee756a4e962bbf326c244b895f803a7 100644 (file)
--- a/uid.c
+++ b/uid.c
@@ -424,7 +424,7 @@ void expunge_uids(struct query *ctl)
            idl->val.status.mark = UID_EXPUNGED;
 }
 
-void uid_end_query(struct query *ctl) 
+void uid_swap_lists(struct query *ctl) 
 /* finish a query */
 {
     /* debugging code */