Package: samba
Version: 2:4.5.12+dfsg-2+deb9u2
Severity: normal
File: /usr/sbin/smbd

Dear Maintainer,

Printing from Win8/Win10 clients to a printer shared on a samba server
using printing=bsd does not work (printing from smbclient and WinXP/Win7
clients is OK).

The file to print is transferred to the spool directory, but
find_printer_index_by_hnd() fails with a "printer handle not found:
invalid handle" error, and printing is cancelled.

I made the following change to try to find out what's the problem
with the handle:

--- old/source3/rpc_server/rpc_handles.c        2016-05-23 13:05:17 +0200
+++ new/source3/rpc_server/rpc_handles.c        2018-03-09 16:21:43 +0100
@@ -346,8 +346,12 @@
                count++;
        }
 
-       DEBUG(4,("Policy not found: "));
-       dump_data(4, (const uint8_t *)hnd, sizeof(*hnd));
+       if (count==0)
+               DEBUG(4,("Policy list empty.\n"));
+       else {
+               DEBUG(4,("Policy not found: "));
+               dump_data(4, (const uint8_t *)hnd, sizeof(*hnd));
+       }
 
        p->fault_state = DCERPC_FAULT_CONTEXT_MISMATCH;

With this change, the smbd log (level 10, attached) shows that the handle
isn't found because the policy list is empty.

Here is my smb.conf:

[global]
  netbios name=hostname
  workgroup=Workgroup
  server string=%h.example.com
  local master=no
  security=user
  passdb backend=smbpasswd
  map to guest=bad password
  wins support=yes
  name resolve order=wins lmhosts host bcast
  unix charset=ISO-8859-2
  dos charset=CP852
  acl allow execute always=yes
  printing=bsd
  load printers=no
  min print space=1024
  socket options=TCP_NODELAY IPTOS_LOWDELAY SO_SNDBUF=65536 SO_RCVBUF=65536
  use sendfile=yes
  log level=10

[printer]
  path=/var/spool/samba/printer
  printable=yes
  guest ok=yes

[nyomtato]
  path=/var/spool/samba/printer
  printable=yes
  guest ok=yes

Although printing is cancelled, and lpr isn't called by samba, the
spooled file is not deleted, so I could work around the problem by
watching the spool directory with an inotify-based tool, and calling
lpr from there, but it would be nice to fix this in samba.

If you need more details, feel free to ask.

-- 
Zsolt


-- System Information:
Debian Release: 9.4
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 4.4.122 (SMP w/1 CPU core)
Locale: LANG=en_US.ISO-8859-2, LC_CTYPE=en_US.ISO-8859-2 (charmap=ISO-8859-2), 
LANGUAGE=en_US.ISO-8859-2 (charmap=ISO-8859-2)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages samba depends on:
ii  adduser                           3.115
ii  dpkg                              1.18.24
ii  fake-update-inetd [update-inetd]  0.01
ii  init-system-helpers               1.48
ii  libbsd0                           0.8.3-1
ii  libc6                             2.24-11+deb9u3
ii  libldb1                           2:1.1.27-1+b1
ii  libpam-modules                    1.1.8-3.6
ii  libpam-runtime                    1.1.8-3.6
ii  libpopt0                          1.16-10+b2
ii  libpython2.7                      2.7.13-2+deb9u2
ii  libtalloc2                        2.1.8-1
ii  libtdb1                           1.3.11-2
ii  libtevent0                        0.9.31-1
ii  libwbclient0                      2:4.5.12+dfsg-2+deb9u2
ii  lsb-base                          9.20161125
ii  procps                            2:3.3.12-3
ii  python                            2.7.13-2
ii  python-dnspython                  1.15.0-1
ii  python-samba                      2:4.5.12+dfsg-2+deb9u2
ii  python2.7                         2.7.13-2+deb9u2
ii  samba-common                      2:4.5.12+dfsg-2+deb9u2
ii  samba-common-bin                  2:4.5.12+dfsg-2+deb9u2
ii  samba-libs                        2:4.5.12+dfsg-2+deb9u2
ii  tdb-tools                         1.3.11-2

Versions of packages samba recommends:
pn  attr                <none>
ii  logrotate           3.11.0-0.1
pn  samba-dsdb-modules  <none>
pn  samba-vfs-modules   <none>

Versions of packages samba suggests:
pn  bind9          <none>
pn  bind9utils     <none>
pn  ctdb           <none>
pn  ldb-tools      <none>
ii  ntp            1:4.2.8p10+dfsg-3+deb9u2
pn  smbldap-tools  <none>
pn  ufw            <none>
pn  winbind        <none>

Attachment: log.smbd.gz
Description: application/gzip

Reply via email to