Chromium Code Reviews| 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"; |