BUG: service(auth) crash when quota-status lookup an address with local-part starting with auth_master_user_separator

2015-09-29 Thread Marco Giunta

Hi,
I'm using dovecot 2.2.15 (configuration attached below), and I 've 
enabled quota-status; when I try to look up the quota status of an 
address with the local-part starting with the same character as 
'auth_master_user_separator', dovecot/auth crash:


My 'auth_master_user_separator' is '*'

# telnet localhost 25001
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
request=smtpd_access_policy
sender=john...@example.com
recipient=*@example.com
size=1

action=DEFER_IF_PERMIT Internal error occurred. Refer to server log for 
more information.


request=smtpd_access_policy
sender=john...@example.com
recipient=*jane...@example.com
size=1

action=DEFER_IF_PERMIT Internal error occurred. Refer to server log for 
more information.


request=smtpd_access_policy
sender=john...@example.com
recipient=;@example.com
size=1

action=DUNNO

request=smtpd_access_policy
sender=john...@example.com
recipient=;jane...@example.com
size=1


and in server log:

Sep 29 08:51:05 my_server dovecot: master: Dovecot v2.2.15 starting up 
for imap, pop3, lmtp, sieve (core dumps disabled)
Sep 29 08:51:05 my_server dovecot: master: Warning: /mnt is no longer 
mounted. See http://wiki2.dovecot.org/Mountpoints
Sep 29 08:51:41 my_server dovecot: auth: Panic: file auth-request.c: 
line 1252 (auth_request_set_login_username): assertion failed: 
(*username != '\0')
Sep 29 08:51:41 my_server dovecot: auth: Error: Raw backtrace: 
/usr/lib64/dovecot/libdovecot.so.0 [0x3d70a7126a] -> 
/usr/lib64/dovecot/libdovecot.so.0 [0x3d70a712d6] -> 
/usr/lib64/dovecot/libdovecot.so.0 [0x3d70a70cac] -> dovecot/auth 
[0x4131eb] -> dovecot/auth(auth_request_set_username+0x94) [0x413284] -> 
dovecot/auth [0x40dc4c] -> dovecot/auth [0x40e60b] -> 
/usr/lib64/dovecot/libdovecot.so.0(io_loop_call_io+0x49) [0x3d70a82699] 
-> /usr/lib64/dovecot/libdovecot.so.0(io_loop_handler_run_internal+0xd5) 
[0x3d70a83a55] -> 
/usr/lib64/dovecot/libdovecot.so.0(io_loop_handler_run+0x9) 
[0x3d70a82739] -> /usr/lib64/dovecot/libdovecot.so.0(io_loop_run+0x38) 
[0x3d70a829b8] -> 
/usr/lib64/dovecot/libdovecot.so.0(master_service_run+0x13) 
[0x3d70a29233] -> dovecot/auth(main+0x383) [0x41cfc3] -> 
/lib64/libc.so.6(__libc_start_main+0xf4) [0x3302e1d9f4] -> dovecot/auth 
[0x40b5f9]
Sep 29 08:51:41 my_server dovecot: quota-status: Error: userdb 
lookup(*@example.com): Disconnected unexpectedly
Sep 29 08:51:41 my_server dovecot: auth: Fatal: master: service(auth): 
child 2147 killed with signal 6 (core dumps disabled)
Sep 29 10:02:02 my_server dovecot: auth: Fatal: master: service(auth): 
child 12592 killed with signal 6 (core dumps disabled)
Sep 29 10:03:52 my_server dovecot: auth: Panic: file auth-request.c: 
line 1252 (auth_request_set_login_username): assertion failed: 
(*username != '\0')
Sep 29 10:03:52 my_server dovecot: auth: Error: Raw backtrace: 
/usr/lib64/dovecot/libdovecot.so.0 [0x3d70a7126a] -> 
/usr/lib64/dovecot/libdovecot.so.0 [0x3d70a712d6] -> 
/usr/lib64/dovecot/libdovecot.so.0 [0x3d70a70cac] -> dovecot/auth 
[0x4131eb] -> dovecot/auth(auth_request_set_username+0x94) [0x413284] -> 
dovecot/auth [0x40dc4c] -> dovecot/auth [0x40e60b] -> 
/usr/lib64/dovecot/libdovecot.so.0(io_loop_call_io+0x49) [0x3d70a82699] 
-> /usr/lib64/dovecot/libdovecot.so.0(io_loop_handler_run_internal+0xd5) 
[0x3d70a83a55] -> 
/usr/lib64/dovecot/libdovecot.so.0(io_loop_handler_run+0x9) 
[0x3d70a82739] -> /usr/lib64/dovecot/libdovecot.so.0(io_loop_run+0x38) 
[0x3d70a829b8] -> 
/usr/lib64/dovecot/libdovecot.so.0(master_service_run+0x13) 
[0x3d70a29233] -> dovecot/auth(main+0x383) [0x41cfc3] -> 
/lib64/libc.so.6(__libc_start_main+0xf4) [0x3302e1d9f4] -> dovecot/auth 
[0x40b5f9]
Sep 29 10:03:52 my_server dovecot: quota-status: Error: userdb 
lookup(*jane...@example.com): Disconnected unexpectedly
Sep 29 10:03:52 my_server dovecot: auth: Fatal: master: service(auth): 
child 9945 killed with signal 6 (core dumps disabled)
Sep 29 10:16:10 my_server dovecot: auth: userdb(?): Username character 
disallowed by auth_username_chars: 0x3b (username: ;@example.com)
Sep 29 10:16:43 my_server dovecot: auth: userdb(?): Username character 
disallowed by auth_username_chars: 0x3b (username: ;jane...@example.com)



If I change my 'auth_master_user_separator' to an other character, for 
example ';' :


# telnet localhost 25001
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
request=smtpd_access_policy
sender=john...@example.com
recipient=*@example.com
size=1

action=DUNNO

request=smtpd_access_policy
sender=john...@example.com
recipient=*jane...@example.com
size=1

action=DUNNO

request=smtpd_access_policy
sender=john...@example.com
recipient=;@example.com
size=1

action=DEFER_IF_PERMIT Internal error occurred. Refer to server log for 
more information.


request=smtpd_access_policy
sender=john...@example.com
recipient=;jane...@example.com
size=1


Re: BUG: service(auth) crash when quota-status lookup an address with local-part starting with auth_master_user_separator

2015-09-29 Thread Timo Sirainen
On 29 Sep 2015, at 11:36, Marco Giunta  wrote:
> 
> Hi,
> I'm using dovecot 2.2.15 (configuration attached below), and I 've enabled 
> quota-status; when I try to look up the quota status of an address with the 
> local-part starting with the same character as 'auth_master_user_separator', 
> dovecot/auth crash:
> 
> My 'auth_master_user_separator' is '*'
> 
> Sep 29 08:51:41 my_server dovecot: auth: Panic: file auth-request.c: line 
> 1252 (auth_request_set_login_username): assertion failed: (*username != '\0')

v2.2.17 fixes this crash, but a better fix would be to disale the separator for 
these lookups. I think something like this would work:

auth_master_user_separator = *
protocol quota-status {
  # disable
  auth_master_user_separator = 
}

or alternatively enable master user separator only for imap:

auth_master_user_separator = 
protocol imap {
  auth_master_user_separator = *
}


Re: BUG: service(auth) crash when quota-status lookup an address with local-part starting with auth_master_user_separator

2015-09-29 Thread Marco Giunta

On 2015-09-29 11:06, Timo Sirainen wrote:

On 29 Sep 2015, at 11:36, Marco Giunta  wrote:

>

but a better fix would be to disale the separator for these lookups. I think 
something like this would work:

auth_master_user_separator = *
protocol quota-status {
   # disable
   auth_master_user_separator =
}



Thank you Timo, this works like a charms on 2.2.16; I'm waiting 2.2.19 
to update my servers.


  Marco


--
 ---
|Marco Giunta - SISSA Computer Staff|
|Via Bonomea, 265   |
|34136 - Trieste, Italy |
|Tel: +39-40-3787-503   |
|Fax: +39-040-3787-244  |
|e-mail: giu...@sissa.it|
 ---