Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    [Announce] Dalvik resetter + Profile changer for Sailfish

    Reply
    Page 4 of 4 | Prev |   2     3   4 |
    Schturman | # 31 | 2014-02-10, 08:30 | Report

    Originally Posted by meShell View Post
    setuid( 0 )

    It is possible, I am using this "helper" to start my "vpnc" with a GUI-Button, because I did not get a response and did not find any "recommended way to run as privileged" via Sailfis-App.

    So there are 3 steps.
    • compile helper program
    • change owner to root:root
    • change permissions to 4755


    Example (added example with 2 commands seperated by "&&"):

    Code:
    #include <stdio.h>
    #include <stdlib.h>
    #include <sys/types.h>
    #include <unistd.h>
    
    int main()
    {
       setuid( 0 );
       system( "/usr/sbin/vpnc && /sbin/ip route add xxx.xxx.x.0/24 dev tun0);
    
       return 0;
    }
    compiled it with gcc on the phone like this:

    Code:
    gcc vpnc-helper.c -o vpnc-helper
    devel-su
    chown root:root vpnc-helper
    chmod 4755 vpnc-helper
    I have a question, can we do something similar to run command as USER under root? For example, the dbus command I should run as user, but I now under root.
    in N9 it was simple, devel-su user -c "comnand" and it didn't ask about password.
    Can we do something similar on Jolla?
    thanks

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Schturman | # 32 | 2014-02-10, 20:34 | Report

    Ok, found it
    When you are ROOT and if you want to run command that should be run as USER, you can use this command:
    Code:
    su -l nemo -c "your command"

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Page 4 of 4 | Prev |   2     3   4 |
vBulletin® Version 3.8.8
Normal Logout