Commit f697923a f697923aaf4a171efe5a074fc064edf415d6643f by Sergey Poznyakoff

Bugfix.

* libmu_cfg/tls.c (cb2_safety_checks): Fix handling of "all" and "none".
* maidag/maidag.c (cb2_forward_file_checks): Likewise.
* maidag/forward.c (maidag_forward): Handle MU_ERR_EXISTS return properly.
1 parent 7b85649a
...@@ -64,9 +64,15 @@ cb2_safety_checks (const char *name, void *data) ...@@ -64,9 +64,15 @@ cb2_safety_checks (const char *name, void *data)
64 name++; 64 name++;
65 65
66 if (strcmp (name, "none") == 0) 66 if (strcmp (name, "none") == 0)
67 val = MU_FILE_SAFETY_NONE; 67 {
68 *res = negate ? MU_FILE_SAFETY_ALL : MU_FILE_SAFETY_NONE;
69 return 0;
70 }
68 else if (strcmp (name, "all") == 0) 71 else if (strcmp (name, "all") == 0)
69 val = MU_FILE_SAFETY_ALL; 72 {
73 *res = negate ? MU_FILE_SAFETY_NONE : MU_FILE_SAFETY_ALL;
74 return 0;
75 }
70 else if (strcmp (name, "default") == 0) 76 else if (strcmp (name, "default") == 0)
71 { 77 {
72 if (data == &tls_settings.ssl_key) 78 if (data == &tls_settings.ssl_key)
......
...@@ -216,7 +216,7 @@ maidag_forward (mu_message_t msg, struct mu_auth_data *auth, char *fwfile) ...@@ -216,7 +216,7 @@ maidag_forward (mu_message_t msg, struct mu_auth_data *auth, char *fwfile)
216 auth, idlist); 216 auth, idlist);
217 if (rc == 0) 217 if (rc == 0)
218 result = process_forward (msg, filename, auth->name); 218 result = process_forward (msg, filename, auth->name);
219 else if (rc) 219 else if (rc == MU_ERR_EXISTS)
220 mu_diag_output (MU_DIAG_NOTICE, 220 mu_diag_output (MU_DIAG_NOTICE,
221 _("skipping forward file %s: already processed"), 221 _("skipping forward file %s: already processed"),
222 filename); 222 filename);
......
...@@ -348,9 +348,15 @@ cb2_forward_file_checks (const char *name, void *data) ...@@ -348,9 +348,15 @@ cb2_forward_file_checks (const char *name, void *data)
348 name++; 348 name++;
349 349
350 if (strcmp (name, "none") == 0) 350 if (strcmp (name, "none") == 0)
351 forward_file_checks = MU_FILE_SAFETY_NONE; 351 {
352 forward_file_checks = negate ? MU_FILE_SAFETY_ALL : MU_FILE_SAFETY_NONE;
353 return 0;
354 }
352 else if (strcmp (name, "all") == 0) 355 else if (strcmp (name, "all") == 0)
353 forward_file_checks = MU_FILE_SAFETY_ALL; 356 {
357 forward_file_checks = negate ? MU_FILE_SAFETY_NONE : MU_FILE_SAFETY_ALL;
358 return 0;
359 }
354 else if (strcmp (name, "default") == 0) 360 else if (strcmp (name, "default") == 0)
355 forward_file_checks = FORWARD_FILE_PERM_CHECK; 361 forward_file_checks = FORWARD_FILE_PERM_CHECK;
356 else if (mu_file_safety_name_to_code (name, &val)) 362 else if (mu_file_safety_name_to_code (name, &val))
......