X-Git-Url: https://git.saurik.com/apple/securityd.git/blobdiff_plain/9b7150daea46853b31f80dffbfc3f6f64cd7a635..4cd1cad0dea00daa03e1b54fdf2797a02373ad5b:/src/database.cpp diff --git a/src/database.cpp b/src/database.cpp index e1e652c..25a7d41 100644 --- a/src/database.cpp +++ b/src/database.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2001 Apple Computer, Inc. All Rights Reserved. + * Copyright (c) 2000-2007 Apple Inc. All Rights Reserved. * * @APPLE_LICENSE_HEADER_START@ * @@ -30,7 +30,9 @@ #include "key.h" #include "server.h" #include "session.h" +#include "notifications.h" #include +#include #include // for default owner ACLs #include #include @@ -65,6 +67,25 @@ Process& Database::process() const { return referent(); } + + +// +// Send a keychain-related notification event about this database +// +void DbCommon::notify(NotificationEvent event, const DLDbIdentifier &ident) +{ + // form the data (encoded DLDbIdentifier) + NameValueDictionary nvd; + NameValueDictionary::MakeNameValueDictionaryFromDLDbIdentifier(ident, nvd); + CssmData data; + nvd.Export(data); + + // inject notification into Security event system + Listener::notify(kNotificationDomainDatabase, event, data); + + // clean up + free (data.data()); +} // @@ -80,6 +101,11 @@ void DbCommon::lockProcessing() // nothing } +bool DbCommon::belongsToSystem() const +{ + return false; +} + void Database::releaseKey(Key &key) { @@ -166,7 +192,7 @@ SecurityServerAcl &Database::acl() CssmError::throwMe(CSSM_ERRCODE_FUNCTION_NOT_IMPLEMENTED); } -bool Database::isLocked() const +bool Database::isLocked() { secdebug("database", "%p calling unimplemented isLocked", this); CssmError::throwMe(CSSM_ERRCODE_FUNCTION_NOT_IMPLEMENTED); @@ -187,11 +213,6 @@ AclKind Database::aclKind() const return dbAcl; } -GenericHandle Database::aclHandle() const -{ - return HandleObject::handle(); -} - // // Remote validation is not, by default, supported