ChainsDD / su-binary

su binary for android Superuser
Other
452 stars 320 forks source link

Fix potential security flaw in creation of sockets/directories #4

Closed git-core closed 12 years ago

git-core commented 12 years ago

See commit 8dc2877f8dbdf4161c394c28e714ee3efd645cf5

Well, I fixed last bit I didn't like in su-binary as promised. There is more stuff to fix:

  1. Move Requestor cache dir to /dev (requires change in corresponding macro only) Thus, su-binary won't touch flash, /dev is tmpfs nowadays
  2. Rearrange db code su-binary acess db only once, so db open/close can be moved to database_check
  3. Drop mktemp so gcc stops complaining about "unsafe" function The socket is created once per su invocation. We can use pid in the socket name. It's neither "safer" nor "weaker" If you'll agree to accept mentioned changes I could prepare the patches.
ChainsDD commented 12 years ago

I'll test this when I get home. If we could discuss some more things over gtalk, I'd really appreciate it, I could use some help with a couple of things.

ChainsDD commented 12 years ago

Works in my testing, will send a couple builds out to my testers to see how it works for them before merging it. Doesn't seem to affect too much, so I don't see there being any issues.