Fix QCA android build
ClosedPublic

Authored by ppetrik on Aug 20 2019, 11:37 AM.

Details

Summary

to be able to run Input App (Android), we have to avoid calls to setuid. Otherwise the application coredumps on this call during runtime.

see https://github.com/lutraconsulting/input-sdk/blob/master/android/recipes/qca/recipe.sh

Diff Detail

Repository
R486 QCA Library
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ppetrik requested review of this revision.Aug 20 2019, 11:37 AM
ppetrik created this revision.
sitter accepted this revision.Aug 20 2019, 3:16 PM

What if one is root on android?

I do wonder if drop_root shouldn't simply be made false when the euid isn't 0? I think that setuid call makes no sense on any unix if euid isn't 0.

This revision is now accepted and ready to land.Aug 20 2019, 3:16 PM

Thanks,... normally user does not run application as root on android, so I cannot test that. As for your other question I do not know, ...

Now when the patch is accepted, is there anything else from my side to do, or it will land up in release automatically?

We will need your email address for commit authorship.

Before we land this though, can you try to maybe change it to if ((geteuid() == 0) && drop_root) and see if that fixes the issue as well?
I know android phones can be "rooted", I have not the faintest clue if that means you can actually run +s binaries as root. If you can, then I think getuid() would be more generally correct than disabling the drop entirely for Android. That said, if you tell me that no one will ever do this I will accept that answer too seeing as I have no knowledge on what exactly people do with rooted phones.

ppetrik added a comment.EditedFri, Sep 6, 3:21 PM

my email is zilolv@gmail.com

it looks like if ((geteuid() == 0) && drop_root) works as well

I am not that expert in android dev, so I do not know answer to that root on android question...

This revision was automatically updated to reflect the committed changes.