[Samba] Upgrade to 2:4.16.2+dfsg-1nmu1~deb11.1 borks printing

Michael Tokarev mjt at tls.msk.ru
Tue Dec 27 21:21:51 UTC 2022


28.12.2022 00:11, Michael Tokarev via samba wrote:
> 27.12.2022 23:53, Aaron de Bruyn via samba wrote:
>> Finally got it working.
>> Nothing useful in the error logs.
>>
>> /var/spool/samba does not exist.
>> Creating it and chmoding it to 777 along with using tdbtool to create /var/cache/samba/printer_list.tdb seems to do the trick.
> 
> This is in smb.conf in [printers] section.
> 
> The postinstall script checks if this directory exists, it is
> referenced in smb.conf and if yes, creates symlink pointing to
> /var/tmp/.  This shouldn't affect 4.16.2+dfsg-1 in any way, but

Actually the change has been made earlier, in 4.16.1+dfsg-5,
so 4.16.2+dfsg-1 also contains the change.  Here's the code
in the postinst script:

# remove old spool directory (point it to /var/tmp if in use)
dir=/var/spool/samba
if [ configure = "$1" -a ! -L $dir ] &&
    dpkg --compare-versions "$2" lt-nl 2:4.16.1+dfsg-5~
then
     if [ -d $dir ]; then
         echo "W: removing old samba print spool $dir" >&2
         rm -rf $dir
     fi
     used=$(testparm -s --section-name=printers --parameter-name=path 2>/dev/null || :)
     if [ $dir = "$used" ]; then
         echo "W: $dir is referenced in smb.conf [printers] section." >&2
         echo "W: redirecting $dir to /var/tmp. Please update your smb.conf" >&2
         ln -s ../tmp $dir
     fi
fi

which should create symlink if we're upgrading from earlier
version (4.13 in your case) and the directory is actually
used in smb.conf (and not already a symlink).

I wonder.. if this code misses the case where this path is
referenced in another share? Where did you set this path in
smb.conf?

/mjt



More information about the samba mailing list