You need to sign in or sign up before continuing.
Free/busy queries don't work correctly when two users have same email address
Problem reported by Ján Koštial:
Davical server is not working correctly when two users have the same email address.
I have installed davical and I have created two accounts for me. One as admin, one as normal user. Both have the same email.
Problem was with freebusy query. Davical server response was ERROR: 3.8 No authority. Granted privileges were ok.
Via debugging I found that query to fetch privileges always returns two rows (due to two identical emails).
[Sun Nov 23 00:37:53.133729 2014] [:error] [pid 2314] [client 127.0.0.1:35260] davical: LOG: POST: Query: DBGQ: SELECT pprivs(:session_principal::int8,principal_id,:scan_depth::int) AS p, username FROM usr JOIN principal USING(user_no) WHERE lower(usr.email) = lower(:email)
[Sun Nov 23 00:37:53.133793 2014] [:error] [pid 2314] [client 127.0.0.1:35260] davical: LOG: POST: Query: DBGQ: ":session_principal" => "1001"
[Sun Nov 23 00:37:53.133832 2014] [:error] [pid 2314] [client 127.0.0.1:35260] davical: LOG: POST: Query: DBGQ: ":scan_depth" => "2"
[Sun Nov 23 00:37:53.133870 2014] [:error] [pid 2314] [client 127.0.0.1:35260] davical: LOG: POST: Query: DBGQ: ":email" => "jan@kostial.sk"
[Sun Nov 23 00:37:53.137113 2014] [:error] [pid 2314] [client 127.0.0.1:35260] davical: LOG: POST: Query: DBGQ: Took: 0.003084 to find 2 rows.
[Sun Nov 23 00:37:53.137276 2014] [:error] [pid 2314] [client 127.0.0.1:35260] davical: LOG: POST: Query: DBGQ: SELECT pprivs(:session_principal::int8,principal_id,:scan_depth::int) AS p, username FROM usr JOIN principal USING(user_no) WHERE usr.email = :email
[Sun Nov 23 00:37:53.137322 2014] [:error] [pid 2314] [client 127.0.0.1:35260] davical: LOG: POST: Query: DBGQ: ":session_principal" => "1001"
[Sun Nov 23 00:37:53.137361 2014] [:error] [pid 2314] [client 127.0.0.1:35260] davical: LOG: POST: Query: DBGQ: ":scan_depth" => "2"
[Sun Nov 23 00:37:53.137397 2014] [:error] [pid 2314] [client 127.0.0.1:35260] davical: LOG: POST: Query: DBGQ: ":email" => "jan@kostial.sk"
[Sun Nov 23 00:37:53.138874 2014] [:error] [pid 2314] [client 127.0.0.1:35260] davical: LOG: POST: Query: DBGQ: Took: 0.001335 to find 2 rows.
Freebusy query failed because first returned row was related to admin (not to my normal account). Most probably other functions are affected too.
I solved this problem by changing email address of admin. But in the future it will be good to solve this by davical update.