Line
Link Here
|
0 |
-- src/server.c |
0 |
++ src/server.c |
Lines 767-786
Link Here
|
767 |
|
767 |
|
768 |
TRACE(TRACE_NOTICE, "starting main service loop for [%s]", conf->service_name); |
768 |
TRACE(TRACE_NOTICE, "starting main service loop for [%s]", conf->service_name); |
769 |
|
769 |
|
770 |
server_conf = conf; |
|
|
771 |
if (db_connect()) { |
772 |
TRACE(TRACE_ERR, "could not connect to database"); |
773 |
return -1; |
774 |
} |
775 |
|
776 |
if (auth_connect()) { |
777 |
TRACE(TRACE_ERR, "could not connect to authentication"); |
778 |
return -1; |
779 |
} |
780 |
srand((int) ((int) time(NULL) + (int) getpid())); |
770 |
srand((int) ((int) time(NULL) + (int) getpid())); |
781 |
|
771 |
|
782 |
TRACE(TRACE_NOTICE, "starting main service loop for [%s]", conf->service_name); |
|
|
783 |
|
784 |
server_conf = conf; |
772 |
server_conf = conf; |
785 |
|
773 |
|
786 |
evthread_use_pthreads(); |
774 |
evthread_use_pthreads(); |
Lines 843-848
Link Here
|
843 |
if (drop_privileges(conf->serverUser, conf->serverGroup) < 0) |
831 |
if (drop_privileges(conf->serverUser, conf->serverGroup) < 0) |
844 |
TRACE(TRACE_WARNING, "unable to drop privileges"); |
832 |
TRACE(TRACE_WARNING, "unable to drop privileges"); |
845 |
|
833 |
|
|
|
834 |
// We cannot usually connect to the DBMS as root, so we do it |
835 |
// after we have dropped root privileges. |
836 |
if (db_connect()) { |
837 |
TRACE(TRACE_ERR, "could not connect to database"); |
838 |
return -1; |
839 |
} |
840 |
|
841 |
if (auth_connect()) { |
842 |
TRACE(TRACE_ERR, "could not connect to authentication"); |
843 |
return -1; |
844 |
} |
845 |
|
846 |
server_pidfile(conf); |
846 |
server_pidfile(conf); |
847 |
|
847 |
|
848 |
if (MATCH(conf->service_name, "IMAP")) |
848 |
if (MATCH(conf->service_name, "IMAP")) |