Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ROOT_MOUNT_MASTER status #157

Closed
vvb2060 opened this issue Jul 8, 2023 · 1 comment · Fixed by #158
Closed

Remove ROOT_MOUNT_MASTER status #157

vvb2060 opened this issue Jul 8, 2023 · 1 comment · Fixed by #158

Comments

@vvb2060
Copy link
Contributor

vvb2060 commented Jul 8, 2023

STDIN.write(("readlink /proc/1/ns/mnt\n").getBytes(UTF_8));
STDIN.flush();
String s2 = br.readLine();

We can't be sure that readlink /proc/1/ns/mnt command will return content. If the standard output has no content (maybe in error output, or nothing at all), then readLine() will block.

https://github.com/topjohnwu/Magisk/blob/4856da1584c16f5c7387efcefe255c21a1978233/native/src/core/su/su.cpp#L38

    "  -t, --target PID              PID to take mount namespace from\n"

MagiskSU now supports setns, this check has lost its meaning. I don't think anyone really cares about state other than root, so this check can be removed. libsu should do as little as possible and leave any additional requirements to the developers themselves.

@vvb2060
Copy link
Contributor Author

vvb2060 commented Jul 8, 2023

may be related #147 topjohnwu/Magisk#7021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant