3

This kind of rules works perfect if filename matches exactly one specified at the end of rule, but not with wildcards. The star in the example below does not work. Well, actually it does, but it is treated as a part of filename, not as a "regex"

module test 1.2;


require {
    type unconfined_t;
    type httpd_sys_rw_content_t;
    type usr_t;
    class file {create};
}

type_transition unconfined_t usr_t:file httpd_sys_rw_content_t "test*";
4

It is not possible, as name transitions do not support wildcards/regular experissions. Red Hat documentation has a note regarding this:

Note that file name transition uses an exact match done by the strcmp() function. Use of regular expressions or wildcard characters is not considered.

  • I removed my answer, as this one is more directly related to exactly what the OP was asking. – 0xSheepdog Apr 1 at 16:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.