Bug#546695: dovecot-imapd: dovecot epoll fails with -EPERM for dovecot --exec-mail imap at the shell

2009-09-23 Thread Pascal Volk
tags: + patch

hi,

please find attached a dpatch (obtained from Dovecot's hg repo) to
resolve this issue.


Regards,
Pascal
-- 
Ubuntu is an ancient African word meaning “I can’t install Debian.”
 -- unknown
#! /bin/sh /usr/share/dpatch/dpatch-run
##
## DP: Author: Timo Sirainen
## DP: Fix #546695

# Patch obtained from http://hg.dovecot.org/dovecot-1.2/rev/0f04c7da33f1

@DPATCH@
diff -urNad dovecot-1.2.5~/src/master/main.c dovecot-1.2.5/src/master/main.c
--- dovecot-1.2.5~/src/master/main.c2009-09-11 18:25:25.0 +0200
+++ dovecot-1.2.5/src/master/main.c 2009-09-24 02:09:03.0 +0200
@@ -614,8 +614,6 @@
sizeof(ssl_manual_key_password));
} T_END;
 
-   open_std_fds();
-
/* save TZ environment. AIX depends on it to get the timezone
   correctly. */
env_tz = getenv(TZ);
@@ -636,6 +634,9 @@
mail_process_exec(exec_protocol, exec_args);
}
 
+   /* closes stdin/stdout, must be after --exec-mail handling */
+   open_std_fds();
+
/* log all errors to both stderr and log file until we've finished
   startup. */
set_tee_logfile(settings_root-defaults);


Processed: Bug#546695: dovecot-imapd: dovecot epoll fails with -EPERM for dovecot --exec-mail imap at the shell

2009-09-23 Thread Debian Bug Tracking System
Processing commands for cont...@bugs.debian.org:

 tags 546695 patch
Bug #546695 [dovecot-imapd] dovecot-imapd: dovecot epoll fails with -EPERM for 
dovecot --exec-mail imap at the shell
Added tag(s) patch.

End of message, stopping processing here.

Please contact me if you need assistance.

Debian bug tracking system administrator
(administrator, Debian Bugs database)


-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#546695: dovecot-imapd: dovecot epoll fails with -EPERM for dovecot --exec-mail imap at the shell

2009-09-16 Thread Daniel Pittman
Timo Sirainen t...@iki.fi writes:
 On Sep 15, 2009, at 9:10 AM, Daniel Pittman wrote:

 Sep 15 16:03:31 krosp IMAP(daniel): : Fatal: io_loop_handle_add:
 epoll_ctl(1, 0): Operation not permitted

Sorry to take so long to follow up on this.

 Do you have rawlog enabled? IIRC that was the main cause of this.
 Or anything else in mail_executable except the default imap binary?

No, rawlog is disabled, and the only occurrences of mail_executable are
commented out.  Heck, the configuration is almost exclusively barren; the only
non-command and non-whitespace lines are:

,[ /etc/dovecot/dovecot.conf - clean ]
| protocols = imap
| log_timestamp = %Y-%m-%d %H:%M:%S 
| mail_location = dbox:~/.dovecot-mail
| mail_privileged_group = mail
| protocol imap {
| }
| protocol pop3 {
|   pop3_uidl_format = %08Xu%08Xv
| }
| protocol managesieve {
| }
| auth default {
|   mechanisms = plain
|   passdb pam {
|   }
|   userdb passwd {
|   }
|   user = root
| }
| dict {
| }
| plugin {
| }
`

Regards,
Daniel
-- 
✣ Daniel Pittman✉ dan...@rimspace.net☎ +61 401 155 707
   ♽ made with 100 percent post-consumer electrons
   Looking for work?  Love Perl?  In Melbourne, Australia?  We are hiring.



--
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#546695: dovecot-imapd: dovecot epoll fails with -EPERM for dovecot --exec-mail imap at the shell

2009-09-15 Thread Daniel Pittman
Package: dovecot-imapd
Version: 1:1.2.5-1
Severity: grave

I run dovecot directly, without passing through a TCP socket, on my laptop to
provide direct access to a mail spool in my home directory, with preauth:

/usr/sbin/dovecot --exec-mail imap

This previously worked just fine, but now fails as both a privileged and
unprivileged user due to epoll returning -EPERM:

epoll_ctl(6, EPOLL_CTL_ADD, 0, {EPOLLIN|EPOLLPRI|EPOLLERR|EPOLLHUP, 
{u32=9753488, u64=9753488}}) = -1 EPERM (Operation not permitted)

Note that it tries the operation of FD 0, STDIN, which is attached to the
shell in the interactive test, or to a pipe otherwise.

mail.log contains:

Sep 15 16:03:31 krosp IMAP(daniel): : Fatal: io_loop_handle_add: epoll_ctl(1, 
0): Operation not permitted


The only references to this I can find are historic, and suggest this was an
issue elsewhere but is now fixed.

I am running the stock Debian/unstable kernel, nothing special.

Please find attached a full strace of the Dovecot run that fails.


This is pretty serious for me, because it prevents this *documented* mode of
operation from working under, as far as I can tell, any circumstances.

Downgrading to the version from stable, 1.2.24-2, resolves the problem.

Regards,
Daniel

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (101, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.30-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages dovecot-imapd depends on:
ii  dovecot-common1:1.2.5-1  secure mail server that supports m
ii  libc6 2.9-26 GNU C Library: Shared libraries
ii  libssl0.9.8   0.9.8k-5   SSL shared libraries

dovecot-imapd recommends no packages.

dovecot-imapd suggests no packages.

-- no debconf information

-- 
✣ Daniel Pittman✉ dan...@rimspace.net☎ +61 401 155 707
   ♽ made with 100 percent post-consumer electrons
   Looking for work?  Love Perl?  In Melbourne, Australia?  We are hiring.



--
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#546695: dovecot-imapd: dovecot epoll fails with -EPERM for dovecot --exec-mail imap at the shell

2009-09-15 Thread Timo Sirainen

On Sep 15, 2009, at 9:10 AM, Daniel Pittman wrote:

Sep 15 16:03:31 krosp IMAP(daniel): : Fatal: io_loop_handle_add:  
epoll_ctl(1, 0): Operation not permitted


Do you have rawlog enabled? IIRC that was the main cause of this. Or  
anything else in mail_executable except the default imap binary?





--
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org