mirror of
https://gitee.com/openharmony/startup_appspawn
synced 2024-11-23 07:00:17 +00:00
fix:Switching user scenarios
Signed-off-by: wangfeng <wangfeng277@huawei.com>
This commit is contained in:
parent
86f90e6cf0
commit
35faf5cdcd
@ -1918,7 +1918,13 @@ static int MountInShared(const AppSpawningCtx *property, const char *rootPath, c
|
||||
return APPSPAWN_ERROR_UTILS_MEM_FAIL;
|
||||
}
|
||||
|
||||
if (access(path, F_OK) == 0) {
|
||||
char currentUserPath[PATH_MAX_LEN] = {0};
|
||||
ret = snprintf_s(currentUserPath, PATH_MAX_LEN, PATH_MAX_LEN - 1, "%s/currentUser", path);
|
||||
if (ret <= 0) {
|
||||
return APPSPAWN_ERROR_UTILS_MEM_FAIL;
|
||||
}
|
||||
|
||||
if (access(currentUserPath, F_OK) == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1947,11 +1953,17 @@ static int SharedMountInSharefs(const AppSpawningCtx *property, const char *root
|
||||
return APPSPAWN_ARG_INVALID;
|
||||
}
|
||||
|
||||
if (access(target, F_OK) == 0) {
|
||||
char currentUserPath[PATH_MAX_LEN] = {0};
|
||||
int ret = snprintf_s(currentUserPath, PATH_MAX_LEN, PATH_MAX_LEN - 1, "%s/currentUser", target);
|
||||
if (ret <= 0) {
|
||||
return APPSPAWN_ERROR_UTILS_MEM_FAIL;
|
||||
}
|
||||
|
||||
if (access(currentUserPath, F_OK) == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ret = MakeDirRec(target, DIR_MODE, 1);
|
||||
ret = MakeDirRec(target, DIR_MODE, 1);
|
||||
if (ret != 0) {
|
||||
return APPSPAWN_SANDBOX_ERROR_MKDIR_FAIL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user