Michael Tokarev
2022-Dec-27 21:11 UTC
[Samba] Upgrade to 2:4.16.2+dfsg-1nmu1~deb11.1 borks printing
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 in 4.17.something this is the case. It is because there should be no separate world-writable directory like this on the system, which is also not cleaned up, it was a wrong decision to have it in a separate dir to begin with. So in your case (27 times!) it was not processed. I wonder when this dir was dropped, -- where did this 2:4.16.2+dfsg-1nmu1~deb11.1 version come from, can I have the .deb please? You'd better change your smb.conf to point to /var/tmp instead of creating a 777-mode dir. And *especially* the 777-mode, without the sticky bit - this is wrong, it opens your system for fun tricks. I don't think printer_list.tdb is actually necessary, but it definitely helps to reduce log noise.> 27 locations are printing again. > > You'd think something would complain about /var/spool/samba not existing or try to create it. Maybe I just missed it in the mass of logs. ?It is interesting that no errors are logged if path= in [printers] doesn't exist. Thanks, /mjt
Michael Tokarev
2022-Dec-27 21:21 UTC
[Samba] Upgrade to 2:4.16.2+dfsg-1nmu1~deb11.1 borks printing
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, butActually 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