I’m running in permissive mode and wanted to clean up the audit errors on a sever.
I was told to run this command:
semanage fcontext -a -t samba_share_t '/shared/TimeMachineAlex2/Alexander’s.MacBook.Air.sparsebundle'
/sbin/setfiles: /var/lib/selinux/final/targeted/contexts/files/file_contexts.local: line 6 error due to: Non-ASCII characters found
I think those file paths are interpreted as regular expressions. If so, you could probably replace that Unicode apostrophe with a period (.) and that should match any character at that place in the filename.
I’m not sure that a period will do what you want. Unless there’ve been some big changes, a question mark (?) is used to represent one character in a string. If a period doesn’t work, try that instead.
Maybe I’m looking at the wrong thing? It looks to me like . is the wildcard character. * means “zero or more”, + means “one or more”, and ? means “zero or one”.
semanage fcontext requires a FILE_SPEC. From man semanage-fcontext.8:
FILE_SPEC may contain either a fully qualified
path, or a Perl compatible regular expression
(PCRE), describing fully qualified path(s).
The only PCRE flag in use is PCRE2_DOTALL,
which causes a wildcard ‘.’ to match anything,
including a new line. Strings representing
paths are processed as bytes (as opposed to
Unicode), meaning that non-ASCII characters
are not matched by a single wildcard.
You may need more than one . to match a non-ASCII glyph.