]> Pileus Git - ~andy/fetchmail/commitdiff
Split in rightmost @
authorEric S. Raymond <esr@thyrsus.com>
Sun, 1 Aug 1999 06:47:46 +0000 (06:47 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Sun, 1 Aug 1999 06:47:46 +0000 (06:47 -0000)
svn path=/trunk/; revision=2529

NEWS
uid.c

diff --git a/NEWS b/NEWS
index 578a76ce36ec640ab468e7b6603cbb8f5ba769bf..dbdf1a68e7c1b5ede5e8dad6603894d26e736b7d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -18,6 +18,8 @@ fetchmail-5.0.6 ():
   `username' or `password' keyword, courtesy of Brian Boutel.
 * Interface option fix from Bill Currie.
 * 554 added to default antispam vaklues (for Postfix).
+* In UID files, split on *rightmost* @ as some dialups actually embed
+  @ in usernames.
 
 Warning: CompuServe changed their POP3 system on 31 July 1999.  In doing
 so, they broke fetchmail's RPA support.  Nobody has sent me either code that
diff --git a/uid.c b/uid.c
index 09ea56846a04f25fd07766dec481227899118df6..8c5040f26d4bb5fab8458966422eba1ed3aec483 100644 (file)
--- a/uid.c
+++ b/uid.c
@@ -84,8 +84,17 @@ void initialize_saved_lists(struct query *hostlist, const char *idfile)
 
        while (fgets(buf, POPBUFSIZE, tmpfp) != (char *)NULL)
        {
-           /* possible lossage here with very old versions of sscanf(3)... */
-           if ((st = sscanf(buf, "%[^@]@%s %s\n", user, host, id)) == 3)
+           /*
+            * This inelegant hack was brought to you by the fact that
+            * some dial-up resellers actually use account names with
+            * @ in them.  So we need to split on the rightmost @...
+            */
+           char        *atsign = strrchr(buf, '@');
+
+           if (atsign)
+               *atsign = ' ';
+
+           if ((st = sscanf(buf, "%s %s %s\n", user, host, id)) == 3)
            {
                for (ctl = hostlist; ctl; ctl = ctl->next)
                {