Project

General

Profile

Actions

Bug #13745

closed

Make SMBsrv compatible with Modern Cups/ OpenPrinting Cups

Added by Till Wegmüller about 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
High
Assignee:
Category:
cifs - CIFS server and client
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

Our SMB server is using a deprecated interface in IPP to print. This has been removed in cups 2.3 and thus SMB_PRINTING does not compile anymore. In OmniOS IPP Prinitng is implicitly disabled and in OpenIndiana It is now explicitly disabled.

What also happened, is that Apple has not updated Cups in a while and an organization called OpenPrinting has forked the project on Github: https://github.com/OpenPrinting/cups/ The OpenPrinting folks are fixing several CVE's and patches and are much better as an upstream as Apple, but illumos-gate does not build against a modern enough cups.

According to The code on Github from Apple (https://github.com/apple/cups/blob/master/CHANGES.md):
"Removed support for -D_IPP_PRIVATE_STRUCTURES=1 developer cheat - the IPP accessor functions should be used instead."

So we need to port our code to use the accessor functions instead,

Currently, to make a release we disabled printing support for SMB
https://github.com/OpenIndiana/oi-userland/pull/6683

Currently, it looks like the Printing support for SMB is not tested anymore outside of OI.

Testing by Toomas Soome: I have defined printer in cups ("epson"), so I did build the gate with this patch and installed it. Then I did create print$ share with: zfs set sharesmb=name=print$ rpool/export/print and made sure sharectl does show print_enable=true for smb protocol.

After this, windows 10 did start to show "epson" in shares list, I did add it as printer in windows and did print test page. Nothing did appear on printer. I found the data file in /export/print drectory; lpr from OI did send it to printer and it was wiondows test page. Then I found entry from log:

May  5 20:48:11 beastie smbd[1175]: [ID 856668 daemon.error] smbd_spool_copyfile: printer Postscript: client-error-not-found

Apparently smbd is looking for printer "Postscript", so I did create printer with this name (my epson is networked, adding another queue is trivial). After this, windows print jobs are sent via illumos smb service to printer.

Actions #1

Updated by Till Wegmüller about 2 years ago

In IRC multiple other options where suggested:

- Move the only the Printing feature out of tree and make a "plugin" with a private interface

- Deprecate the feature.

Actions #2

Updated by Andy Fiddaman about 2 years ago

I think the best option is to make the changes in gate so that it works with newer cups, then re-enable the integration in OpenIndiana.

I took a quick look and the updates should be pretty minimal - something like:

https://gist.github.com/citrus-it/e81a2b76f9874f95d55c11b32a09031e

It's the same kind of thing we encounter fairly frequently with OmniOS. It's not uncommon that upgrading something like, for example, glib2 or openssl, requires some corresponding updates in gate. They are usually pretty small like this.

Actions #3

Updated by Till Wegmüller about 2 years ago

Something like but we need somebody to work on it more :)

==== Build errors (non-DEBUG) ====

smbd_spool.c:235:27: error: 'smb_cups_ops_t {aka struct smb_cups_ops}' has no member named 'ippNewRequest'
smbd_spool.c:283:42: error: 'smb_cups_ops_t {aka struct smb_cups_ops}' has no member named 'ippGetStatusCode'
dmake: Warning: Target `install' not remade because of errors
The following command caused the error:
dmake: Warning: Target `install' not remade because of errors
dmake: Warning: Command failed for target `smbsrv'
dmake: Warning: Target `install' not remade because of errors
The following command caused the error:
dmake: Warning: Target `install' not remade because of errors
Actions #4

Updated by Electric Monk about 2 years ago

  • Gerrit CR set to 1452
Actions #5

Updated by Toomas Soome about 2 years ago

  • Description updated (diff)
Actions #6

Updated by Gordon Ross about 2 years ago

The interface between the SMB/RPC print service and CUPS could use work,
but it's likely to be a while before anyone has time to work on it.

Most distros just comment out the line:
export ENABLE_SMB_PRINTING=
in usr/src/tools/env/illumos.sh

That not work for you? (at least until the i/f can get updated)

Actions #7

Updated by Electric Monk about 2 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit c778cbeb4bc8b9609f43b41183c6c774f574a9c2

commit  c778cbeb4bc8b9609f43b41183c6c774f574a9c2
Author: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
Date:   2021-05-07T15:38:53.000Z

    13745 Make SMBsrv compatible with Modern Cups/ OpenPrinting Cups
    Reviewed by: Andy Fiddaman <andy@omnios.org>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Approved by: Robert Mustacchi <rm@fingolfin.org>

    Change-Id: Icdf81f7aa84397e801f5c560bbb54901dafda457

Actions

Also available in: Atom PDF