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

Unified Diff: cryptohomed.cc

Issue 6883081: cryptohome: look for flag file to determine if init pkcs11 (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/cryptohome.git@master
Patch Set: fix comment Created 9 years, 8 months 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: cryptohomed.cc
diff --git a/cryptohomed.cc b/cryptohomed.cc
index 0ad6be6f10c209dbb80fba4f9cf79e47b40171c2..c05630ff7a8cf499e6159a0c7e6ebf3eaed61963 100644
--- a/cryptohomed.cc
+++ b/cryptohomed.cc
@@ -25,11 +25,12 @@
namespace switches {
// Keeps std* open for debugging
static const char *kNoCloseOnDaemonize = "noclose";
+} // namespace switches
+
// Enable PKCS#11 initialization via cryptohomed
-// TODO(gauravsh): crosbug.com/14277 Remove this flag once this
+// TODO(gauravsh): crosbug.com/14277 Remove this code once this
// feature is stabilized.
-static const char *kEnablePkcs11Init = "cryptohome-init-pkcs11";
-} // namespace switches
+static const char *kEnablePkcs11Path = "/home/chronos/.cryptohome-init-pkcs11";
int main(int argc, char **argv) {
::g_type_init();
@@ -43,7 +44,7 @@ int main(int argc, char **argv) {
int noclose = cl->HasSwitch(switches::kNoCloseOnDaemonize);
PLOG_IF(FATAL, daemon(0, noclose) == -1) << "Failed to daemonize";
- int enable_pkcs11_init = cl->HasSwitch(switches::kEnablePkcs11Init);
+ int enable_pkcs11_init = file_util::PathExists(FilePath(kEnablePkcs11Path));
gauravsh 2011/04/20 18:25:02 Should you use platform.FileExists here?
kmixter1 2011/04/20 19:00:58 Oddly there is none (and I actually tried that fir
cryptohome::Service service(enable_pkcs11_init);
if (!service.Initialize()) {
LOG(FATAL) << "Service initialization failed";
« 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