~james-page/ubuntu/raring/dovecot/autopkgtest

« back to all changes in this revision

Viewing changes to src/util/script-login.c

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-06-11 11:11:54 UTC
  • mfrom: (1.15.2) (4.1.27 sid)
  • Revision ID: package-import@ubuntu.com-20120611111154-678cwbdj6ktgsv1h
Tags: 1:2.1.7-1ubuntu1
* Merge from Debian unstable, remaining changes:
  + Add mail-stack-delivery package:
    - Update d/rules
    - d/control: convert existing dovecot-postfix package to a dummy
      package and add new mail-stack-delivery package.
    - Update maintainer scripts.
    - Rename d/dovecot-postfix.* to debian/mail-stack-delivery.*
    - d/mail-stack-delivery.preinst: Move previously installed backups and
      config files to a new package namespace.
    - d/mail-stack-delivery.prerm: Added to handle downgrades.
  + Use Snakeoil SSL certificates by default:
    - d/control: Depend on ssl-cert.
    - d/dovecot-core.postinst: Relax grep for SSL_* a bit.
  + Add autopkgtest to debian/tests/*.
  + Add ufw integration:
    - d/dovecot-core.ufw.profile: new ufw profile.
    - d/rules: install profile in dovecot-core.
    - d/control: dovecot-core - suggest ufw.
  + d/{control,rules}: enable PIE hardening.
  + d/dovecot-core.dirs: Added usr/share/doc/dovecot-core
  + Add apport hook:
    - d/rules, d/source_dovecot.py
  + Add upstart job:
    - d/rules, d/dovecot-core.dovecot.upstart, d/control,
      d/dovecot-core.dirs, dovecot-imapd.{postrm, postinst, prerm},
      d/dovecot-pop3d.{postinst, postrm, prerm}.
      d/mail-stack-deliver.postinst: Convert init script to upstart.
  + d/control: Added Pre-Depends: dpkg (>= 1.15.6) to dovecot-dbg to support
    xz compression in Ubuntu.
  + d/control: Demote dovecot-common Recommends: to Suggests: to prevent
    install of extra packages on upgrade.
  + d/patches/dovecot-drac.patch: Updated with version for dovecot >= 2.0.0.
  + d/control: Drop B-D on systemd.
* Dropped changes:
  + d/patches/fix-racey-restart.patch: part of 2.1.x, no longer required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2009-2011 Dovecot authors, see the included COPYING file */
 
1
/* Copyright (c) 2009-2012 Dovecot authors, see the included COPYING file */
2
2
 
3
3
#include "lib.h"
4
4
#include "env-util.h"
79
79
        if (fd == -1)
80
80
                i_fatal("client fd not received");
81
81
 
 
82
        alarm(0);
 
83
 
82
84
        /* put everything to environment */
83
85
        env_clean();
84
86
        keys = t_str_new(256);
85
 
        args = t_strsplit(data_line, "\t");
 
87
        args = t_strsplit_tab(data_line);
86
88
 
87
89
        if (str_array_length(args) < 3)
88
90
                i_fatal("Missing input fields");
175
177
        }
176
178
        str_append_c(reply, '\n');
177
179
 
 
180
        /* finish by sending the fd to the mail process */
178
181
        ret = fd_send(SCRIPT_COMM_FD, STDOUT_FILENO,
179
182
                      str_data(reply), str_len(reply));
180
 
        if (ret < 0)
181
 
                i_fatal("fd_send() failed: %m");
182
 
        else if (ret != (ssize_t)str_len(reply))
183
 
                i_fatal("fd_send() sent partial output");
 
183
        if (ret == (ssize_t)str_len(reply)) {
 
184
                /* success */
 
185
        } else {
 
186
                if (ret < 0)
 
187
                        i_error("fd_send() failed: %m");
 
188
                else
 
189
                        i_error("fd_send() sent partial output");
 
190
                /* exit with 0 even though we failed. non-0 exit just makes
 
191
                   master log an unnecessary error. */
 
192
        }
184
193
}
185
194
 
186
195
int main(int argc, char *argv[])