~ubuntu-branches/ubuntu/natty/exim4/natty-updates

« back to all changes in this revision

Viewing changes to src/auths/get_no64_data.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Bienia
  • Date: 2010-01-01 16:28:19 UTC
  • mfrom: (2.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20100101162819-htn71my7yj4v1vkr
Tags: 4.71-3ubuntu1
* Merge with Debian unstable (lp: #501657). Remaining changes:
  + debian/patches/71_exiq_grep_error_on_messages_without_size.dpatch:
    Improve handling of broken messages when "exim4 -bp" (mailq) reports
    lines without size info.
  + Don't declare a Provides: default-mta; in Ubuntu, we want postfix to be
    the default.
  + debian/control: Change build dependencies to MySQL 5.1.
  + debian/{control,rules}: add and enable hardened build for PIE
    (Debian bug 542726).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Cambridge: exim/exim-src/src/auths/get_no64_data.c,v 1.6 2009/11/16 19:50:38 nm4 Exp $ */
 
2
 
 
3
/*************************************************
 
4
*     Exim - an Internet mail transport agent    *
 
5
*************************************************/
 
6
 
 
7
/* Copyright (c) University of Cambridge 1995 - 2009 */
 
8
/* See the file NOTICE for conditions of use and distribution. */
 
9
 
 
10
#include "../exim.h"
 
11
 
 
12
 
 
13
/*************************************************
 
14
*  Issue a non-b64 challenge and get a response  *
 
15
*************************************************/
 
16
 
 
17
/* This function is used by authentication drivers to output a challenge
 
18
to the SMTP client and read the response line. This version does not use base
 
19
64 encoding for the text on the 334 line. It is used by the SPA and dovecot
 
20
authenticators.
 
21
 
 
22
Arguments:
 
23
   aptr       set to point to the response (which is in big_buffer)
 
24
   challenge  the challenge text (unencoded)
 
25
 
 
26
Returns:      OK on success
 
27
              BAD64 if response too large for buffer
 
28
              CANCELLED if response is "*"
 
29
*/
 
30
 
 
31
int
 
32
auth_get_no64_data(uschar **aptr, uschar *challenge)
 
33
{
 
34
int c;
 
35
int p = 0;
 
36
smtp_printf("334 %s\r\n", challenge);
 
37
while ((c = receive_getc()) != '\n' && c != EOF)
 
38
  {
 
39
  if (p >= big_buffer_size - 1) return BAD64;
 
40
  big_buffer[p++] = c;
 
41
  }
 
42
if (p > 0 && big_buffer[p-1] == '\r') p--;
 
43
big_buffer[p] = 0;
 
44
if (Ustrcmp(big_buffer, "*") == 0) return CANCELLED;
 
45
*aptr = big_buffer;
 
46
return OK;
 
47
}
 
48
 
 
49
/* End of get_no64_data.c */