From b8f2c55109ba3651bce47f2ace1ba165b5f22b1b Mon Sep 17 00:00:00 2001 From: Nicolas Iooss Date: Wed, 4 Sep 2019 20:57:07 +0200 Subject: [PATCH] cups: use ([^/]+/)? to match a subdirectory of CUPS configuration It seems that /opt/brother/Printers/ only has one level of directories before a directory named "inf", according to several websites. For example: * https://www.linuxquestions.org/questions/slackware-14/trying-to-add-driver-for-brother-hl-l2300d-4175535636/ * https://forums.opensuse.org/showthread.php/531271-Brother-printer-driver-installs-but-can-t-print/page2 Modify the pattern for /opt/brother/Printers/${MODEL_NAME}/inf in order to only allow at most one level, with "([^/]+/)?". Signed-off-by: Nicolas Iooss --- policy/modules/services/cups.fc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/policy/modules/services/cups.fc b/policy/modules/services/cups.fc index f0b0e1a08..950c288d5 100644 --- a/policy/modules/services/cups.fc +++ b/policy/modules/services/cups.fc @@ -18,7 +18,7 @@ /etc/printcap.* -- gen_context(system_u:object_r:cupsd_rw_etc_t,s0) -/opt/brother/Printers/(.*/)?inf(/.*)? gen_context(system_u:object_r:cupsd_rw_etc_t,s0) +/opt/brother/Printers/([^/]+/)?inf(/.*)? gen_context(system_u:object_r:cupsd_rw_etc_t,s0) /opt/gutenprint/ppds(/.*)? gen_context(system_u:object_r:cupsd_rw_etc_t,s0) /usr/bin/hp-[^/]+ -- gen_context(system_u:object_r:hplip_exec_t,s0)