rlm_sql_log - directory creation
Attached is a small patch we use to rlm_sql_log to create (one level of) directories automatically. This is because we use sql_log { path = "${radacctdir}/%{%{NAS-IP-Address}:-0.0.0.1}/sql_%Y%m%d.acc" ... } and we don't want to have to remember to create new subdirectories whenever a new NAS comes online. Is this something which might be considered for a future version? Perhaps more generally, any module which writes files could have a flag which enables 'mkdir -p' type functionality? Regards, Brian.
Brian Candler wrote:
Attached is a small patch we use to rlm_sql_log to create (one level of) directories automatically.
There's already a rad_mkdir() function in src/main/util.c. It handles multiple directories, too.
Is this something which might be considered for a future version? Perhaps more generally, any module which writes files could have a flag which enables 'mkdir -p' type functionality?
It's probably better to have an API which says "open file for creation, including any mkdir" Until then, I'll commit a short patch to the v2.1.x branch. Alan DeKok.
participants (2)
-
Alan DeKok -
Brian Candler