The essence of the problem is that you need to kill the process by filepath from the user's access level, for example, from the GUI. Tell me where to dig ....

  • man fuser and do not forget SEE ALSO there. - avp
  • @avp is a terminal utility. I'm interested in the function that can be used in my code ... - Max
  • kill process by filepath - decipher, please. from the user's access level - on behalf of an “ordinary” user, the sigkill signal can be transmitted only to those processes that are owned by this user. - aleksandr barakin
  • The most suitable of the functions seems to me popen, i.e. FILE *in = popen("fuser ...", "r"); . / But, of course, look at the fuser and lsof sorts, maybe there is already something library there. - avp
  • a normal user will never be able to become root, the only possible solution is to launch a separate process by owning an executable file of which will be root and the suid bit will be set in the access rights. In principle, in the suid mode, your entire program can be, but you should be especially careful in this case, because it will perform everything under the root - Mike

0