I'm testing some debugging tools for C and C++ programs. If you're interested, these tools are: emacs+dap-mode+lldb-vscode (but most likely it's irrelevant for the purposes of this question).
My problem is that C program that was compiled using /usr/bin/clang from inside the jail (i.e. when i did jexec -U user test and went to jail) cannot be debugged (breakpoints do not stop the program). But if I take /usr/bin/clang from the host system (without going inside the jail), then such a binary file can be debugged immediately, breakpoints work and everything works. In both cases, we are talking about the *.c file and its binary file, which have the same location in the jail file system, but in the first case they are compiled by the internal jail's compiler, and in the second case (succesfull) - by the external clang from the host. The fact is that I did not provide any special security options for jail. Here are my settings:
Subsequently, I added the following permission settings to this file:
These settings had no effect.
Of course, I could use host compiler external to the jail. But I need compilers builded in a special way that live inside the jail.
Please, tell me jail or host system settings that would allow debugging files builded by compilers that live inside the jail.
My problem is that C program that was compiled using /usr/bin/clang from inside the jail (i.e. when i did jexec -U user test and went to jail) cannot be debugged (breakpoints do not stop the program). But if I take /usr/bin/clang from the host system (without going inside the jail), then such a binary file can be debugged immediately, breakpoints work and everything works. In both cases, we are talking about the *.c file and its binary file, which have the same location in the jail file system, but in the first case they are compiled by the internal jail's compiler, and in the second case (succesfull) - by the external clang from the host. The fact is that I did not provide any special security options for jail. Here are my settings:
Code:
exec.clean;
exec.start="sh /etc/rc";
exec.stop="sh /etc/rc.shutdown";
ip4=inherit;
mount.devfs;
test {
allow.chflags=1;
path="/test";
}
Subsequently, I added the following permission settings to this file:
Code:
allow.unprivileged_proc_debug=1;
allow.raw_sockets=1;
allow.mlock=1;
allow.read_msgbuf=1;
These settings had no effect.
Of course, I could use host compiler external to the jail. But I need compilers builded in a special way that live inside the jail.
Please, tell me jail or host system settings that would allow debugging files builded by compilers that live inside the jail.