]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
ippeveprinter.c: Check the created `path` string instead of `command` 629/head
authorZdenek Dohnal <zdohnal@redhat.com>
Thu, 2 Mar 2023 14:11:55 +0000 (15:11 +0100)
committerZdenek Dohnal <zdohnal@redhat.com>
Thu, 2 Mar 2023 14:11:55 +0000 (15:11 +0100)
If a user passes the command by only its name, we have to check the path
string we created instead of command string alone.

tools/ippeveprinter.c

index d3daffafee29ba4d837956349bdfd529723b6176..857ba7cf774e3e86b9d51c2bcbdaabd4472f94dd 100644 (file)
@@ -1634,9 +1634,9 @@ create_printer(
     {
       snprintf(path, sizeof(path), "%s/command/%s", cg->cups_serverbin, command);
 
-      if (access(command, X_OK))
+      if (access(path, X_OK))
       {
-        _cupsLangPrintf(stderr, _("Unable to execute command \"%s\": %s"), command, strerror(errno));
+        _cupsLangPrintf(stderr, _("Unable to execute command \"%s\": %s"), path, strerror(errno));
        return (NULL);
       }