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

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: respond to gaurav 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..a70a3f0435c611eee80ad7b92d8825540b1102df 100644
--- a/cryptohomed.cc
+++ b/cryptohomed.cc
@@ -12,6 +12,8 @@
#include <base/logging.h>
#include <chromeos/syslog_logging.h>
+#include "platform.h"
+
// TODO(wad) This is a placeholder DBus service which allows
// chrome-login (and anything else running as chronos)
// to request to mount, unmount, or check if a mapper
@@ -25,11 +27,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 +46,8 @@ 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);
+ cryptohome::Platform platform;
+ int enable_pkcs11_init = platform.FileExists(kEnablePkcs11Path);
gauravsh 2011/04/20 20:39:31 one suggestion: change this to a bool (which is al
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