equal
deleted
inserted
replaced
46 |
46 |
47 struct imsgev iev_pop3d; |
47 struct imsgev iev_pop3d; |
48 void *ssl_ctx; |
48 void *ssl_ctx; |
49 |
49 |
50 void |
50 void |
51 pop3_main(int pair[2], struct passwd *pw) |
51 pop3_main(int pair[2], struct passwd *pw, const char *cert, const char *key) |
52 { |
52 { |
53 extern struct session_tree sessions; |
53 extern struct session_tree sessions; |
54 struct event ev_sigint, ev_sigterm; |
54 struct event ev_sigint, ev_sigterm; |
55 pid_t pid; |
55 pid_t pid; |
56 |
56 |
71 signal_add(&ev_sigterm, NULL); |
71 signal_add(&ev_sigterm, NULL); |
72 imsgev_init(&iev_pop3d, pair[1], NULL, pop3d_imsgev, needfd); |
72 imsgev_init(&iev_pop3d, pair[1], NULL, pop3d_imsgev, needfd); |
73 pop3_listen("pop3"); |
73 pop3_listen("pop3"); |
74 |
74 |
75 ssl_init(); |
75 ssl_init(); |
76 if ((ssl_ctx = ssl_setup()) == NULL) |
76 if ((ssl_ctx = ssl_setup(cert, key)) == NULL) |
77 fatal("ssl_setup failed"); |
77 fatal("ssl_setup failed"); |
78 pop3_listen("pop3s"); |
78 pop3_listen("pop3s"); |
79 |
79 |
80 if (chroot(pw->pw_dir) == -1 || chdir("/") == -1) |
80 if (chroot(pw->pw_dir) == -1 || chdir("/") == -1) |
81 fatal("chroot"); |
81 fatal("chroot"); |