Bug 71233

Summary: printconf fails to work for external SMB printers
Product: [Retired] Red Hat Linux Reporter: Dave Raggett <dsr>
Component: printconfAssignee: Tim Waugh <twaugh>
Status: CLOSED NOTABUG QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-08-10 18:11:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dave Raggett 2002-08-10 18:11:35 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.5 (X11; Linux i686; U;) Gecko/20020606

Description of problem:
printconf-gui wouldn't work with SMB printer. I discovered that the
/usr/share/printconf/util/smbprint was passing the wrong params to
smbclient.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
Use printconf-gui to set up an external SMB printer and then look at
/usr/share/printconf/util/smbprint

Actual Results:  Nothing gets passed to remote SMB server.
I debugged what was going on and determined that the
smbclient script needed a fix. See later for the patch.

If you log the error output of smbclient you will see that it
is complaining about the parameters being passed to it.

With my fix, lpr nows causes the remote printer to do something,
but there is still a problem elsewhere (mf_wrapper) as a short
text file is printed as many mostly blank sheets with 0-3 lines of
junk across the top.  I presume that magicfilter isn't being invoked
correctly. In particular, I suspect it isn't getting the right
device driver, in my case "hpijs" for an HP OfficeJet G85.

Additional info:

The following is the end of the smbprint after my fixes. It ensures
that the -U and -W params are only given when needed and ensures
that the correct servicename is given.

-------- cut here --------------------

if [ "$user" != "" ]; then
   usercmd="-U $user"
else
   usercmd=""
fi

if [ "$workgroup" != "" ]; then
   workgroupcmd="-W $workgroup"
else
   workgroupcmd=""
fi

if [ "$translate" = "yes" ]; then
 command="translate ; print -"
else
 command="print -"
fi


# echo $share $password $translate $x_command > /tmp/smbprint.log
# echo smbclient "\\\\$hostip\\$share" "$password" -E \
     -N -P $usercmd $workgroupcmd \
     -c "$command" >/tmp/smbprint.log

cat | /usr/bin/smbclient "\\\\$hostip\\$share" "$password" -E \
     -N -P $usercmd $workgroupcmd \
     -c "$command" 2>/dev/null

Comment 1 Tim Waugh 2002-08-12 11:33:12 UTC
http://www.redhat.com/docs/manuals/linux/RHL-7.2-Manual/custom-guide/printconf-smb-printer.html 
 
The 'share' is the whole thing, i.e. //machinename/sharename. 
 
As for the other problem, please make sure you have all the updates applied.  
If the problem persists please re-open this bug report.