]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
driverless: Unlink temporary file 220/head
authorMichael Hanselmann <public@hansmi.ch>
Sun, 15 Mar 2020 19:49:31 +0000 (20:49 +0100)
committerMichael Hanselmann <public@hansmi.ch>
Sun, 15 Mar 2020 19:49:31 +0000 (20:49 +0100)
The call to unlink(2) in "driverless" used the wrong variable,
triggering a silent failure (ENAMETOOLONG), and leaving a temporary file
behind.

utils/driverless.c

index 08c0bb88936a11c2cfe4b71b627539b9f1f3b28a..1bfab121b474414c8e3e021753a2e7fafafcf98d 100644 (file)
@@ -548,7 +548,7 @@ generate_ppd (const char *uri)
   while ((bytes = read(fd, buffer, sizeof(buffer))) > 0)
     bytes = fwrite(buffer, 1, bytes, stdout);
   close(fd);
-  unlink(buffer);
+  unlink(ppdname);
 
   return 0;