Bug 107836

Summary: LTC4841-Redhat-config-printer won't configure a samba printer
Product: Red Hat Enterprise Linux 3 Reporter: IBM Bug Proxy <bugproxy>
Component: redhat-config-printerAssignee: Tim Waugh <twaugh>
Status: CLOSED ERRATA QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0   
Target Milestone: ---   
Target Release: ---   
Hardware: powerpc   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-12-08 14:41:54 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:
Attachments:
Description Flags
smbprint.txt
none
pysmb.txt none

Description IBM Bug Proxy 2003-10-23 16:25:08 UTC
The following has be reported by IBM LTC:  
Redhat-config-printer won't configure a samba printer
I exported my display and ran redhat-config-printer.  I tried to attach a 
Networked Windows (smb) printer.  I typed in the workgroup, my W2K desktop 
system, share, userid, and password and hit enter.   The window just comes 
right back with the same prompt.  I verified the printer was shared by using a 
W98 box with only netbeui installed (no tcp) and it worked ok.Khoa/Salina,

Sounds like this is possibly platform-independent. Can you work this one?
Thanks.Ok Olof,
I think our test team has a samba printer, will try to re-create on IA32 
sometime next week.  I don't have time this week.  Installed RHEL 3.0 RC4 AS on
Netvista box.
( This is Taroon-re1007.RC1.* )
I did not have any problem using redhat-config-printer to add a samba printer.  
The printer is IBM info print 20 on a Windows machine - I don't know what O/S 
is running on that Windows machine - will need to ask owner.
Adding the printer also printed off a test page correctly.
Olof, Khoa said to transfer problem back to you.
Your team has your own contacts with RedHat.
SalinaKhoa,

Please drive this problem to closure on your side, I'm sure Ray can assist you
if you need remote access to an iSeries system to reproduce. Feel free to open
up a mirror bug to RedHat using your own channels. Thanks.I thought you insisted
on using your own channel to communicate with the
distros.  Any reason why you wanted to change this ?Over to Thinh. Please mirror
this as a Service bug even though we work it.Ray,
Can you capture some network packet between these two boxes? or at least 
packets coming in/out from Linux system.  It wouls be great if using ethereal.

And what is the service pack on you Win2K?Conntacting Ray for more
information.The problem seem to be access being denied.
Printer Server:
 - level: Win2K SP4 (plus other hot fixes)
 - hostname: voyager
 - sharename: RAYDASCOLOR

RedHat Linux as client:
 - level: 2.4.21-3.EL #1 SMP Fri Sep 19 13:58:19 EDT 2003 ppc64
          samba-client-3.0.0-14.3E
 - hostname: ilinjck6

SMB protocols begin:
 - Negotiate Protocol request/response: server picked dialect 8
 - client sent Session Setup AndX request, NTLMSSP_NEGOTIATE
 - server response Setup AndX, NTLMSSP_CHALLENGE
 - client sent Setup AndX, NTLMSSP_AUTH with username/password
 - server response with failure, Error: STATUS_LOGON_FAILURE
 - client sent Setup_AndX with user: anonymous (NULL/NULL)
 - server response success
 - client sent TreeConnect_AndX request, Path:\\VOYAGER\RAYDASCOLOR
 - server responsed, Error: STATUS_ACCESS_DENIED
SMB protol ends.

still looking .....
I tried my Redhat (i386) as the client, and it works when mapping a printer to
the same server, \\VOYAGER\RAYDASCOLOR:
 - level: 2.4.20-18.9 #1 Thu May 29 07:08:16 EDT 2003 i386
 - samba client: samba-client-2.2.7a-8.9.0

this (samba) client level does normal SMB protocols transactions:
 - client sent negotiate request
 - server responsed negotiation response, pick index 7 (the highest)
 - client sent Session Setup_AndX with username/password
 - server responsed OK.
 - client sent TreeConnect_AndX, path: \\VOYAGER\RAYDASCOLOR
 - server responsed OK.

This is Samba issue. At this time, we know the samba client 3.0.xx is broken on
ppc64. We need verify:
 - Samba client 3.0.xx on i386
 - Samba client 2.2.xx on ppc64

Khoa, Do you have anyone in your team handle samba issues?
Yep, Samba 3.0xx is broken.
I installed samba-3.0.0-2_rh9.i386.rpm from samba.org on my Redhat i386, it also
failed.
OK, this is strange.
The smbclient 3.0.xx is working, I tested it by using command lines to map to
the printer share and it all worked:

   # smbclient -U thinh //voyager/RAYDASCOLOR  thinh1
or # smbclient //voyager/RAYDASCOLOR -U thinh thinh1
or # smbclient //voyager/RAYDASCOLOR -U thinh%thinh1
 
I compared the network packets between the bad (printer gui) case and the good
(command line) case, both are using the same protocols and autherntication
method, NTLMSSP, most information are identical, the one is in question is the
password.

I'm still trying find out what the differences in smbclient 3.x that makes this
doesnot work anymore. 

Found it. The problem is the smbclient version 3.0.x with -N option, it will
ignore the specified password and send a NULL password instead (I assummed) and
since server and client negotiated with LMTNv2, a higher autherntication method,
it requires a valid password. After this fails, smbclient send a NULL/NULL
Session Setup request, Win2K accepts the session but doesnot allow to map the
printer share. I'm not sure this '-N' option working the same way on version
2.0x or not.


Here the patch fixing this:
[root@ilinjck6 util]# diff -Nu orig/pysmb.py pysmb.py
--- orig/pysmb.py       2003-09-12 05:53:48.000000000 -0400
+++ pysmb.py    2003-10-21 20:57:10.000000000 -0400
@@ -155,7 +155,10 @@
     if group:
         args.extend (["-W", group])
  
-    args.extend (["-N", "-c", "quit"])
+    if passwd:
+        args.extend (["-c", "quit"])
+    else:
+        args.extend (["-N", "-c", "quit"])
     if user:
         args.extend (["-U", user])


and so a possible on the smbprint command too:

[root@ilinjck6 util]# diff -Nu orig/smbprint smbprint
--- orig/smbprint       2003-09-12 05:53:48.000000000 -0400
+++ smbprint    2003-10-21 20:58:34.000000000 -0400
@@ -84,5 +84,5 @@
 #echo $share $password $translate $x_command > /tmp/smbprint.log
  
 cat | /usr/bin/smbclient "$share" "$password" -E ${hostip:+-I} \
-     $hostip -N -P $usercmd "$user" $workgroupcmd "$workgroup" \
+     $hostip -P $usercmd "$user" $workgroupcmd "$workgroup" \
      -c "$command" 2>/dev/null

Ray, The patch is currently on this machine. Please verify it. thanks.

Look like this '-N' option issue is the same with RedHat bug#81173.

patches for redhat-config-printer-gui with smbclient v3.0.x
Glen, since this is a Service family bug, can you mirror it over? THanks.Added
the wrong email address for Glen.this should be backward compatible with
smbclient v2.xx with '-N' option for the
 smbprint:

[root@ilinjck6 util]# diff -Nu /usr/share/printconf/util/orig/smbprint
/usr/share/printconf/util/smbprint
--- /usr/share/printconf/util/orig/smbprint     2003-09-12 05:53:48.000000000 -0400
+++ /usr/share/printconf/util/smbprint  2003-10-22 14:19:48.000000000 -0400
@@ -70,6 +70,12 @@
    usercmd=""
 fi
  
+if [ "$password" != "" ]; then
+   passwdcmd=""
+else
+   passwdcmd="-N"
+fi
+
 if [ "$workgroup" != "" ]; then
    workgroupcmd="-W"
 else
@@ -84,5 +90,5 @@
 #echo $share $password $translate $x_command > /tmp/smbprint.log
  
 cat | /usr/bin/smbclient "$share" "$password" -E ${hostip:+-I} \
-     $hostip -N -P $usercmd "$user" $workgroupcmd "$workgroup" \
+     $hostip $passwdcmd -P $usercmd "$user" $workgroupcmd "$workgroup" \
      -c "$command" 2>/dev/null

Comment 1 IBM Bug Proxy 2003-10-23 16:27:13 UTC
Created attachment 95432 [details]
smbprint.txt

Comment 2 IBM Bug Proxy 2003-10-23 16:27:51 UTC
Created attachment 95433 [details]
pysmb.txt

Comment 3 Mike Ranweiler 2003-10-24 14:36:13 UTC
------ Additional Comments From thinh.com  2003-24-10 10:33 -------
Glen, 
The patch was for redhat-config-printer, so I think we should change the
component on RedHat bug to redhat-config-printer instead of samba. 

Comment 4 IBM Bug Proxy 2003-12-19 18:59:16 UTC
------ Additional Comments From rayda.com  2003-12-19 10:09 -------
This bug still exists in first drop of the RHEL 3 QU1. 

Comment 5 IBM Bug Proxy 2004-01-06 15:02:38 UTC
------ Additional Comments From khoa.com  2004-01-06 04:08 -------
Glen/Mark - we really need Red Hat to pick up this patch in the next update.
Thanks.

Ray - this bug should be in the SUBMITTED state as the patch is available
and it has been submitted to Red Hat (Red Hat just has not picked it up).
We'll escalate this with Red Hat.  Thanks. 

Comment 6 IBM Bug Proxy 2004-01-09 17:12:08 UTC
------ Additional Comments From khoa.com  2004-01-09 12:00 -------
This is on the list for RHEL3 Update 3. 

Comment 7 IBM Bug Proxy 2004-01-09 17:16:56 UTC
------ Additional Comments From rayda.com  2004-01-09 12:05 -------
Good grief!  We haven't even got QU1 out the door.  Why can't this be in QU2 at 
the latest?  Why wait until QU3? 

Comment 8 Tim Waugh 2004-02-06 10:07:06 UTC
Someone changed the component without reassigning the bug to the
component owner.  Reassigning (I was lucky I saw this at all).

Comment 9 Tim Waugh 2004-02-06 10:11:16 UTC
Okay, as it happens this fix is already queued.

Comment 12 IBM Bug Proxy 2004-02-27 21:26:36 UTC
----- Additional Comments From mranweil.com  2004-02-27 16:28 -------
I believe this is in the queue for QU2.  We should look for this then. 

Comment 13 IBM Bug Proxy 2004-04-13 23:57:24 UTC
----- Additional Comments From pbowen.com  2004-04-13 19:59 -------
Ray PLs you or Joe verify this in QU2. Thanks 

Comment 14 IBM Bug Proxy 2004-04-22 13:12:28 UTC
----- Additional Comments From rayda.com  2004-04-22 09:15 -------
Got a printer test page in hand from QU2.  Closing.