Languages

Menu
Sites
Language
what function allows to get root access

In the program the rights of the superuser are necessary, I don't know what there is for this purpose a function. Prompt.

Responses

12 Replies
Mango Bar

AFAIK because of security issue you are not allowed to get access of super user.

For any feature related permission you have to add corresponding privilege in your manifest file.

Dmitry Naidolinksy

I need to open socket (AF_PACKET).
 What needs to be added in the manifesto.

Ashish Patil

You need internet previledge.

 

Aashish

Dmitry Naidolinksy
image.png http://tizen.org/privilege/internet
Dmitry Naidolinksy
and it is possible an example where the manifest file is provided. And that my option doesn't work.
Ashish Patil

Right Dmitry.

Ashish Patil

Well in Tizen Studio -> your project in the Project Explorer -> click tizen-manifest.xml -> Previledges add 'http://tizen.org/privilege/internet'.

 

Cheers,

Aashish

Dmitry Naidolinksy

Thanks. But all the same function doesn't work. If to use setuid(0) before function, then setuid(0) the program comes to the end with an error. If to cause from other function, then the error will be in comparing of socket ==-1.

Dmitry Naidolinksy
    if ( (arpspoof = socket ( AF_PACKET, SOCK_RAW, htons ( ETH_P_ARP ) ) )== -1 ){
		perror ( "socket" );
		exit ( -1 );
	}

in this place permanently with an error comes to an end that not so, setuid(0) I add even to functions, all the same doesn't work.

Dmitry Naidolinksy
54    	if ( (arpspoof = socket ( AF_PACKET, SOCK_RAW, htons ( ETH_P_ARP ) ) ) == -1 ){
[New Thread 3336]

Program received signal SIGABRT, Aborted.

There is a detailed error

Dmitry Naidolinksy

drew an error conclusion in the file, and in reply

Operation not permitted

 

Dmitry Naidolinksy

the socket earned everything, delivered through a shell to the suid bit program.