Commit b8d316da b8d316da39a011bde86cebae4a9d1eb7672e4c80 by Sergey Poznyakoff

Provide more extensive diagnostics.

1 parent 4dacd0ef
...@@ -162,6 +162,7 @@ pop3d_apop (const char *arg) ...@@ -162,6 +162,7 @@ pop3d_apop (const char *arg)
162 user = pop3d_cmd (arg); 162 user = pop3d_cmd (arg);
163 if (strlen (user) > (POP_MAXCMDLEN - APOP_DIGEST)) 163 if (strlen (user) > (POP_MAXCMDLEN - APOP_DIGEST))
164 { 164 {
165 syslog (LOG_INFO, _("User name too long: %s"), user);
165 free (user); 166 free (user);
166 return ERR_BAD_ARGS; 167 return ERR_BAD_ARGS;
167 } 168 }
...@@ -170,6 +171,8 @@ pop3d_apop (const char *arg) ...@@ -170,6 +171,8 @@ pop3d_apop (const char *arg)
170 password = pop3d_apopuser (user); 171 password = pop3d_apopuser (user);
171 if (password == NULL) 172 if (password == NULL)
172 { 173 {
174 syslog (LOG_INFO, _("Password for `%s' not found in the database"),
175 user);
173 free (user); 176 free (user);
174 free (user_digest); 177 free (user_digest);
175 return ERR_BAD_LOGIN; 178 return ERR_BAD_LOGIN;
...@@ -192,6 +195,7 @@ pop3d_apop (const char *arg) ...@@ -192,6 +195,7 @@ pop3d_apop (const char *arg)
192 195
193 if (strcmp (user_digest, buf)) 196 if (strcmp (user_digest, buf))
194 { 197 {
198 syslog (LOG_INFO, _("APOP failed for `%s'"), user);
195 free (user); 199 free (user);
196 free (user_digest); 200 free (user_digest);
197 return ERR_BAD_LOGIN; 201 return ERR_BAD_LOGIN;
...@@ -206,8 +210,10 @@ pop3d_apop (const char *arg) ...@@ -206,8 +210,10 @@ pop3d_apop (const char *arg)
206 /* Reset the uid. */ 210 /* Reset the uid. */
207 if (auth->change_uid && setuid (auth->uid) == -1) 211 if (auth->change_uid && setuid (auth->uid) == -1)
208 { 212 {
209 mu_auth_data_free (auth); 213 syslog (LOG_INFO, _("cannot change to uid %lu: %m"),
210 return ERR_BAD_LOGIN; 214 (unsigned long) auth->uid);
215 mu_auth_data_free (auth);
216 return ERR_BAD_LOGIN;
211 } 217 }
212 218
213 if ((status = mailbox_create (&mbox, auth->mailbox)) != 0 219 if ((status = mailbox_create (&mbox, auth->mailbox)) != 0
...@@ -220,6 +226,8 @@ pop3d_apop (const char *arg) ...@@ -220,6 +226,8 @@ pop3d_apop (const char *arg)
220 if (mailbox_create (&mbox, "/dev/null") != 0 226 if (mailbox_create (&mbox, "/dev/null") != 0
221 || mailbox_open (mbox, MU_STREAM_READ) != 0) 227 || mailbox_open (mbox, MU_STREAM_READ) != 0)
222 { 228 {
229 syslog (LOG_ERR, _("can't create temporary mailbox: %s"),
230 mu_strerror (status));
223 mu_auth_data_free (auth); 231 mu_auth_data_free (auth);
224 free (mailbox_name); 232 free (mailbox_name);
225 state = AUTHORIZATION; 233 state = AUTHORIZATION;
...@@ -228,6 +236,9 @@ pop3d_apop (const char *arg) ...@@ -228,6 +236,9 @@ pop3d_apop (const char *arg)
228 } 236 }
229 else 237 else
230 { 238 {
239 syslog (LOG_ERR, _("can't open mailbox %s: %s"),
240 auth->mailbox,
241 mu_strerror (status));
231 state = AUTHORIZATION; 242 state = AUTHORIZATION;
232 mu_auth_data_free (auth); 243 mu_auth_data_free (auth);
233 return ERR_MBOX_LOCK; 244 return ERR_MBOX_LOCK;
......