ogogon
(Ogogon)
June 8, 2024, 5:36am
1
Colleagues, please tell me how to solve my problem - I want the program have set setuid after compilation.
Right now I’m using a very simple CMakeLists.txt:
set (HEADERS ...)
set (SOURCES ...)
add_executable myprog ${HEADERS} ${SOURCES})
target_link_libraries(...)
Thanks in advance for the advice,
Ogogon.
Oodini
June 13, 2024, 11:36am
2
I think it must be down at the installation step.
See the parameter PERMISSIONS of the install()
command.
ogogon
(Ogogon)
June 16, 2024, 11:53am
3
Thank you. I found this in the documentation and did it. Entered PERMISSIONS SETUID .
But this only works when I say make install .
Is it possible to make setuid installed after make ?
Oodini
June 16, 2024, 7:07pm
4
I don’t think so, but I am still learning CMake, so maybe it is possible…
hsattler
(Hendrik Sattler)
June 17, 2024, 7:53am
5
The question is rather if this is a good thing to do. As a normal user, you cannot set an executable as suid-root, only root user can do this. This might need a password during build and this will fail in a non-interactive shell or the prompt drowns in the output.