2013年8月26日星期一

android hardware adaptation layer C file called system / bin in 3rdparty executable file, seeking expert doubts

I android hardware adaptation layer C files need to call the system / bin in 3rd party executable file (iwconfig) This is a tool to compile source code library file, similar to the system compiled busybox tools like ping;
question: linux C called for general use tool to perform file system (const char * command); ok
I use in C Int a = system ("iwconfig ......."); implementation of the outcomes have been failures;
But when I use a system busybox compiled by the netcfg ping tools such files really are;

Also, I wrote a C test program, compile the script, the background (adb shell) perform discovery same Int a = system ("iwconfig ....... "); can be successfully

serious doubts permissions problem, ask where I'm going to set in order to solve this problem.


init.rc I tried chmod permissions underneath invalid, the user can also change the use of an invalid; init.rc set below the trigger on .... found This tool does not support the syntax iwconfig

everyone look oh
------ Solution ------------------------------- -------------
execute these commands are required system-level privileges, you certainly not just an application uid, uid of your application should be set to system or root, you use ps look at it to know
------ reference ---------------------------------- -----
following settings in init.rc trigger on .... findings do not support this tool iwconfig syntax , You do not have c test program, and then the script call succeeded yet, and that on the trigger, call your script do?
errno what
------ reference --------------------------------- ------
facie system function failed error code is.
in the system in the iwconfig try to write the whole path, such as system ("/ system / bin / iwconfig ......");
------ reference - -------------------------------------


PS is seen ROOT privileges
------ reference ---------------------------- -----------


Thank niu ~
system after the implementation of the return is a number greater than 0, representative fails to execute this command oh SHELL

------ reference ------------------------------------ ---


brother, do you think using a third party application UID Where should I change Nigeria? init.rc? chown
?
PS I have seen netcfg permissions are inter. . I used the system execution system ("netcfg..."); Able to perform


------ reference ------------------------------------ ---
If you do not enforce it, you can not system to perform their own fork a child process exec this command to see if the problem lies in what step on.
777 direct change to the maximum permissions are not enough, init.rc where you can modify


------ reference ------------------------------------ ---


permission I always gave the maximum 777. May still want to refer to other ways of
------ reference -------------------------------- -------
top one, experts expect to answer questions Permissions
I used c screencast, java called, also had a permissions problem. Later still must be "a key root" software first crack phone, and then call the java executable program, jni did not use up
------ reference ------------- --------------------------
OK! Get!
Sure enough permissions issue, modify the following core system file system permissions! so easy ~ ~

------ reference ------------------------------------ ---
too much overtime, the brain is not flexible. First, from the system returns a value> 0, and the background situation, the command itself is no problem, as mentioned above classmates, shell can be, because this is also a permissions problem. So the question directly to the authority. Think the next system permissions and content correspond. You can think of.
------ reference --------------------------------------- < br> OK! Get!
Sure enough permissions issue, modify the following core system file system permissions! so easy ~ ~
-------------
can tell you specifically what changed, I have system / etc / to add a file, also encountered the same problem.

没有评论:

发表评论