Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow M4 escaped strings inside QUOTED_STRING #289

Closed

Commits on Aug 20, 2024

  1. Allow M4 escaped strings inside QUOTED_STRING

    When a file name in type transition rule used in an interface is same as
    a keyword, it needs to be M4 escaped so that the keyword is not expanded
    by M4, e.g.
    
    -	filetrans_pattern($1, virt_var_run_t, virtinterfaced_var_run_t, dir, "interface")
    +	filetrans_pattern($1, virt_var_run_t, virtinterfaced_var_run_t, dir, "``interface''")
    
    Fixes:
    
        $ selint ./policy/modules/contrib/virt.if
        Note: Check E-007 is not performed because no permission macro has been parsed.
        ./policy/modules/contrib/virt.if:169: (F): syntax error, unexpected UNKNOWN_TOKEN (F-001)
          169 |     filetrans_pattern($1, virt_var_run_t, virtinterfaced_var_run_t, dir, "``interface''")
              |                                                                          ^
        ./policy/modules/contrib/virt.if:169: (F): Error: Invalid statement (F-001)
          169 |     filetrans_pattern($1, virt_var_run_t, virtinterfaced_var_run_t, dir, "``interface''")
              |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        Error: Failed to parse files
    bachradsusi committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    7f28f7f View commit details
    Browse the repository at this point in the history