[jcifs] jcifs.smb.SmbException: Unsupported trying to list samba shares of Linux Box

Michael B Allen ioplex at gmail.com
Sun Nov 16 22:54:34 GMT 2008


Actually I know what the problem is. From looking at the stack trace
the server clearly wants "session security" and not the usual "user
security". Session security is like Windows 95 passwords on a share.
Apparently this code changed a bit in 1.3. I can't tell exactly why.
I'll add it to the TODO list of things to fix but don't count on it
any time soon. Windows hasn't supported session security since Windows
98. As a matter of fact, I'm a little surprised Samba still supports
it.

Just use 1.2 for now and it will work.

Mike

On Sun, Nov 16, 2008 at 1:20 PM, rosso <fivefinger at gmx.net> wrote:
> Ah, i know i don't need the URL class, just testing different stuff of this
> module. I tried with a String before, same result as with URL instance.
> I get exactly the same Exception for the examples/ListFiles.
> Just to make sure: The server itself works. i can access it with other
> programs.
>
> rosso
>
>
> Am Sonntag 16 November 2008 19:03:39 schrieb Michael B Allen:
>> On Sun, Nov 16, 2008 at 7:42 AM, rosso <fivefinger at gmx.net> wrote:
>> > Cheers Mike.
>> >
>> > So,
>> > with those two options the output is exactly as before.
>> > Well, i'm quite new to java and i'm not into SMB too much, so what
>> > exactly looks odd to you, maybe i dont see something thats supposed to be
>> > obvious?
>>
>> You don't need to use the URL class.
>>
>> Just try the examples/ListFiles.java example.
>>
>> Does that yield the same "unsupported" SmbException?
>>
>> Mike
>>
>> > As far as i got it from the API i can call the SmbFile constructor with a
>> > URL of a SMB-Server as single argument and can call the list() method  on
>> > it to get an array of Strings that describe the shares on the Server.
>> > And as i mentioned the same code with just a different ServerURL pointing
>> > to a Windows box works exactly like it is supposed to.
>> > That's what is confusing me most.
>> >
>> > rosso
>> >
>> > Am Freitag 14 November 2008 21:45:40 schrieb Michael B Allen:
>> >> If you set jcifs.lmCompatibility = 0 and
>> >> jcifs.smb.client.useExtendedSecurity = false does it work?
>> >>
>> >> If not it could be that you're using JCIFS in some way that is
>> >> provoking different  behavior. Your sample code is somewhat odd. Do
>> >> any of the examples generate the same behavior?
>> >>
>> >> Mike
>> >>
>> >> On Fri, Nov 14, 2008 at 6:37 AM, rosso <fivefinger at gmx.net> wrote:
>> >> > Hello people!
>> >> >
>> >> > Im about to write a small app to do incremental backups of samba
>> >> > shares in a local network.
>> >> > While playing around with the jcifs module (1.3.0) i experienced
>> >> > problems browsing a share on a linux box running smbd 3.2.3
>> >> > While this test Code works fine for a Winbox on the same network it
>> >> > fails on the linux box.
>> >> >
>> >> > smb://diskordia/ found                         #note: smb.exists()
>> >> > jcifs.smb.SmbException: Unsupported            #note: smb.list()
>> >> >        at
>> >> > jcifs.smb.SmbComSessionSetupAndX.<init>(SmbComSessionSetupAndX.java:82
>> >> >) at jcifs.smb.SmbSession.sessionSetup(SmbSession.java:282) at
>> >> > jcifs.smb.SmbSession.send(SmbSession.java:234)
>> >> >        at jcifs.smb.SmbTree.treeConnect(SmbTree.java:161)
>> >> >        at jcifs.smb.SmbFile.doConnect(SmbFile.java:850)
>> >> >        at jcifs.smb.SmbFile.doShareEnum(SmbFile.java:1725)
>> >> >        at jcifs.smb.SmbFile.doEnum(SmbFile.java:1673)
>> >> >        at jcifs.smb.SmbFile.list(SmbFile.java:1646)
>> >> >        at jcifs.smb.SmbFile.list(SmbFile.java:1543)
>> >> >        at HornySync.main(HornySync.java:20)
>> >> >
>> >> > Is this some incompatibility?
>> >> > I also tried to set up the environment properly by configuring the
>> >> > linux box as WINS Server and setting jcifs.netbios.wins to the
>> >> > corresponding ip. Funny is that smb.exists() works for just the server
>> >> > (smb://diskordia/), but reports "unsupported" for the share
>> >> > (smb://diskordia/data/).
>> >> >
>> >> > Here's my Testcode:
>> >> >
>> >> > import jcifs.smb.*;
>> >> > import java.net.URL;
>> >> >
>> >> > public class HornySync {
>> >> >    public static void main (String[] args) {
>> >> >        URL path = null;
>> >> >        SmbFile smb = null;
>> >> >        jcifs.Config.registerSmbURLHandler();
>> >> >        try {path = new URL("smb://diskordia/");}
>> >> >        catch (Exception e) {e.printStackTrace( System.out);}
>> >> >        try {smb = new SmbFile(path);}
>> >> >        catch (Exception e) {e.printStackTrace( System.out);}
>> >> >        try {if (smb.exists()) {System.out.println(smb+" found");}}
>> >> >        catch (SmbException e) {e.printStackTrace( System.out);}
>> >> >        String [] files = new String[600];
>> >> >        try {
>> >> >            files = smb.list();
>> >> >            for (String file : files) {
>> >> >                System.out.println(file);
>> >> >            }
>> >> >        }
>> >> >        catch (SmbException e) {e.printStackTrace( System.out);}
>> >> >    }
>> >> > }
>> >> >
>> >> >
>> >> > Any help is appreciated.
>> >> >
>> >> > Cheeers
>> >> >
>> >> >
>> >> > rosso
>
>



-- 
Michael B Allen
PHP Active Directory SPNEGO SSO
http://www.ioplex.com/


More information about the jcifs mailing list