• 1

write specific file in /var/run

Hi,

thanks for the tip.
I was wondering if it is the alone way to tag files properly in /var/run.

I explain my case:
I have a program running as prog_t.
I have defined a tag prog_varrun_t.
I wrote fc rule: /var/run/prog.pid gen_context(system_u:object_r:prog_varrun_t,s0)


If I do a restorecon -R /var/run, my "prog.pid" get the correct label.

But when my program run. it deletes the pid, recreate it, using directory default tag, i.e. "var_run_t" and not "prog_varrun_t"

So by using your tip I create a:
filetrans_pattern(prog_t, var_run_t, prog_varrun_t, file, "prog.pid")
It works!

But is it the proper way?

Thanks!

  • 1
?

Log in