提交 816154d3 编写于 作者: Z zhangqilong

fscrypt:set fscrypt system parameter policy

Signed-off-by: Nzhangqilong <zhangqilong3@huawei.com>
Change-Id: I00da840be774b141e65afcc29afcc102bea335b6
上级 6e56cd25
...@@ -43,6 +43,8 @@ ...@@ -43,6 +43,8 @@
#define ARRAY_LEN(array) (sizeof(array) / (sizeof(array[0]))) #define ARRAY_LEN(array) (sizeof(array) / (sizeof(array[0])))
static const char *g_fscryptPolicyKey = "fscrypt.policy.config";
int GetParamValue(const char *symValue, unsigned int symLen, char *paramValue, unsigned int paramLen) int GetParamValue(const char *symValue, unsigned int symLen, char *paramValue, unsigned int paramLen)
{ {
INIT_CHECK_RETURN_VALUE((symValue != NULL) && (paramValue != NULL) && (paramLen != 0), -1); INIT_CHECK_RETURN_VALUE((symValue != NULL) && (paramValue != NULL) && (paramLen != 0), -1);
...@@ -437,16 +439,13 @@ int FileCryptEnable(char *fileCryptOption) ...@@ -437,16 +439,13 @@ int FileCryptEnable(char *fileCryptOption)
INIT_LOGE("FileCryptEnable:option null"); INIT_LOGE("FileCryptEnable:option null");
return -EINVAL; return -EINVAL;
} }
char *const argv[] = { int ret = SystemWriteParam(g_fscryptPolicyKey, fileCryptOption);
"/system/bin/sdc", if (ret != 0) {
"filecrypt", INIT_LOGE("FileCryptEnable:set fscrypt config failed");
"enable", return ret;
fileCryptOption, }
NULL INIT_LOGI("FileCryptEnable:set fscrypt config success, policy:%s", fileCryptOption);
};
int argc = ARRAY_LEN(argv);
int ret = SyncExecCommand(argc, argv);
INIT_LOGI("FileCryptEnable: end, ret = %d", ret);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册