Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(548)

Unified Diff: chrome/browser/password_manager/password_manager_util_mac.mm

Issue 817333002: Do not use hardcoded identifier in password manager user authorization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/password_manager/password_manager_util_mac.mm
diff --git a/chrome/browser/password_manager/password_manager_util_mac.mm b/chrome/browser/password_manager/password_manager_util_mac.mm
index d4b6adc093486f3348f848300fb42c02e01c8b27..705b94d134da9ec1eeb1eb835482ef99b77e3d1c 100644
--- a/chrome/browser/password_manager/password_manager_util_mac.mm
+++ b/chrome/browser/password_manager/password_manager_util_mac.mm
@@ -10,6 +10,7 @@
#include "base/basictypes.h"
#include "base/mac/authorization_util.h"
+#include "base/mac/bundle_locations.h"
#include "base/mac/foundation_util.h"
#include "base/mac/scoped_authorizationref.h"
#include "chrome/grit/chromium_strings.h"
@@ -18,8 +19,11 @@
namespace password_manager_util {
bool AuthenticateUser(gfx::NativeWindow window) {
+ NSString* identifier = [base::mac::MainBundle() bundleIdentifier];
+ AuthorizationString name =
+ [[identifier stringByAppendingString:@".show-passwords"] UTF8String];
dconnelly 2015/01/08 17:56:36 Don't use [NSString UTF8String]. Use base::SysNSSt
Jiang Jiang 2015/01/08 21:41:58 But I will have to call c_str() out of this still,
dconnelly 2015/01/09 09:06:03 No, this is fine then. git grep shows more uses of
AuthorizationItem right_items[] = {
- {"com.google.Chrome.show-passwords", 0, NULL, 0}
+ {name, 0, NULL, 0}
};
AuthorizationRights rights = {arraysize(right_items), right_items};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698