jCIFS and Apple SMBX

Roger Thomas <[email protected]> Thu, 3 Sep 2015 18:25:13 +0000
Newsgroups gmane.network.samba.java
Message-ID <1C2816D682737343A2EC6DF70C6B81EB116B4F@ORD2MBX08B.mex05.mlsrvr.com>
--_000_1C2816D682737343A2EC6DF70C6B81EB116B4FORD2MBX08Bmex05ml_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

We are having trouble getting the jCIFS client to work with the newer SMBX.=
   I have a 10.7.5 test machine where we have been testing.   If I turn off=
 SMBX and turn on the SMBUp everything works as expected.   I am wonder if =
we need some client properties set to get it to work.   We have been testin=
g with this snippet of code

   NtlmPasswordAuthentication ntlm =3D new NtlmPasswordAuthentication( ntdo=
m, user, pass );
   try {
    SmbFile f1 =3D new SmbFile( "smb://@"+host+"/",ntlm );

    files =3D f1.list();
    for( int i=3D0; i< files.length; i++) {
      out.println( "<tr><td></td><td>" + files[i] + "</td></tr>");
    }

   }catch(Exception e){
    e.printStackTrace();

   }

Yields....

INFO  (09/03) 13:39:41 [stderr](Thread qtp1493657028-148): jcifs.smb.SmbAut=
hException: Logon failure: unknown user name or bad password.
INFO  (09/03) 13:39:41 [stderr](Thread qtp1493657028-148):      at jcifs.sm=
b.SmbSession.sessionSetup(SmbSession.java:406)
INFO  (09/03) 13:39:41 [stderr](Thread qtp1493657028-148):      at jcifs.sm=
b.SmbSession.send(SmbSession.java:218)


I can get you the full debug of this code working ( SMBup / Samba ) and wit=
h it not working ( SMBX ).   I can also get packet traces of the same.

Roger Thomas

--_000_1C2816D682737343A2EC6DF70C6B81EB116B4FORD2MBX08Bmex05ml_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html dir=3D"ltr">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-=
1">
<style type=3D"text/css" id=3D"owaParaStyle"></style>
</head>
<body fpstyle=3D"1" ocsi=3D"0">
<div style=3D"direction: ltr;font-family: Tahoma;color: #000000;font-size: =
10pt;">
<div style=3D"font-size: 13.3333330154419px;">We are having trouble getting=
 the jCIFS client to work with the newer SMBX. &nbsp; I have a 10.7.5 test =
machine where we have been testing. &nbsp; If I turn off SMBX and turn on t=
he SMBUp everything works as expected. &nbsp; I am
 wonder if we need some client properties set to get it to work. &nbsp; We =
have been testing with this snippet of code</div>
<div style=3D"font-size: 13.3333330154419px;"><br>
</div>
<div style=3D"font-size: 13.3333330154419px;">&nbsp; &nbsp;NtlmPasswordAuth=
entication ntlm =3D new NtlmPasswordAuthentication( ntdom, user, pass );</d=
iv>
<div style=3D"font-size: 13.3333330154419px;">&nbsp; &nbsp;try {</div>
<div style=3D"font-size: 13.3333330154419px;">&nbsp; &nbsp; SmbFile f1 =3D =
new SmbFile( &quot;smb://@&quot;&#43;host&#43;&quot;/&quot;,ntlm );</div>
<div style=3D"font-size: 13.3333330154419px;">&nbsp; &nbsp;</div>
<div style=3D"font-size: 13.3333330154419px;">&nbsp; &nbsp; files =3D f1.li=
st();</div>
<div style=3D"font-size: 13.3333330154419px;">&nbsp; &nbsp; for( int i=3D0;=
 i&lt; files.length; i&#43;&#43;) {</div>
<div style=3D"font-size: 13.3333330154419px;">&nbsp; &nbsp; &nbsp; out.prin=
tln( &quot;&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&quot; &#43; files[i] &=
#43; &quot;&lt;/td&gt;&lt;/tr&gt;&quot;);</div>
<div style=3D"font-size: 13.3333330154419px;">&nbsp; &nbsp; }</div>
<div style=3D"font-size: 13.3333330154419px;">&nbsp; &nbsp;</div>
<div style=3D"font-size: 13.3333330154419px;">&nbsp; &nbsp;}catch(Exception=
 e){</div>
<div style=3D"font-size: 13.3333330154419px;">&nbsp; &nbsp;<span class=3D"A=
pple-tab-span" style=3D"white-space: pre;">
</span>e.printStackTrace();</div>
<div style=3D"font-size: 13.3333330154419px;">&nbsp; &nbsp;</div>
<div style=3D"font-size: 13.3333330154419px;">&nbsp; &nbsp;}</div>
<div style=3D"font-size: 13.3333330154419px;"><br>
</div>
<div style=3D"font-size: 13.3333330154419px;">Yields....</div>
<div style=3D"font-size: 13.3333330154419px;"><br>
</div>
<div style=3D"font-size: 13.3333330154419px;">
<div>INFO &nbsp;(09/03) 13:39:41 [stderr](Thread qtp1493657028-148): jcifs.=
smb.SmbAuthException: Logon failure: unknown user name or bad password.</di=
v>
<div>INFO &nbsp;(09/03) 13:39:41 [stderr](Thread qtp1493657028-148): &nbsp;=
 &nbsp; &nbsp;at jcifs.smb.SmbSession.sessionSetup(SmbSession.java:406)</di=
v>
<div>INFO &nbsp;(09/03) 13:39:41 [stderr](Thread qtp1493657028-148): &nbsp;=
 &nbsp; &nbsp;at jcifs.smb.SmbSession.send(SmbSession.java:218)</div>
</div>
<div style=3D"font-size: 13.3333330154419px;"><br>
</div>
<div style=3D"font-size: 13.3333330154419px;"><br>
</div>
<div style=3D"font-size: 13.3333330154419px;">I can get you the full debug =
of this code working ( SMBup / Samba ) and with it not working ( SMBX ). &n=
bsp; I can also get packet traces of the same.</div>
<div style=3D"font-size: 13.3333330154419px;"><br>
<div><font size=3D"2" face=3D"Tahoma">
<p class=3D"MsoNormal" style=3D"margin: 0in 0in 0pt; font-family: Calibri, =
sans-serif;">
<font size=3D"2">Roger Thomas</font></p>
</font></div>
</div>
</div>
</body>
</html>

--_000_1C2816D682737343A2EC6DF70C6B81EB116B4FORD2MBX08Bmex05ml_--