You are not logged in.

#51 2019-05-26 04:23:37

Salkay
Member
Registered: 2014-05-22
Posts: 636

Re: CUPS: Authentication required for printing document "...".

loqs wrote:
cd samba-git
makepkg -Codd
git bisect start
git bisect bad samba-4.10.1
git bisect good samba-4.10.0
Bisecting: 28 revisions left to test after this (roughly 5 steps)
[0c2f7224e075538fc0fd70e4405cafc82f037909] dbcheck: don't move already deleted objects to LostAndFound

After checking 0c2f7224e075538fc0fd70e4405cafc82f037909 you can get the next commit using the following where $result is good or bad (or if it will not build skip)

cd samba-git/src/samba
git bisect $result

Sorry, is there a step missing here? I've git bisected before, with makepkg -o to get the sources, git bisect to find the next revision to test, then makepkg -e; sudo pacman -U <new pkg>. However, in your code here, I'd still need to do something after git bisect, right? I'm just double checking, because I'm not sure if I should be using extra-x86_64-build instead of makepkg.

Offline

#52 2019-05-26 09:18:44

loqs
Member
Registered: 2014-03-06
Posts: 18,041

Re: CUPS: Authentication required for printing document "...".

Yes its different than with makepkg in that you need to manually copy the commit git wants to check to the PKGBUILD then run extra-x86_64-build.
Thank you for checking.

Offline

#53 2019-05-26 10:49:18

Salkay
Member
Registered: 2014-05-22
Posts: 636

Re: CUPS: Authentication required for printing document "...".

Thank you for the clarification. I git bisected, with the following results:

r10 c6f1719b5e25984afc3168bdcd8efdb301108afd good
r11 84aad2ea7d53d8d7645bbd9e4c9ce6b09f6016c5 couldn't build
r12 755f624e2bbca22da44b9b9352aa095bc3603db3 bad

r11 failed with

+ install /build/samba-git/src/samba-pkg/usr/lib/samba/libdsdb-module-samba4.so (from bin/default/source4/dsdb/samdb/ldb_modules/libdsdb-module-samba4.inst.so)
Waf: Leaving directory `/build/samba-git/src/samba/bin/default'
Build failed
Traceback (most recent call last):
  File "/build/samba-git/src/samba/third_party/waf/waflib/Task.py", line 320, in process
    ret = self.run()
  File "/build/samba-git/src/samba/third_party/waf/waflib/Build.py", line 1101, in run
    fun(x.abspath(), y.abspath(), x.path_from(launch_node))
  File "/build/samba-git/src/samba/third_party/waf/waflib/Build.py", line 1168, in do_install
    raise Errors.WafError('Could not install the file %r' % tgt, e)
WafError: Could not install the file '/build/samba-git/src/samba-pkg/usr/lib/python2.7/site-packages/samba/dcerpc/idmap.so'

make: *** [Makefile:10: install] Error 1
==> ERROR: A failure occurred in build().
    Aborting...
==> ERROR: Build failed, check /var/lib/archbuild/extra-x86_64/salkay/build

Last edited by Salkay (2019-05-27 06:35:39)

Offline

#54 2019-05-26 11:49:10

loqs
Member
Registered: 2014-03-06
Posts: 18,041

Re: CUPS: Authentication required for printing document "...".

84aad2ea7d53d8d7645bbd9e4c9ce6b09f6016c5 looks to be the cause lets try the fix from https://bugzilla.samba.org/show_bug.cgi?id=13939 on 4.10.2.  If this fails could you please report the bug upstream.

# 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-git
pkgname=('libwbclient-git' 'smbclient-git' 'samba-git')
pkgver=4.10.2.r0.g17cd92e1c36
pkgrel=1
arch=(x86_64)
url="https://www.samba.org"
license=('GPL3')
makedepends=('python2' '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' 'git')
source=(git+https://git.samba.org/samba.git#commit=17cd92e1c3672c4ffde7ca94546f57907d22262b
#source=(git+https://git.samba.org/samba.git#commit=b6b72d0063107bf9008203d8c2843033a5edb6da #last commit before ldb switch
#source=(git+https://git.samba.org/samba.git#commit=4fc4ae2924aaa2fc184b7385069274526fa8a4c2
        samba.logrotate
        samba.pam
        samba.conf
        0001-s3-smbspool-Fix-regression-printing-with-Kerberos-cr.patch::https://attachments.samba.org/attachment.cgi?id=15137)
md5sums=('SKIP'
         '995621522c6ec9b68c1b858ceed627ed'
         '96f82c38f3f540b53f3e5144900acf17'
         '49abd7b719e3713a3f75a8a50958e381'
         '0a25538f1e5a4bfed9d5d7af58c863d1')
#validpgpkeys=('52FBC0B86D954B0843324CDC6F33915B6568B7EA') #Samba Distribution Verification Key <samba-bugs@samba.org>
### UNINSTALL dmapi package before building!!!

pkgver() {
  cd samba
  # cutting off 'samba-' prefix that presents in the git tag
  git describe --long | sed 's/^samba-//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

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 samba
  git apply -v ../0001-s3-smbspool-Fix-regression-printing-with-Kerberos-cr.patch
  # change to use python2
  SAVEIFS=${IFS}
  IFS=$(echo -en "\n\b")
  PYTHON_CALLERS="$(find ${srcdir}/samba -name '*.py')
$(find ${srcdir}/samba -name 'wscript*')
$(find ${srcdir}/samba -name 'configure.ac')
$(find ${srcdir}/samba -name 'upgrade_from_s3')
$(find ${srcdir}/samba/buildtools -type f)
$(find ${srcdir}/samba/source4/scripting -type f)"
  sed -i -e "s|/usr/bin/env python$|/usr/bin/env python2|" \
         -e "s|python-config|python2-config|" \
         -e "s|bin/python|bin/python2|" \
      ${PYTHON_CALLERS}
  IFS=${SAVEIFS}

  export PYTHON=/usr/bin/python2
_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 samba
  ./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 

              # Add this to the options once it's working...
               #--with-system-mitkrb5 /opt/heimdal
  CFLAGS="$CLFAGS -DTEVENT_DEPRECATED" 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-git() {
pkgdesc="Samba winbind client library"
depends=('glibc' 'libbsd')
provides=(libwbclient)
conflicts=(libwbclient)
  # 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-git() {
pkgdesc="Tools to access a server's filespace and printers via SMB"
depends=('popt' 'cifs-utils' 'tdb' "libwbclient>=$pkgver" 'ldb'
         'tevent' 'libgcrypt' 'python2' 'talloc' 'readline' 'gnutls' 
         'libbsd' 'libldap' 'libcups' 'libarchive' 'libnsl' 'jansson')
provides=(smbclient)
conlicts=(smbclient)

    _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-git() {
pkgdesc="SMB Fileserver and AD Domain server"
depends=('db>=4.7' 'popt' 'libcups' 'libcap>=2.16' 'gnutls>=2.4.1'
         'talloc' 'ldb' 'libbsd' 'python2' 'iniparser' 'tdb' 'libaio' 'perl-parse-yapp' "smbclient>=$pkgver" 'gpgme')
provides=(samba)
conflicts=(samba)
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}

    _pyver=`python2 -c 'import sys; print(sys.version[:3])'`

    find ${pkgdir}/usr/lib/python${_pyver}/site-packages/ -name '*.py' | \
         xargs sed -i "s|#!/usr/bin/env python$|#!/usr/bin/env python2|"
    find ${pkgdir}/usr/bin ${pkgdir}/usr/bin -type f -executable | \
         xargs sed -i "s|#!/usr/bin/env python$|#!/usr/bin/env python2|"

    # 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/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/examples/LDAP/samba.schema ${pkgdir}/usr/share/doc/samba/examples/LDAP/samba.schema
}

Edit:
missed could have cherry-picked 4c02823ab51f99932aadc65244372f5e9b495093 instead of git apply.

Last edited by loqs (2019-05-26 12:00:14)

Offline

#55 2019-05-26 12:55:55

Salkay
Member
Registered: 2014-05-22
Posts: 636

Re: CUPS: Authentication required for printing document "...".

I tried the PKGBUILD you quoted, but booo… it also failed. This was with everything else installed the same as my git bisect odyssey. Is that correct? i.e.

$ pacman -Q talloc tdb tevent ldb samba-git libwbclient smbclient
talloc 2.1.16-1
tdb 1.3.18-2
tevent 1:0.9.39-1
ldb 1:1.5.4-2
samba-git 4.10.2.r0.g17cd92e1c36-1
libwbclient-git 4.10.2.r0.g17cd92e1c36-1
smbclient-git 4.10.2.r0.g17cd92e1c36-1
loqs wrote:

missed could have cherry-picked 4c02823ab51f99932aadc65244372f5e9b495093 instead of git apply.

I wasn't entirely sure what you meant here, but presumably you meant this would result in the same final package, so I ignored it.

loqs wrote:

If this fails could you please report the bug upstream.

Sure, I'm happy to do so. I'm a bit confused by all the technical details here, but presumably the important parts to report are the two probable commits that introduced the regression, and the patch that didn't work?

Offline

#56 2019-05-26 13:07:28

loqs
Member
Registered: 2014-03-06
Posts: 18,041

Re: CUPS: Authentication required for printing document "...".

The cherry-pick would be identical I was just noting it had been committed upstream in case it did fix the issue.

Yes for the bug report I think the important facts are bisection results,  the patch did not work and the symptoms of the issue.
Edit:
And thank you for all the testing you are doing.

Last edited by loqs (2019-05-26 13:10:05)

Offline

#57 2019-05-27 06:43:07

Salkay
Member
Registered: 2014-05-22
Posts: 636

Re: CUPS: Authentication required for printing document "...".

Thank you for all your assistance!

I've created a bug report here. Any lurkers with more information, please add it to the bug.

Offline

#58 2019-06-07 11:45:56

bred
Member
Registered: 2011-01-04
Posts: 48

Re: CUPS: Authentication required for printing document "...".

Not the printer does not work also with the downgraded cups and samba .... cups 2.2.10 & samba 4.9.5
There is a stable temporary solution???

Offline

#59 2019-06-19 11:49:11

realjuvi
Member
Registered: 2019-06-19
Posts: 1

Re: CUPS: Authentication required for printing document "...".

Same problem here. Downgrade samba to 4.9.5 and it works again.
Hope there will be a fix soon.

Last edited by realjuvi (2019-06-19 11:49:26)

Offline

#60 2019-07-08 14:28:46

bred
Member
Registered: 2011-01-04
Posts: 48

Re: CUPS: Authentication required for printing document "...".

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.

Offline

#61 2019-07-10 04:07:25

Salkay
Member
Registered: 2014-05-22
Posts: 636

Re: CUPS: Authentication required for printing document "...".

bred wrote:

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.

Offline

#62 2019-07-15 07:00:10

bred
Member
Registered: 2011-01-04
Posts: 48

Re: CUPS: Authentication required for printing document "...".

Salkay wrote:

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?

Offline

#63 2019-07-17 03:49:50

Salkay
Member
Registered: 2014-05-22
Posts: 636

Re: CUPS: Authentication required for printing document "...".

I tested 4.10.6, and it's still broken, but in a different way.

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.

Offline

#64 2019-11-18 13:34:07

bred
Member
Registered: 2011-01-04
Posts: 48

Re: CUPS: Authentication required for printing document "...".

I've used this very little modification to the PKGBUILD and it works!
Just add the options "--with-system-mitkrb5 --with-experimental-mit-ad-dc" to configure.

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')

Offline

#65 2019-11-18 15:14:35

sunite
Member
From: Freiburg i. Br., DE
Registered: 2012-05-14
Posts: 29
Website

Re: CUPS: Authentication required for printing document "...".

I can confirm using @bred's PKGBUILD works for me. I only need to add

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!!!

Offline

#66 2019-11-18 21:48:40

Salkay
Member
Registered: 2014-05-22
Posts: 636

Re: CUPS: Authentication required for printing document "...".

I can confirm that this works, but I also tested the unmodified 4.10.10-2 (samba libwbclient smbclient) from the repos, and that now works for me too!

Offline

#67 2019-11-20 15:14:33

tpowa
Developer
From: Lauingen , Germany
Registered: 2004-04-05
Posts: 2,328

Re: CUPS: Authentication required for printing document "...".

Please try 4.11.2-2 from [testing]
Thanks.

Offline

#68 2019-11-25 23:44:48

Salkay
Member
Registered: 2014-05-22
Posts: 636

Re: CUPS: Authentication required for printing document "...".

tpowa wrote:

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.

Offline

#69 2019-11-29 10:43:34

bred
Member
Registered: 2011-01-04
Posts: 48

Re: CUPS: Authentication required for printing document "...".

tpowa wrote:

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.

Last edited by bred (2019-11-29 11:06:02)

Offline

#70 2020-02-10 16:19:51

telsch
Member
Registered: 2020-02-10
Posts: 1

Re: CUPS: Authentication required for printing document "...".

Just compiled latest samba without "--with-system-mitkrb5 --with-experimental-mit-ad-dc" . Could print from an arch client after authentication with a valid samba user. Didn't have AuthInfoRequired set in /etc/cups/printers.conf.

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

Offline

#71 2020-06-01 21:13:10

leuko
Member
Registered: 2020-06-01
Posts: 23

Re: CUPS: Authentication required for printing document "...".

I had a similar error: NT_STATUS_LOGON_FAILURE
The problem was that I used the wrong address format:

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).

Offline

Board footer

Powered by FluxBB