lpadmin -p def_printer -v smb://WORKGROUP\username:password@print_server/printer_name -P driver.ppd
The cups backend says:
/usr/lib/cups/backend/smb --help
Usage: /usr/lib/cups/backend/smb [DEVICE_URI] job-id user title copies options [file]
The DEVICE_URI environment variable can also contain the
destination printer:
smb://[username:password@][workgroup/]server[:port]/printer
so the right format:
lpadmin -p def_printer -v smb://username:password@WORKGROUP/print_server/printer_name -P driver.ppd
Activating
LogLevel debug
in /etc/cups/cupsd.conf and browsing /var/log/cups/error_log helped a lot. I am using the standard samba and smbclient packages (version 4.12.3).
]]>pacman -Q talloc tdb tevent ldb samba libwbclient smbclient
talloc 2.3.1-1
tdb 1.4.3-1
tevent 1:0.10.2-1
ldb 1:2.0.8-1
samba 4.11.6-1
libwbclient 4.11.6-1
smbclient 4.11.6-1
Please try 4.11.2-2 from [testing]
Thanks.
It's not working.
I've problems with the filter, with the error message "filter failed".
After the re-installation of samba 4.10.10-2 that I've compiled for myself cups+samba are working correctly.
]]>Please try 4.11.2-2 from [testing]
Thanks.
I can't get this to work. As per my comment above, the latest stable 4.10.10-2 works off-the-shelf for me. However, the latest testing 4.11.2-2 will not print any more. After attempting to print, the printer becomes paused.
I can see in /var/log/cups/access_log the following
localhost - - [26/Nov/2019:10:36:25 +1100] "POST /printers/<printername> HTTP/1.1" 200 112501 Print-Job successful-ok
I click "Resume Printer", and am asked for my root password. The print queue says Printing... for a few seconds, then reverts to Printer paused. The document is still stuck in the printer queue. The following is now appended to /var/log/cups/access_log
localhost - - [26/Nov/2019:10:37:13 +1100] "POST /admin/ HTTP/1.1" 401 197 Resume-Printer successful-ok
localhost - root [26/Nov/2019:10:37:17 +1100] "POST /admin/ HTTP/1.1" 200 197 Resume-Printer successful-ok
/etc/cups/printers.conf is essentially unchanged, and /var/log/cups/error_log is empty.
I reverted to vanilla 4.10.10-2, restart cups again, resume the job, and it prints fine.
]]>AuthInfoRequired username,password
and my username/password to the smb:// URL, and now I'm able to send the job to the printer. Thanks @bred!!!
]]>https://wiki.samba.org/index.php/Runnin … rberos_KDC
# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: judd <jvinet@zeroflux.org>
# Contributor: Michael Hansen <zrax0111 gmail com>
# Contributor: Marco A Rojas <marquicus at gmail.com>
# Contributor: Netanel Shine <netanel at archlinux.org.il >
# Contributor: ngoonee <ngoonee.talk@gmail.com>
# Contributor: Adam Russell <adamlr6+arch@gmail.com>
# Contributor: Dhananjay Sathe <dhananjaysathe@gmail.com>
pkgbase=samba
pkgname=('libwbclient' 'smbclient' 'samba')
pkgver=4.10.10
pkgrel=2
arch=(x86_64)
url="https://www.samba.org"
license=('GPL3')
makedepends=('python' 'docbook-xsl' 'pkg-config' 'libbsd' 'db' 'popt' 'libcups'
'readline' 'tevent' 'acl' 'libldap' 'libcap' 'ldb>=1.1.15' 'krb5' 'pam'
'systemd' 'gnutls>=2.4.1' 'talloc' 'tdb' 'dbus' 'libaio'
'perl-parse-yapp' 'libnsl' 'libtirpc' 'rpcsvc-proto' 'jansson')
source=(https://us1.samba.org/samba/ftp/stable/${pkgbase}-${pkgver}.tar.gz
https://us1.samba.org/samba/ftp/stable/${pkgbase}-${pkgver}.tar.asc
samba.logrotate
samba.pam
samba.conf)
validpgpkeys=('52FBC0B86D954B0843324CDC6F33915B6568B7EA') #Samba Distribution Verification Key <samba-bugs@samba.org>
### UNINSTALL dmapi package before building!!!
build() {
# Use samba-pkg as a staging directory for the split packages
# (This is so RPATHS and symlinks are generated correctly via
# make install, but the otherwise unsplit pieces can be split)
_pkgsrc=${srcdir}/samba-pkg
rm -rf ${_pkgsrc}
cd ${srcdir}/samba-${pkgver}
_samba4_idmap_modules=idmap_ad,idmap_rid,idmap_adex,idmap_hash,idmap_tdb2
_samba4_pdb_modules=pdb_tdbsam,pdb_ldap,pdb_ads,pdb_smbpasswd,pdb_wbc_sam,pdb_samba4
_samba4_auth_modules=auth_unix,auth_wbc,auth_server,auth_netlogond,auth_script,auth_samba4
cd ${srcdir}/samba-${pkgver}
./configure --enable-fhs \
--prefix=/usr \
--sysconfdir=/etc \
--sbindir=/usr/bin \
--libdir=/usr/lib \
--libexecdir=/usr/lib/samba \
--localstatedir=/var \
--with-configdir=/etc/samba \
--with-lockdir=/var/cache/samba \
--with-sockets-dir=/run/samba \
--with-piddir=/run \
--with-ads \
--with-ldap \
--with-winbind \
--with-acl-support \
--with-systemd \
--systemd-install-services \
--enable-gnutls \
--with-pam \
--with-pammodulesdir=/usr/lib/security \
--bundled-libraries=!tdb,!talloc,!pytalloc-util,!tevent,!popt,!ldb,!pyldb-util \
--with-shared-modules=${_samba4_idmap_modules},${_samba4_pdb_modules},${_samba4_auth_modules} \
--disable-rpath-install \
--with-system-mitkrb5 --with-experimental-mit-ad-dc
# Add this to the options once it's working...
#--with-system-mitkrb5 /opt/heimdal
make
make DESTDIR="${_pkgsrc}/" install
# This gets skipped somehow
if [ ! -e ${_pkgsrc}/usr/bin/smbtar ]; then
install -m755 ${srcdir}/samba-${pkgver}/source3/script/smbtar ${_pkgsrc}/usr/bin/
fi
}
package_libwbclient() {
pkgdesc="Samba winbind client library"
depends=('glibc' 'libbsd')
# Use samba-pkg as a staging directory for the split packages
# (This is so RPATHS and symlinks are generated correctly via
# make install, but the otherwise unsplit pieces can be split)
_pkgsrc=${srcdir}/samba-pkg
install -d -m755 ${pkgdir}/usr/lib
mv ${_pkgsrc}/usr/lib/libwbclient*.so* ${pkgdir}/usr/lib/
install -d -m755 ${pkgdir}/usr/lib/samba
mv ${_pkgsrc}/usr/lib/samba/libwinbind-client*.so* ${pkgdir}/usr/lib/samba/
mv ${_pkgsrc}/usr/lib/samba/libreplace-samba4.so* ${pkgdir}/usr/lib/samba/
install -d -m755 ${pkgdir}/usr/lib/pkgconfig
mv ${_pkgsrc}/usr/lib/pkgconfig/wbclient.pc ${pkgdir}/usr/lib/pkgconfig/
install -d -m755 ${pkgdir}/usr/include/samba-4.0
mv ${_pkgsrc}/usr/include/samba-4.0/wbclient.h ${pkgdir}/usr/include/samba-4.0/
}
package_smbclient() {
pkgdesc="Tools to access a server's filespace and printers via SMB"
depends=('popt' 'cifs-utils' 'tdb' "libwbclient>=$pkgver" 'ldb'
'tevent' 'libgcrypt' 'python' 'talloc' 'readline' 'gnutls'
'libbsd' 'libldap' 'libcups' 'libarchive' 'libnsl' 'jansson')
_smbclient_bins=('smbclient' 'rpcclient' 'smbspool'
'smbtree' 'smbcacls' 'smbcquotas' 'smbget' 'net'
'nmblookup' 'smbtar')
# Use samba-pkg as a staging directory for the split packages
# (This is so RPATHS and symlinks are generated correctly via
# make install, but the otherwise unsplit pieces can be split)
_pkgsrc=${srcdir}/samba-pkg
install -d -m755 ${pkgdir}/usr/bin
for bin in ${_smbclient_bins[@]}; do
mv ${_pkgsrc}/usr/bin/${bin} ${pkgdir}/usr/bin/
done
# smbclient binaries link to the majority of the samba
# libs, so this is a shortcut instead of resolving the
# whole dependency tree by hand
install -d -m755 ${pkgdir}/usr/lib
for lib in ${_pkgsrc}/usr/lib/lib*.so*; do
mv ${lib} ${pkgdir}/usr/lib/
done
install -d -m755 ${pkgdir}/usr/lib/samba
for lib in ${_pkgsrc}/usr/lib/samba/lib*.so*; do
mv ${lib} ${pkgdir}/usr/lib/samba/
done
install -d -m755 ${pkgdir}/usr/lib/pkgconfig
mv ${_pkgsrc}/usr/lib/pkgconfig/smbclient.pc ${pkgdir}/usr/lib/pkgconfig/
mv ${_pkgsrc}/usr/lib/pkgconfig/netapi.pc ${pkgdir}/usr/lib/pkgconfig/
install -d -m755 ${pkgdir}/usr/share/man/man1
install -d -m755 ${pkgdir}/usr/share/man/man7
install -d -m755 ${pkgdir}/usr/share/man/man8
for bin in ${_smbclient_bins[@]}; do
if [ -e ${_pkgsrc}/usr/share/man/man1/${bin}.1 ]; then
mv ${_pkgsrc}/usr/share/man/man1/${bin}.1 ${pkgdir}/usr/share/man/man1/
fi
if [ -e ${_pkgsrc}/usr/share/man/man8/${bin}.8 ]; then
mv ${_pkgsrc}/usr/share/man/man8/${bin}.8 ${pkgdir}/usr/share/man/man8/
fi
done
mv ${_pkgsrc}/usr/share/man/man7/libsmbclient.7 ${pkgdir}/usr/share/man/man7/
install -d -m755 ${pkgdir}/usr/include/samba-4.0
mv ${_pkgsrc}/usr/include/samba-4.0/libsmbclient.h ${pkgdir}/usr/include/samba-4.0/
mv ${_pkgsrc}/usr/include/samba-4.0/netapi.h ${pkgdir}/usr/include/samba-4.0/
mkdir -p ${pkgdir}/usr/lib/cups/backend
ln -sf /usr/bin/smbspool ${pkgdir}/usr/lib/cups/backend/smb
}
package_samba() {
pkgdesc="SMB Fileserver and AD Domain server"
depends=('db>=4.7' 'popt' 'libcups' 'libcap>=2.16' 'gnutls>=2.4.1'
'talloc' 'ldb' 'libbsd' 'python' 'iniparser' 'tdb' 'libaio' 'perl-parse-yapp' "smbclient>=$pkgver" 'gpgme')
backup=(etc/logrotate.d/samba
etc/pam.d/samba
etc/samba/smb.conf
etc/xinetd.d/swat
etc/conf.d/samba)
install=samba.install
# Use samba-pkg as a staging directory for the split packages
# (This is so RPATHS and symlinks are generated correctly via
# make install, but the otherwise unsplit pieces can be split)
_pkgsrc=${srcdir}/samba-pkg
# Everything that libwbclient and smbclient didn't install goes
# into the samba package...
mv ${_pkgsrc}/* ${pkgdir}/
rmdir ${_pkgsrc}
# Make admin scripts look in the right place for the samba python module
for script in bin/samba_dnsupdate bin/samba_kcc bin/samba_spnupdate \
bin/samba_upgradedns bin/samba-tool
do
sed -i "/^sys\.path\.insert/ a\
sys.path.insert(0, '/usr/lib/python${_pyver}/site-packages')" \
${pkgdir}/usr/${script}
done
# packaging/wscript_build to use /etc/conf.d
sed -i -e '/^EnvironmentFile/ s/sysconfig/conf.d/' "${pkgdir}"/usr/lib/systemd/system/*.service
install -d -m755 "${pkgdir}"/etc/conf.d
install -m644 "${srcdir}"/samba-${pkgver}/packaging/systemd/samba.sysconfig "${pkgdir}"/etc/conf.d/samba
# create ephemeral dirs via tmpfiles rather than shipping them in package
install -D -m644 ${srcdir}/samba.conf ${pkgdir}/usr/lib/tmpfiles.d/samba.conf
# create config dir
install -d -m755 ${pkgdir}/etc/samba
mkdir -p ${pkgdir}/etc/samba/private
chmod 700 ${pkgdir}/etc/samba/private
install -D -m644 ${srcdir}/samba.logrotate ${pkgdir}/etc/logrotate.d/samba
install -D -m644 ${srcdir}/samba.pam ${pkgdir}/etc/pam.d/samba
# spool directory
install -d -m1777 ${pkgdir}/var/spool/samba
rm -rf ${pkgdir}/var/run
rm -rf ${pkgdir}/etc/sysconfig
# copy ldap example
install -D -m644 ${srcdir}/samba-${pkgver}/examples/LDAP/samba.schema ${pkgdir}/usr/share/doc/samba/examples/LDAP/samba.schema
}
md5sums=('dde27447f39d124efe18f719ccf956dd'
'SKIP'
'995621522c6ec9b68c1b858ceed627ed'
'96f82c38f3f540b53f3e5144900acf17'
'49abd7b719e3713a3f75a8a50958e381')
I upgraded samba, libwbclient, and smbclient, then restarted cups. I try to print, and the printer is put on hold. At this point, /etc/cups/printers.conf is unmodified. I try and resume the printer, but it goes back on hold. /etc/cups/printers.conf is now modified again, with AuthInfoRequired none added. There is nothing obvious in the logs.
I tried changing this line to AuthInfoRequired username,password, substituting my username and password, then restarting cups. After attempting to resume the printer, it is again put on hold. Now I can see in /var/log/cups/error_log the following line:
Bad AuthInfoRequired on line 53 of printers.conf.
I try to resume, and /etc/cups/printers.conf is reverted to AuthInfoRequired none. I've tried to enter my password multiple times, so it's not in error. It's also the same password as in the DeviceURI smb:/// line (which is used in the working samba 4.9.5 ), so I know it's correctly typed.
]]>I'm having a bit of trouble building it, so I'll wait until it hits the official repos. Having said that, I'm not too optimistic, because the referenced bug says the regression was introduced in 4.8. The regression in this thread was introduced after 4.9.5.
Have you tested the 4.10.6?
]]>Somebody has tried samba 4.10.6
https://www.samba.org/samba/history/samba-4.10.6.html
In the bug fix list it appears this:
o Andreas Schneider <asn@samba.org>
* BUG 13939: Using Kerberos credentials to print using spoolss doesn't work.
I'm having a bit of trouble building it, so I'll wait until it hits the official repos. Having said that, I'm not too optimistic, because the referenced bug says the regression was introduced in 4.8. The regression in this thread was introduced after 4.9.5.
]]>https://www.samba.org/samba/history/samba-4.10.6.html
In the bug fix list it appears this:
o Andreas Schneider <asn@samba.org>
* BUG 13939: Using Kerberos credentials to print using spoolss doesn't work.
I've created a bug report here. Any lurkers with more information, please add it to the bug.
]]>