[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdepimlibs/KDE/4.11] akonadi/calendar: Fix bug where we would send an e-mail with a forged From:
From:       Sergio Martins <iamsergio () gmail ! com>
Date:       2013-10-31 21:53:55
Message-ID: E1Vc0Bf-0001lR-Lg () scm ! kde ! org
[Download RAW message or body]

Git commit 5efe6da97ced262603b1b5b50798c5df76cc0f0d by Sergio Martins.
Committed on 31/10/2013 at 21:48.
Pushed by smartins into branch 'KDE/4.11'.

Fix bug where we would send an e-mail with a forged From:

This case happened when we were not the organizer and then
modified the event. An e-mail would be sent with From: <organizer>,
with *all* participants in CC.

The correct is to not send anything, because the user was already
warned via message boz that the event will become out of sync with
the organizer's.

BUG: 289533
BUG: 318394
FIXED-IN: 4.11.3

M  +4    -3    akonadi/calendar/incidencechanger.cpp
M  +11   -0    akonadi/calendar/tests/itiphandlertest.cpp

http://commits.kde.org/kdepimlibs/5efe6da97ced262603b1b5b50798c5df76cc0f0d

diff --git a/akonadi/calendar/incidencechanger.cpp \
b/akonadi/calendar/incidencechanger.cpp index d07e91b..4cdce51 100644
--- a/akonadi/calendar/incidencechanger.cpp
+++ b/akonadi/calendar/incidencechanger.cpp
@@ -570,9 +570,10 @@ bool IncidenceChanger::Private::handleInvitationsAfterChange( \
const Change::Ptr  {
         if ( !change->originalItems.isEmpty() ) {
           Q_ASSERT( change->originalItems.count() == 1 );
-          Incidence::Ptr oldIncidence = \
                change->originalItems.first().payload<KCalCore::Incidence::Ptr>();
-          Incidence::Ptr newIncidence = \
                change->newItem.payload<KCalCore::Incidence::Ptr>();
-          if ( newIncidence->supportsGroupwareCommunication() ) {
+          Incidence::Ptr oldIncidence = CalendarUtils::incidence( \
change->originalItems.first() ); +          Incidence::Ptr newIncidence = \
CalendarUtils::incidence( change->newItem ); +          if ( \
newIncidence->supportsGroupwareCommunication() && +               \
Akonadi::CalendarUtils::thatIsMe( newIncidence->organizer()->email() ) ) { // If \
we're not the organizer, the user already saw the "Do you really want to do this, \
                incidence will become out of sync"
             if ( mInvitationStatusByAtomicOperation.contains( \
                change->atomicOperationId ) ) {
               handler.setDefaultAction( actionFromStatus( \
mInvitationStatusByAtomicOperation.value( change->atomicOperationId ) ) );  }
diff --git a/akonadi/calendar/tests/itiphandlertest.cpp \
b/akonadi/calendar/tests/itiphandlertest.cpp index c601037..4f0cb43 100644
--- a/akonadi/calendar/tests/itiphandlertest.cpp
+++ b/akonadi/calendar/tests/itiphandlertest.cpp
@@ -435,6 +435,17 @@ void ITIPHandlerTest::testOutgoingInvitations_data()
     expectedEmailCount = 1;
     QTest::newRow("Deletion. We didnt organize.2") << item << changeType << \
                expectedEmailCount << invitationPolicySend;
     //----------------------------------------------------------------------------------------------
 +    // We modified an event which we're not the organizer of.
+    changeType = IncidenceChanger::ChangeTypeModify;
+    item = generateIncidence(uid, /**organizer=*/mia->email());
+    incidence = item.payload<KCalCore::Incidence::Ptr>();
+    incidence->addAttendee(vincent);
+    incidence->addAttendee(jules);
+    us->setStatus(Attendee::Accepted);
+    incidence->addAttendee(us);
+    expectedEmailCount = 0;
+    QTest::newRow("Modification. We didnt organize") << item << changeType << \
expectedEmailCount << invitationPolicyAsk; +    \
//----------------------------------------------------------------------------------------------
  }
 
 void ITIPHandlerTest::testOutgoingInvitations()


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic