How to bind to privileged port..? Even su not able to get access..

29 views
Skip to first unread message

Aby Mathews

unread,
Aug 14, 2017, 12:49:43 PM8/14/17
to android-platform

I am trying to add an http server to my custom ROM, which is based on 5.1. I managed to place lighttpd binary in system/xbin via PRODUCT_COPY_FILES , and able to run it successfully in device in eng build. Server in listening to port 80.


But in user build, server is not able to bind to 80.  
I tried various things :  
 - Tried with su.. still permission denied.  
 - Changed su from root:shell to root:root and set setuid/setgid bit   
 -  Disables SELinux   
But no good.  Surprisingly su doesn't have permission to chmod another file in system/xbin.. How come root:root is denied a permission ?

Also tried to change iptables to redirect traffic to 80.. but permission denied.

Is there any alternate method to bind to 80 ? (I have some apps pointing to port 80 as of now.. within few months we will update those.. But but for time being need this.)
Is there a way to edit iptables in AOSP before build ?

Reply all
Reply to author
Forward
0 new messages