Win10 with SMB2_10 or SMB3_11 and problems with 'print command'
Thomas Bork
tombork at web.de
Mon Jul 4 21:38:43 UTC 2016
Hi,
I'm trying to debug a problem with a samba printer, which creates pdf
files. The script in 'print command' in the printer share definition is
running fine with all clients up to Win7 but makes problems with Win10.
After some investigations I found out, that the samba macro %u with
Win10 and protocol SMB2_10 or SMB3_11 is not showing the effective user
but only 'nobody'. With protocol NT1 the correct effective user is shown.
I switched between the protocols with
max protocol =
max protocol = SMB2
max protocol = NT1
in smb.conf.
With Win7 and protocol SMB2_10 the correct effective user is shown.
The Win-user is mapped with a usermap file to the linux user on the
samba machine:
root = "Administrator" "Admin"
tanne = "Hans-Georg Kiefer"
The essential informations from the debug output with the script below
in 'print command':
Win10:
------
Ausgehandeltes Protokoll-Level (%R) = NT1
Vom Client angeforderter Benutzername (%U) = hans-georg kiefer
Name des effektiven Benutzers (%u) = tanne
Ausgehandeltes Protokoll-Level (%R) = SMB2_10
Vom Client angeforderter Benutzername (%U) = hans-georg kiefer
Name des effektiven Benutzers (%u) = nobody
Ausgehandeltes Protokoll-Level (%R) = SMB3_11
Vom Client angeforderter Benutzername (%U) = hans-georg kiefer
Name des effektiven Benutzers (%u) = nobody
Win7:
-----
Ausgehandeltes Protokoll-Level (%R) = SMB2_10
Vom Client angeforderter Benutzername (%U) = hans-georg kiefer
Name des effektiven Benutzers (%u) = tanne
To reproduce:
Printer share definition:
[pdf]
comment = pdf-service on %h
printing = bsd
use client driver = yes
browseable = yes
printable = yes
path = /var/spool/samba
lpq command = /var/install/bin/samba-print-pdf status
print command = ( /var/install/bin/samba-smbinfo-pdf
"T=%T|d=%d|v=%v|h=%h|L=%L|N=%N|p=%p|R=%R|S=%S|P=%P|U=%U|G=%G|u=%u|g=%g|H=%H|I=%I|M=%M|m=%m|a=%a"
) &
create mode = 0700
The script /var/install/bin/samba-smbinfo-pdf to debug the samba macros:
outputfile=/public/pdf.log
echo
"----------------------------------------------------------------------------"
>>"$outputfile"
oldifs="$IFS"
IFS='|'
set -- $1
while [ -n "$1" ]
do
if [ -n "`echo "$1" | grep '='`" ]
then
index=`echo "$1" | cut -d'=' -f1`
value=`echo "$1" | cut -d'=' -f2`
case $index in
T ) message="Datum/Zeit (%$index)= $value";;
d ) message="PID des Servers (%$index) = $value";;
v ) message="Samba-Version (%$index) = $value";;
h ) message="(Internet)Hostname des Servers (%$index) = $value";;
L ) message="NETBIOS-Name des Servers (%$index) = $value";;
N ) message="NIS Heimat-Verzeichnis (%$index) = $value";;
p ) message="Pfad des NIS-Heimatverzeichnisses (%$index) =
$value";;
R ) message="Ausgehandeltes Protokoll-Level (%$index) = $value";;
S ) message="Name der aktuellen Freigabe (%$index) = $value";;
P ) message="Hauptverzeichnis der aktuellen Freigabe (%$index)
= $value";;
U ) message="Vom Client angeforderter Benutzername (%$index) =
$value";;
G ) message="Primaere Gruppe des angeforderten Benutzers
(%$index) = $value";;
u ) message="Name des effektiven Benutzers (%$index) = $value";;
g ) message="Primaerer Gruppenname des effektiven Benutzers
(%$index) = $value";;
H ) message="Heimatverzeichnis des effektiven Benutzers
(%$index) = $value";;
I ) message="IP Adresse des Client-Rechners (%$index) = $value";;
M ) message="(Internet)Hostname des Client-Rechners (%$index) =
$value";;
m ) message="NETBIOS-Name des Client-Rechners (%$index) = $value";;
a ) message="Betriebssystem des Client-Rechners (%$index) =
$value";;
esac
echo "$message" >>"$outputfile"
fi
shift
done
IFS="$oldifs"
Does anybody know if this a problem in Win10 or in samba?
--
der tom
More information about the samba-technical
mailing list