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

The shell context is always set, even if the su binary does not support it #28

Open
miracle2k opened this issue Dec 16, 2014 · 5 comments

Comments

@miracle2k
Copy link

It seems that the su on CM11 does not support the --context switch.

libsuperuser tests the shell version before using the --context flag. This seems like a sensible thing to do.

@Stericson
Copy link
Owner

Shell Context would be set to the normal context, which would still be the same context that the su binary in CM11 would run in.

If the su binary doesn't support the --context switch then it should simply ignore it. Are you seeing something else?

@miracle2k
Copy link
Author

The su binary in CM11 does not ignore the --context switch, it raises an error that you passed an unknown arguments (the behaviour I would expect).

In my case, I need to run using a different context in the case that SELinux is enabled. Chainfire's latest su binary supports the --context switch because of this. For some reason, CM11 claims that SELinux is enabled, but the su binary shipped does not support --context, and in fact the commands I want to run work fine on CM11.

FWIW I extracted the version checking code from libsuperuser and I'm using it manually now:

https://github.com/miracle2k/android-autostarts/blob/master/src/com/elsdoerfer/android/autostarts/Utils.java#L67

@Stericson
Copy link
Owner

Thanks,

I was unaware of this issue, I will address this and have the code checked in soon.

@Stericson
Copy link
Owner

I've checked in the code and the issue should be resolved.

Can you review the code changes made in Shell.java?

@miracle2k
Copy link
Author

Amazing, thanks! The code looks perfectly good to me.

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

No branches or pull requests

2 participants