+ Reply
Results 1 to 2 of 2
  1. #1
    What's Jailbreak?
    Join Date
    Dec 2009
    Location
    Wales, UK
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Run command in Terminal from Application

    Hey guys,

    I have an app that needs to run a command in the terminal.

    The command has to be run as root, but I'm not sure how to do this.

    I am using the standard
    Code:
    system("COMMANDHERE");
    to run the command.

    I would be extremely grateful if any of you guys could shed some light on this topic.

    Thankyou,

    DarkMalloc

  2. #2
    What's Jailbreak?
    Join Date
    Dec 2009
    Posts
    4
    Thanks
    0
    Thanked 1 Time in 1 Post
    You wanted to ask the root password to user and then system("su -c app")?

    Since it has to be jailbroken to even consider running as root, if you deploy it using Cydia, you can include an installation script that would grant your command the suid bit (chmod s+u), so that script would be runnable by user mobile, but would run as root.

    That's the approach I use at least.
    Dunno if there's a more interactive way.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts