freeradius-server
freeradius-server copied to clipboard
Pipe facility for logging modules.
Issue type
- Questions about the server or its usage should be posted to the users mailing list.
- Remote security exploits MUST be sent to [email protected].
- [ ] Defect - Crash or memory corruption.
- [ ] Defect - Non compliance with a standards document, or incorrect API usage.
- [ ] Defect - Unexpected behaviour (obvious or verified by project member).
- [x] Feature request.
Defect/Feature description
@jimdigriz had a fun idea.
For rlm_detail, rlm_linelog, rlm_logtee, it'd be nice to be able to pipe the output through other utilities for preprocessing/compression.
The idea would be to take an 'exec' xlat expansion, expand it, and use that as a key into a tree of fork()/execve() processes. The log message would then be written to the stdin fd of the process.
Processes would be created if the xlat didn't match a pre-existing process, and cleaned up/closed after a period of inactivity.
Only unsolved problem would be what to do in a threaded environment, I guess have all threads write to the same process? Something like xv probably doesn't implement file locking natively.
@alandekok mentioned that popen() is probably a better fit than execve() as it runs everything in a shell (more pipes).
This is very doable now. We even expose stdin in our async exec API.
This should really be either an rlm_pipe module, or a separate facility for the underlying log functionality.