~ubuntu-branches/ubuntu/maverick/postfix/maverick-security

« back to all changes in this revision

Viewing changes to src/xsasl/xsasl_cyrus_server.c

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones, Wietse Venema, LaMont Jones
  • Date: 2009-06-03 14:17:08 UTC
  • mfrom: (1.1.22 upstream)
  • Revision ID: james.westby@ubuntu.com-20090603141708-o9u59xlor7nmd2x1
[Wietse Venema]

* New upstream release: 2.6.2~rc1

[LaMont Jones]

* move postfix-add-{filter,policy} manpages to section 8, and deliver
* provide: default-mta on ubuntu

Show diffs side-by-side

added added

removed removed

Lines of Context:
154
154
  */
155
155
static void xsasl_cyrus_server_done(XSASL_SERVER_IMPL *);
156
156
static XSASL_SERVER *xsasl_cyrus_server_create(XSASL_SERVER_IMPL *,
157
 
                                                       VSTREAM *,
158
 
                                                       const char *,
159
 
                                                       const char *,
160
 
                                                       const char *);
 
157
                                                XSASL_SERVER_CREATE_ARGS *);
161
158
static void xsasl_cyrus_server_free(XSASL_SERVER *);
162
159
static int xsasl_cyrus_server_first(XSASL_SERVER *, const char *,
163
160
                                            const char *, VSTRING *);
263
260
/* xsasl_cyrus_server_create - create server instance */
264
261
 
265
262
static XSASL_SERVER *xsasl_cyrus_server_create(XSASL_SERVER_IMPL *unused_impl,
266
 
                                                       VSTREAM *stream,
267
 
                                                       const char *service,
268
 
                                                       const char *realm,
269
 
                                                       const char *sec_props)
 
263
                                             XSASL_SERVER_CREATE_ARGS *args)
270
264
{
271
265
    const char *myname = "xsasl_cyrus_server_create";
272
266
    char   *server_address;
277
271
 
278
272
    if (msg_verbose)
279
273
        msg_info("%s: SASL service=%s, realm=%s",
280
 
                 myname, service, realm ? realm : "(null)");
 
274
                 myname, args->service, args->user_realm ?
 
275
                 args->user_realm : "(null)");
281
276
 
282
277
    /*
283
278
     * The optimizer will eliminate code duplication and/or dead code.
311
306
 
312
307
    /*
313
308
     * Don't give any IP address information to SASL.  SASLv1 doesn't use it,
314
 
     * and in SASLv2 this will disable any mechaniams that do.
 
309
     * and in SASLv2 this will disable any mechanisms that do.
315
310
     */
316
311
    server_address = 0;
317
312
    client_address = 0;
318
313
#endif
319
314
 
320
315
    if ((sasl_status =
321
 
         SASL_SERVER_NEW(service, var_myhostname,
322
 
                         realm ? realm : NO_AUTH_REALM,
 
316
         SASL_SERVER_NEW(args->service, var_myhostname,
 
317
                         args->user_realm ? args->user_realm : NO_AUTH_REALM,
323
318
                         server_address, client_address,
324
319
                         NO_SESSION_CALLBACKS, NO_SECURITY_LAYERS,
325
320
                         &sasl_conn)) != SASL_OK) {
339
334
    server->xsasl.next = xsasl_cyrus_server_next;
340
335
    server->xsasl.get_mechanism_list = xsasl_cyrus_server_get_mechanism_list;
341
336
    server->xsasl.get_username = xsasl_cyrus_server_get_username;
342
 
    server->stream = stream;
 
337
    server->stream = args->stream;
343
338
    server->sasl_conn = sasl_conn;
344
339
    server->decoded = vstring_alloc(20);
345
340
    server->username = 0;
346
341
    server->mechanism_list = 0;
347
342
 
348
 
    if (xsasl_cyrus_server_set_security(&server->xsasl, sec_props)
 
343
    if (xsasl_cyrus_server_set_security(&server->xsasl, args->security_options)
349
344
        != XSASL_AUTH_OK)
350
345
        XSASL_CYRUS_SERVER_CREATE_ERROR_RETURN(0);
351
346