]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
push-notification: Log about unexpectedly failing mailbox functions.
authorTimo Sirainen <tss@iki.fi>
Sun, 27 Sep 2015 18:48:34 +0000 (21:48 +0300)
committerTimo Sirainen <tss@iki.fi>
Sun, 27 Sep 2015 18:48:34 +0000 (21:48 +0300)
Found by Coverity.

src/plugins/push-notification/push-notification-driver-ox.c
src/plugins/push-notification/push-notification-event-mailboxcreate.c

index 31ec603de99aefd72b565976de198592a66c60c4..caaf8f73d19fc8652fa8c98d3f2f40f4ab3fb7f9 100644 (file)
@@ -128,7 +128,11 @@ static const char *push_notification_driver_ox_get_metadata
             success = TRUE;
         }
 
-        mailbox_transaction_commit(&mctx);
+        if (mailbox_transaction_commit(&mctx) < 0) {
+            i_error(OX_LOG_LABEL "Transaction commit failed: %s",
+                    mailbox_get_last_error(inbox, NULL));
+            /* the commit doesn't matter though. */
+        }
     }
 
     mailbox_free(&inbox);
index ef5c37c7dba0819131a1dd9817e268d2484b8405..615dc9816a1cf3a8fdcd56763d8aadf3a7b1f88e 100644 (file)
@@ -26,7 +26,12 @@ static void push_notification_event_mailboxcreate_event(
     struct push_notification_event_mailboxcreate_data *data;
     struct mailbox_status status;
 
-    mailbox_get_status(ptxn->mbox, STATUS_UIDVALIDITY, &status);
+    if (mailbox_get_status(ptxn->mbox, STATUS_UIDVALIDITY, &status) < 0) {
+        i_error(EVENT_NAME "Failed to get created mailbox '%s' uidvalidity: %s",
+                mailbox_get_vname(ptxn->mbox),
+                mailbox_get_last_error(ptxn->mbox, NULL));
+        status.uidvalidity = 0;
+    }
 
     data = p_new(ptxn->pool,
                  struct push_notification_event_mailboxcreate_data, 1);