~ubuntu-branches/ubuntu/hardy/postfix/hardy-security

« back to all changes in this revision

Viewing changes to src/master/trigger_server.c

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2007-04-15 16:00:44 UTC
  • mfrom: (1.1.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20070415160044-xl1vjlhf9mdmf43a
Tags: 2.4.0-3
Have preinst get user approval before installing (and being broken) on a
pre-2.6 kernel.  Closes: #417530

Show diffs side-by-side

added added

removed removed

Lines of Context:
242
242
    int     len;
243
243
 
244
244
    /*
245
 
     * Commit suicide when the master process disconnected from us.
 
245
     * Commit suicide when the master process disconnected from us. Don't
 
246
     * drop the already accepted client request after "postfix reload"; that
 
247
     * would be rude.
246
248
     */
247
249
    if (master_notify(var_pid, trigger_server_generation, MASTER_STAT_TAKEN) < 0)
248
 
        trigger_server_abort(EVENT_NULL_TYPE, EVENT_NULL_CONTEXT);
 
250
         /* void */ ;
249
251
    if (trigger_server_in_flow_delay && mail_flow_get(1) < 0)
250
252
        doze(var_in_flow_delay * 1000000);
251
253
    if ((len = read(fd, buf, sizeof(buf))) >= 0)
313
315
        msg_fatal("select unlock: %m");
314
316
    if (fd < 0) {
315
317
        if (errno != EAGAIN)
316
 
            msg_fatal("accept connection: %m");
 
318
            msg_error("accept connection: %m");
317
319
        if (time_left >= 0)
318
320
            event_request_timer(trigger_server_timeout, (char *) 0, time_left);
319
321
        return;
359
361
        msg_fatal("select unlock: %m");
360
362
    if (fd < 0) {
361
363
        if (errno != EAGAIN)
362
 
            msg_fatal("accept connection: %m");
 
364
            msg_error("accept connection: %m");
363
365
        if (time_left >= 0)
364
366
            event_request_timer(trigger_server_timeout, (char *) 0, time_left);
365
367
        return;
405
407
    char   *oval;
406
408
    char   *generation;
407
409
    int     msg_vstream_needed = 0;
 
410
    int     redo_syslog_init = 0;
408
411
 
409
412
    /*
410
413
     * Process environment options as early as we can.
480
483
            service_name = optarg;
481
484
            break;
482
485
        case 'o':
 
486
            /* XXX Use split_nameval() */
483
487
            if ((oval = split_at(optarg, '=')) == 0)
484
488
                oval = "";
485
489
            mail_conf_update(optarg, oval);
 
490
            if (strcmp(optarg, VAR_SYSLOG_NAME) == 0)
 
491
                redo_syslog_init = 1;
486
492
            break;
487
493
        case 's':
488
494
            if ((socket_count = atoi(optarg)) <= 0)
517
523
     * Initialize generic parameters.
518
524
     */
519
525
    mail_params_init();
 
526
    if (redo_syslog_init)
 
527
        msg_syslog_init(mail_task(var_procname), LOG_PID, LOG_FACILITY);
 
528
 
 
529
    /*
 
530
     * If not connected to stdin, stdin must not be a terminal.
 
531
     */
 
532
    if (daemon_mode && stream == 0 && isatty(STDIN_FILENO)) {
 
533
        msg_vstream_init(var_procname, VSTREAM_ERR);
 
534
        msg_fatal("do not run this command by hand");
 
535
    }
520
536
 
521
537
    /*
522
538
     * Application-specific initialization.
584
600
        user_name = var_mail_owner;
585
601
 
586
602
    /*
587
 
     * If not connected to stdin, stdin must not be a terminal.
588
 
     */
589
 
    if (daemon_mode && stream == 0 && isatty(STDIN_FILENO)) {
590
 
        msg_vstream_init(var_procname, VSTREAM_ERR);
591
 
        msg_fatal("do not run this command by hand");
592
 
    }
593
 
 
594
 
    /*
595
603
     * Can options be required?
596
604
     * 
597
605
     * XXX Initially this code was implemented with UNIX-domain sockets, but