I want to run the app as root
Later on I run the app by an indirect script with running this app with 6755 permission setting which that part works and it runs the app.
MyApp.app/MyApp
MyApp.app/MyApp_
I have MyApp file which is a script as follow :
MyApp.app/MyApp :
#!/bin/bash
dir=$(dirname "$0")
exec "${dir}"/MyApp_ "$@"
Which it runs MyApp_ which is the app to be run as root.
This is the file attribute after I ran ‘chmod 6755 MyApp.app/MyApp_’ on the computer
6755 on computer
-rwsr-sr-x 1 rob staff 817856 Mar 17 01:07 MyApp_
And this is the file attribute when I copy it to the device
( using terminal with scp -rp key )
0755 on the device after copying !!!
-rwxr-xr-x 1 root admin 817856 Mar 17 05:07 MyApp_
How ever when I correct the attributes again on the device it works fine and the MyApp_ runs as root!
But I want to make sure when user installs the app from Cydia and it gets copied via Cydia the same thing does not happen to the user and the MyApp_ attribute doesn’t change back to 0755 which causes the app not to work.
Did you call setuid(0) in main()?