mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-22 16:07:39 +00:00
Fix clone_attr for newly created dirs
This commit is contained in:
parent
c013a349af
commit
f7e471616d
@ -163,7 +163,7 @@ void module_node::mount() {
|
|||||||
|
|
||||||
void tmpfs_node::mount() {
|
void tmpfs_node::mount() {
|
||||||
string src = mirror_path();
|
string src = mirror_path();
|
||||||
const char *src_path = access(src.data(), F_OK) == 0 ? src.data() : parent()->node_path().data();
|
const char *src_path = access(src.data(), F_OK) == 0 ? src.data() : nullptr;
|
||||||
if (!isa<tmpfs_node>(parent())) {
|
if (!isa<tmpfs_node>(parent())) {
|
||||||
const string &dest = node_path();
|
const string &dest = node_path();
|
||||||
auto worker_dir = worker_path();
|
auto worker_dir = worker_path();
|
||||||
@ -172,12 +172,12 @@ void tmpfs_node::mount() {
|
|||||||
dir_node::mount();
|
dir_node::mount();
|
||||||
VLOGD(skip_mirror() ? "replace" : "move", worker_dir.data(), dest.data());
|
VLOGD(skip_mirror() ? "replace" : "move", worker_dir.data(), dest.data());
|
||||||
xmount(worker_dir.data(), dest.data(), nullptr, MS_MOVE, nullptr);
|
xmount(worker_dir.data(), dest.data(), nullptr, MS_MOVE, nullptr);
|
||||||
clone_attr(src_path, dest.data());
|
clone_attr(src_path ?: parent()->node_path().data(), dest.data());
|
||||||
} else {
|
} else {
|
||||||
const string dest = worker_path();
|
const string dest = worker_path();
|
||||||
// We don't need another layer of tmpfs if parent is tmpfs
|
// We don't need another layer of tmpfs if parent is tmpfs
|
||||||
mkdir(dest.data(), 0);
|
mkdir(dest.data(), 0);
|
||||||
clone_attr(src_path, dest.data());
|
clone_attr(src_path ?: parent()->worker_path().data(), dest.data());
|
||||||
dir_node::mount();
|
dir_node::mount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user