romejoe
romejoe

Reputation: 443

iphone run app as root

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?

Upvotes: 1

Views: 1576

Answers (2)

raud0
raud0

Reputation: 21

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

Upvotes: 2

rpetrich
rpetrich

Reputation: 32336

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.

Upvotes: 1

Related Questions