side-channel CUPS_SC_CMD_GET_BIDI command is broken #3029

Closed
michaelrsweet opened this Issue Dec 2, 2008 · 5 comments

Comments

Projects
None yet
1 participant
Collaborator

michaelrsweet commented Dec 2, 2008

Version: 1.3.0
CUPS.org User: mkborg

"Query Printer for Default Options" invoked from web interface makes "filter/commandtops" to complain (into log file):

Unable to auto-configure PostScript Printer - no bidirectional I/O available!

According to source code ("backend/socket.") "socket" backend has unconditional bidirectional support.

Investigation revealed that almost all implementations of side-channel CUPS_SC_CMD_GET_BIDI command forget to return CUPS_SC_STATUS_OK status.

Collaborator

michaelrsweet commented Dec 8, 2008

CUPS.org User: mike

Actually a 1.3.x bug...

Collaborator

michaelrsweet commented Dec 8, 2008

CUPS.org User: mike

Fixed in Subversion repository.

Collaborator

michaelrsweet commented Dec 8, 2008

"get_bidi.patch":

--- ./cups-1.4b1/backend/network.c.ORIG 2008-05-20 02:25:25.000000000 +0400
+++ ./cups-1.4b1/backend/network.c 2008-12-02 20:36:29.000000000 +0300
@@ -104,6 +104,7 @@
case CUPS_SC_CMD_GET_BIDI :
data[0] = use_bc;
datalen = 1;

  •    status = CUPS_SC_STATUS_OK;
     break;
    

    case CUPS_SC_CMD_SNMP_GET :
    --- ./cups-1.4b1/backend/usb-unix.c.ORIG 2008-07-29 05:11:15.000000000 +0400
    +++ ./cups-1.4b1/backend/usb-unix.c 2008-12-02 20:38:17.000000000 +0300
    @@ -582,6 +582,7 @@
    case CUPS_SC_CMD_GET_BIDI :
    data[0] = use_bc;
    datalen = 1;

  •    status = CUPS_SC_STATUS_OK;
     break;
    

    case CUPS_SC_CMD_GET_DEVICE_ID :
    --- ./cups-1.4b1/backend/parallel.c.ORIG 2008-07-29 05:11:15.000000000 +0400
    +++ ./cups-1.4b1/backend/parallel.c 2008-12-02 20:35:17.000000000 +0300
    @@ -655,6 +655,7 @@
    case CUPS_SC_CMD_GET_BIDI :
    data[0] = use_bc;
    datalen = 1;

  •    status = CUPS_SC_STATUS_OK;
     break;
    

    case CUPS_SC_CMD_GET_DEVICE_ID :
    --- ./cups-1.4b1/backend/serial.c.ORIG 2008-06-16 21:39:40.000000000 +0400
    +++ ./cups-1.4b1/backend/serial.c 2008-12-02 20:37:16.000000000 +0300
    @@ -1284,6 +1284,7 @@
    case CUPS_SC_CMD_GET_BIDI :
    data[0] = use_bc;
    datalen = 1;

  •    status = CUPS_SC_STATUS_OK;
     break;
    

    default :
    --- ./cups-1.4b1/backend/usb-libusb.c.ORIG 2008-10-28 00:00:27.000000000 +0300
    +++ ./cups-1.4b1/backend/usb-libusb.c 2008-12-02 20:37:53.000000000 +0300
    @@ -768,6 +768,7 @@
    case CUPS_SC_CMD_GET_BIDI :
    data[0] = 0; /* TODO: Change to 1 when read supported */
    datalen = 1;

  •    status = CUPS_SC_STATUS_OK;
     break;
    

    case CUPS_SC_CMD_GET_DEVICE_ID :

Collaborator

michaelrsweet commented Dec 8, 2008

"str3029-1.3.patch":

Index: backend/usb-unix.c

--- backend/usb-unix.c (revision 8166)
+++ backend/usb-unix.c (working copy)
@@ -592,6 +592,7 @@
break;

 case CUPS_SC_CMD_GET_BIDI :
  • status = CUPS_SC_STATUS_OK;
    data[0] = use_bc;
    datalen = 1;
    break;

Index: backend/serial.c

--- backend/serial.c (revision 8166)
+++ backend/serial.c (working copy)
@@ -1280,6 +1280,7 @@
break;

case CUPS_SC_CMD_GET_BIDI :

  • status = CUPS_SC_STATUS_OK;
    data[0] = use_bc;
    datalen = 1;
    break;

Index: backend/socket.c

--- backend/socket.c (revision 8166)
+++ backend/socket.c (working copy)
@@ -471,6 +471,7 @@
break;

case CUPS_SC_CMD_GET_BIDI :

  • status = CUPS_SC_STATUS_OK;
    data[0] = use_bc;
    datalen = 1;
    break;

Index: backend/parallel.c

--- backend/parallel.c (revision 8166)
+++ backend/parallel.c (working copy)
@@ -639,6 +639,7 @@
break;

case CUPS_SC_CMD_GET_BIDI :

  • status = CUPS_SC_STATUS_OK;
    data[0] = use_bc;
    datalen = 1;
    break;
Collaborator

michaelrsweet commented Dec 8, 2008

"str3029.patch":

Index: backend/usb-libusb.c

--- backend/usb-libusb.c (revision 8166)
+++ backend/usb-libusb.c (working copy)
@@ -766,6 +766,7 @@
break;

 case CUPS_SC_CMD_GET_BIDI :
  • status = CUPS_SC_STATUS_OK;
    data[0] = 0; /* TODO: Change to 1 when read supported */
    datalen = 1;
    break;

Index: backend/usb-unix.c

--- backend/usb-unix.c (revision 8166)
+++ backend/usb-unix.c (working copy)
@@ -598,6 +598,7 @@
break;

case CUPS_SC_CMD_GET_BIDI :

  • status = CUPS_SC_STATUS_OK;
    data[0] = use_bc;
    datalen = 1;
    break;

Index: backend/serial.c

--- backend/serial.c (revision 8166)
+++ backend/serial.c (working copy)
@@ -1282,6 +1282,7 @@
break;

case CUPS_SC_CMD_GET_BIDI :

  • status = CUPS_SC_STATUS_OK;
    data[0] = use_bc;
    datalen = 1;
    break;

Index: backend/network.c

--- backend/network.c (revision 8166)
+++ backend/network.c (working copy)
@@ -102,6 +102,7 @@
break;

case CUPS_SC_CMD_GET_BIDI :

  • status = CUPS_SC_STATUS_OK;
    data[0] = use_bc;
    datalen = 1;
    break;

Index: backend/parallel.c

--- backend/parallel.c (revision 8166)
+++ backend/parallel.c (working copy)
@@ -653,6 +653,7 @@
break;

case CUPS_SC_CMD_GET_BIDI :

  • status = CUPS_SC_STATUS_OK;
    data[0] = use_bc;
    datalen = 1;
    break;

michaelrsweet added this to the Stable milestone Mar 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment