X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/866f8763175ff60e4fa455b92b5eb660a12fe6c7..7e6b461318c8a779d91381531435a68ee4e8b6ed:/securityd/src/notifications.cpp diff --git a/securityd/src/notifications.cpp b/securityd/src/notifications.cpp index 8ef8872b..1efed3a5 100644 --- a/securityd/src/notifications.cpp +++ b/securityd/src/notifications.cpp @@ -204,7 +204,7 @@ bool Listener::testPredicate(const std::function SharedMemoryListener::SharedMemoryListener(const char* segmentName, SegmentOffsetType segmentSize, uid_t uid, gid_t gid) : Listener (kNotificationDomainAll, kNotificationAllEvents), SharedMemoryServer (segmentName, segmentSize, uid, gid), - mActive (false) + mActive (false), mMutex() { } @@ -299,10 +299,10 @@ bool SharedMemoryListener::needsPrivacyFilter(Notification *notification) { case kSecUnlockEvent: // kNotificationEventUnlocked case kSecPasswordChangedEvent: // kNotificationEventPassphraseChanged case kSecDefaultChangedEvent: - case kSecDataAccessEvent: case kSecKeychainListChangedEvent: case kSecTrustSettingsChangedEvent: return false; + case kSecDataAccessEvent: case kSecAddEvent: case kSecDeleteEvent: case kSecUpdateEvent: @@ -367,6 +367,7 @@ void SharedMemoryListener::notifyMe(Notification* notification) WriteMessage (notification->domain, notification->event, data, int_cast(length)); + StLock lock(mMutex); if (!mActive) { Server::active().setTimer (this, Time::Interval(kServerWait)); @@ -376,9 +377,10 @@ void SharedMemoryListener::notifyMe(Notification* notification) void SharedMemoryListener::action () { + StLock lock(mMutex); + notify_post (mSegmentName.c_str ()); secinfo("notify", "Posted notification to clients."); secdebug("MDSPRIVACY","[%03d] Posted notification to clients", mUID); - notify_post (mSegmentName.c_str ()); mActive = false; }