iphone run app as root

混江龙づ霸主 提交于 2019-12-24 18:45:41

问题


I am writing a gui wrapper for gcc for a jailbroken iphone, etc. and it is almost done. However, I get this output when it is run ld: can't open output file for writing : a.out, errno=1 collect2:ld return 1 exit status. I believe this has to do with the privelages the app runs with. I have tried the setuid trick in the cydia developer faq. Can anyone please help?

EDIT
this is the wrapper I am currently using:
#!/usr/bin/bash
dir=$(dirname "$0")
exec "${dir}"/GUI\ GCC_ "$0"

also I used chmod 4777 and changes the owner:group to root:wheel.
Am i doing everything right?


回答1:


It worked when I did it like this:

setuid(0); system("Do root stuff");

// To check who you are system("whoami");

You can install the Package for "ps -U root" to see if you are root, or




回答2:


Be sure your have your setuid binary hidden behind a wrapper that is not setuid. See Cydia or iFile for an example of how it's done.



来源:https://stackoverflow.com/questions/3847239/iphone-run-app-as-root

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!