--- scheduler/job.c.orig 2018-10-04 11:01:52.227572708 +0000 +++ scheduler/job.c 2018-10-04 11:38:55.308279008 +0000 @@ -4778,7 +4778,7 @@ const char *filename; /* Support filename */ #ifdef WITH_LSPP char *audit_message = NULL; /* Audit message string */ - char *printerfile = NULL; /* Device file pointed to by the printer */ + char printerfile[PATH_MAX]; /* Device file pointed to by the printer */ security_id_t clisid; /* SELinux SID for the client */ security_id_t psid; /* SELinux SID for the printer */ context_t printercon; /* Printer's context string */ @@ -4970,14 +4970,13 @@ /* * Perform an access check before printing, but only if the printer starts with /dev/ */ - printerfile = strstr(printer->device_uri, "/dev/"); - if (printerfile == NULL && (strncmp(printer->device_uri, "file:/", 6) == 0)) - printerfile = printer->device_uri + strlen("file:"); + snprintf(printerfile, PATH_MAX, "/etc/cups/ppd/%s.ppd", printer->name ); + printerfile[PATH_MAX]=0; if (printerfile != NULL) { cupsdLogJob(job, CUPSD_LOG_DEBUG, - "Attempting to check access on printer device %s", + "Attempting to check access on printer PPD file %s", printerfile); if (lstat(printerfile, &printerstat) < 0) {