On Aug 22, 2011, at 10:14 PM, Chris Stratton wrote:

> On Monday, August 22, 2011 5:23:33 PM UTC-4, Steve Modica wrote:
> I would like to use pppd to create a connection to a generic android device.
> I'd like the user to be able to enabled USB debugging, connect to my 
> platform, and then use adb ppp to connect.  
> 
> From what I can tell, the default android kernel supports this. (CONFIG_PPP 
> and the tty has ppp support).
> 
> The problem is that pppd is not setuid.  So it cannot open /dev/tty.  That 
> makes pppd pretty useless unless the phone is rooted.
> 
> Can I create an apk to install a setuid pppd?
> 
> No, you can't.  The partitions an apk can write to are mounted with the 
> setuid bit disabled.  These are things you need to incorporate in a custom 
> build of android - the proper way is likely to have device file created with 
> an appropriate unix-level group to control access - possibly a custom one.
> 
> A "generic android device" doesn't have a tty suitable for connecting to an 
> external device anyway.  Sometimes there's a debug serial port in the 
> hardware, but you would need platform customizations or a non-secured (or 
> broken-into) build in order to access it.
> 
> 

As a test, I rooted my Xoom and made /system/bin/pppd setuid.  I put su on 
there as well.
Afterwards, I flashed boot back to factory and was still able to ppp connect 
with the setuid pppd.  Not sure if that's a left over.  su no longer worked.
The android side is certainly opening /dev/tty OK.  I can post screen shots.  

I like the group access idea. We'll look at that.  I swear I saw apps 
installing that said something like "this app requires superuser access" 
(perhaps sshdroid).  What are those doing?

adb ppp "shell:pppd nodetach noauth noipdefault /dev/tty" nodetach noauth 
noipdefault notty <local-ip>:<remote-ip>

--
Steve Modica
CTO -  Small Tree Communications
www.small-tree.com







-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-kernel

Reply via email to