Results 1 to 3 of 3
Hi,
In user mode [non-root] linux machine, tried to bind a socket by using a "ioctl(iInterfaceSocket, SIOCSIFADDR, &stCommand)". I am getting error 13 -> Permission denied because of user mode. ...
- 05-03-2011 #1Just Joined!
- Join Date
- May 2011
- Posts
- 5
user mode permission denied to bind to socket
Hi,
In user mode [non-root] linux machine, tried to bind a socket by using a "ioctl(iInterfaceSocket, SIOCSIFADDR, &stCommand)". I am getting error 13 -> Permission denied because of user mode. If change from usermode to kernel mode everything works fine.
I need to bind the socket in user mode only, please suggest solution for the above
while explaining the above, if I missed any information please inform, I will provide more info.
Thanks
Eswar
- 05-05-2011 #2Just Joined!
- Join Date
- May 2011
- Posts
- 1
try
setuid(0);
seteuid(0);
- 05-05-2011 #3Just Joined!
- Join Date
- May 2011
- Posts
- 5
Hi,
I am able to solve the problem by the Function capset() set the effective and permitted capabilities of CAP_NET_RAW, CAP_NET_ADMIN. Please find the sample code ethereal.com/lists/ethereal-dev/200309/msg00265.html.
Thanks for everybodies contribution which derived the solution.
Thanks
Eswar


Reply With Quote