/[mailutils]/mailutils/mailbox/imap/folder.c
ViewVC logotype

Diff of /mailutils/mailbox/imap/folder.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.62 by gray, Wed Sep 10 14:06:52 2003 UTC revision 1.63 by gray, Wed Sep 10 21:50:51 2003 UTC
# Line 180  authenticate_imap_login (authority_t aut Line 180  authenticate_imap_login (authority_t aut
180            }            }
181    
182          if (f_imap->user == NULL)          if (f_imap->user == NULL)
183            {            return MU_ERR_NOUSERNAME;
184              CHECK_ERROR_CLOSE (folder, f_imap, MU_ERR_NOUSERNAME);            
           }  
185          if (f_imap->passwd == NULL)          if (f_imap->passwd == NULL)
186            {            return MU_ERR_NOPASSWORD;
187              CHECK_ERROR_CLOSE (folder, f_imap, MU_ERR_NOPASSWORD);            
188            }          status = imap_writeline (f_imap, "g%u LOGIN \"%s\" \"%s\"\r\n",
         status = imap_writeline (f_imap, "g%u LOGIN %s \"%s\"\r\n",  
189                                   f_imap->seq, f_imap->user, f_imap->passwd);                                   f_imap->seq, f_imap->user, f_imap->passwd);
190          CHECK_ERROR_CLOSE(folder, f_imap, status);          CHECK_ERROR_CLOSE(folder, f_imap, status);
191          FOLDER_DEBUG2 (folder, MU_DEBUG_PROT, "g%u LOGIN %s *\n",          FOLDER_DEBUG2 (folder, MU_DEBUG_PROT, "g%u LOGIN %s *\n",
192              f_imap->seq, f_imap->user);                         f_imap->seq, f_imap->user);
193          f_imap->seq++;          f_imap->seq++;
194          free (f_imap->user);          free (f_imap->user);
195          f_imap->user = NULL;          f_imap->user = NULL;
# Line 213  authenticate_imap_login (authority_t aut Line 211  authenticate_imap_login (authority_t aut
211      case IMAP_LOGIN_ACK:      case IMAP_LOGIN_ACK:
212        /* Get the login ack.  */        /* Get the login ack.  */
213        status = imap_parse (f_imap);        status = imap_parse (f_imap);
214        CHECK_EAGAIN (f_imap, status);        if (status)
215            return status;
216        FOLDER_DEBUG0 (folder, MU_DEBUG_PROT, f_imap->buffer);        FOLDER_DEBUG0 (folder, MU_DEBUG_PROT, f_imap->buffer);
217        f_imap->state = IMAP_AUTH_DONE;        f_imap->state = IMAP_AUTH_DONE;
218    
# Line 369  find_auth_method (const char *name) Line 368  find_auth_method (const char *name)
368  static int  static int
369  authenticate_imap_select (authority_t auth)  authenticate_imap_select (authority_t auth)
370  {  {
371      folder_t folder = authority_get_owner (auth);
372      f_imap_t f_imap = folder->data;
373    struct auth_tab *p;    struct auth_tab *p;
374    int status;    int status = MU_ERR_AUTH_FAILURE;
375        
376    for (p = auth_tab; status && p->name; p++)    for (p = auth_tab; status && p->name; p++)
377      status = p->method (auth);      {
378          f_imap->state = IMAP_AUTH;
379          status = p->method (auth);
380        }
381    
382    return status;    return status;
383  }  }
# Line 2457  imap_parse (f_imap_t f_imap) Line 2461  imap_parse (f_imap_t f_imap)
2461                    observable_t observable = NULL;                    observable_t observable = NULL;
2462                    folder_get_observable (f_imap->folder, &observable);                    folder_get_observable (f_imap->folder, &observable);
2463                    observable_notify (observable, MU_EVT_AUTHORITY_FAILED);                    observable_notify (observable, MU_EVT_AUTHORITY_FAILED);
2464                      status = MU_ERR_AUTH_FAILURE;
2465                  }                  }
2466                  else
2467                    status = EINVAL;
2468                mu_error ("NO/Bad Tagged: %s %s\n", response, remainder);                mu_error ("NO/Bad Tagged: %s %s\n", response, remainder);
               status = EINVAL;  
2469              }              }
2470          }          }
2471        f_imap->ptr = f_imap->buffer;        f_imap->ptr = f_imap->buffer;

Legend:
Removed from v.1.62  
changed lines
  Added in v.1.63

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26