]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Master process leaked one fd to login process. Typically it was listener fd,
authorTimo Sirainen <tss@iki.fi>
Tue, 12 Aug 2008 21:27:26 +0000 (17:27 -0400)
committerTimo Sirainen <tss@iki.fi>
Tue, 12 Aug 2008 21:27:26 +0000 (17:27 -0400)
which caused imap-login processes existing after Dovecot was killed to
keep the port reserved so Dovecot couldn't be started again.

--HG--
branch : HEAD

src/login-common/main.c
src/master/login-process.c

index 97f019d267f6766e571b0619552fe66564c487d4..2a7fee4415c9670a489cd3b198715ad1b121ad9c 100644 (file)
@@ -404,7 +404,7 @@ int main(int argc ATTR_UNUSED, char *argv[], char *envp[])
                env = getenv("SSL_LISTEN_FDS");
                if (env != NULL) i += atoi(env);
 
-               fd_debug_verify_leaks(i + 1, 1024);
+               fd_debug_verify_leaks(i, 1024);
        }
 #endif
        /* clear all allocated memory before freeing it. this makes the login
index 69021d525198c042c0bd17ae3330b4e8be460095..7d529a1112abbe06ea941976f6c3f3a8ef941db3 100644 (file)
@@ -691,7 +691,7 @@ static pid_t create_login_process(struct login_group *group)
                i_fatal("Failed to dup2() fds");
 
        /* don't close any of these */
-       for (tmp_fd = 0; tmp_fd <= cur_fd; tmp_fd++)
+       for (tmp_fd = 0; tmp_fd < cur_fd; tmp_fd++)
                fd_close_on_exec(tmp_fd, FALSE);
 
        (void)close(fd[0]);