A
A
Akmal Kadirov2014-08-02 20:03:25
linux
Akmal Kadirov, 2014-08-02 20:03:25

How to write a file under the superuser name in PL C?

The matter is that I create application with the interface and at certain actions the rights of the superuser are necessary. Well, let's say for configuring apache. And for other actions it is not necessary. Logically, I want to do this: when setting up Apache, ask for the password from the superuser, then edit the file on behalf of the root. Actually the question is: how to write a file under root in C?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xandox, 2014-08-02
@kadirov

look towards gksudo, fork, execl

E
egor_nullptr, 2014-08-02
@egor_nullptr

man7.org/linux/man-pages/man2/setuid.2.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question