summaryrefslogtreecommitdiffstats
path: root/CommandListener.cpp
diff options
context:
space:
mode:
authorKen Sumrall <ksumrall@android.com>2011-01-14 15:20:02 -0800
committerKen Sumrall <ksumrall@android.com>2011-01-14 15:20:02 -0800
commit6864b7ec94a57b73c300457955d86dc604aeddf5 (patch)
treed880913083f0bf9e4fc41ccb06b9460e1f2043c8 /CommandListener.cpp
parent2eaf7138528d30c331d83ab8346a97e66b5499e2 (diff)
downloadsystem_vold-6864b7ec94a57b73c300457955d86dc604aeddf5.zip
system_vold-6864b7ec94a57b73c300457955d86dc604aeddf5.tar.gz
system_vold-6864b7ec94a57b73c300457955d86dc604aeddf5.tar.bz2
Change the cryptfs command to separate out checking the password and restarting
In order to make the animations and the UI look right, we need to change the cryptfs checkpw command to return a status if the password was correct or not, and not have it automatically restart if it's correct. There is a new command restart that will restart the framework with the encrypted filesystem. Change-Id: Ia8ae00d7ed8667699aa58d05ad8ba953cca9316e
Diffstat (limited to 'CommandListener.cpp')
-rw-r--r--CommandListener.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/CommandListener.cpp b/CommandListener.cpp
index ac46ac9..c38a6d1 100644
--- a/CommandListener.cpp
+++ b/CommandListener.cpp
@@ -529,6 +529,12 @@ int CommandListener::CryptfsCmd::runCommand(SocketClient *cli,
return 0;
}
rc = cryptfs_check_passwd(argv[2]);
+ } else if (!strcmp(argv[1], "restart")) {
+ if (argc != 2) {
+ cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: cryptfs restart", false);
+ return 0;
+ }
+ rc = cryptfs_restart();
} else if (!strcmp(argv[1], "enablecrypto")) {
if ( (argc != 4) || (strcmp(argv[2], "wipe") && strcmp(argv[2], "inplace")) ) {
cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: cryptfs enablecrypto <wipe|inplace> <passwd>", false);