[jcifs] Bug listing available shares
Rob Wygand
rob at wygand.com
Wed Jan 16 05:45:45 EST 2002
Mike,
It *seems* wrong that user X can see user Y's home dir, simply because
user Y logged into the (our) system first, which is what's happening.
From what I understand, you should only ever see your home share.
As for reusing *a*.getCanonicalPath()... yeah, I see that in the
printing I did that, but that's the only place I did that... all of the
iterations over the files array use the right SmbFile instance. =)
rjw
Allen, Michael B (RSCH) wrote:
> Are you using Samba? I just ran this against Samba and I get:
>
> [miallen at miallen2 examples]$ java SmnTest
> smb://miallen:pass1@172.134.34.39
> tmp
> IPC$
> lp
> miallen
> smb://foo:pass2@172.134.34.39
> tmp
> IPC$
> lp
> miallen
> foo
> smb://bar:pass3@172.134.34.39
> tmp
> IPC$
> lp
> miallen
> foo
> bar
>
> but you know you're using *a*.getCanonicalPath in each of the three
> sections BTW. Is this what mean and how do you know it's wrong? I can
> see from traces there is no "wierd caching"; this stuff is coming right
> out of Samba 2.0.6-9's NetShareEnum responses verbatum.
>
> I think the problem is a bad interaction with jCIFS reusing the socket
> and Samba's dynamic generation of home shares. We could slide
> over to samba technical and ask them about it?
>
> Mike
>
>
>>-----Original Message-----
>>From: Rob Wygand [SMTP:rob at wygand.com]
>>Sent: Monday, January 14, 2002 8:47 PM
>>To: jcifs at samba.org
>>Subject: [jcifs] Bug listing available shares
>>
>>Mike,
>>
>>When listing shares, I'm seeing some weird caching issue. Basically, if
>>I list shares on a server as user1, then as user2 I see the home share I
>>saw in the user1 listing. Then if I list again as user1, I see the
>>user2's home dir. These should not be showing up at all. here's a sample
>>program and it's output:
>>
>>===== SmnTest.java =====
>>import jcifs.smb.*;
>>
>>public class SmbTest extends Object
>>{
>> public static void main (String[] args)
>> {
>> try
>> {
>> SmbFile[] files = null;
>>
>> SmbFile a = new SmbFile ("smb://DOMAIN;user1:pass@10.1.3.161/");
>> System.out.println (a.getCanonicalPath());
>> files = a.listFiles();
>> for (int i = 0; i < files.length; ++i)
>> {
>> System.out.println ("\t" + files[i].getName());
>> }
>>
>> SmbFile b = new SmbFile ("smb://DOMAIN;user2:pass2@10.1.3.161/");
>> System.out.println (a.getCanonicalPath());
>> files = b.listFiles();
>> for (int i = 0; i < files.length; ++i)
>> {
>> System.out.println ("\t" + files[i].getName());
>> }
>>
>> SmbFile c = new SmbFile ("smb://DOMAIN;user1:pass@10.1.3.161/");
>> System.out.println (a.getCanonicalPath());
>> files = c.listFiles();
>> for (int i = 0; i < files.length; ++i)
>> {
>> System.out.println ("\t" + files[i].getName());
>> }
>> }
>> catch (Exception e)
>> {
>> System.out.println ("Exception: " + e.toString());
>> }
>> }
>>}
>>
>>===== Sample Output =====
>>[rob at elbereth]$ /usr/java/jdk1.3.1_01/bin/java SmbTest
>>
>>smb://DOMAIN;user1:pass@10.1.3.161
>> rootdir
>> CVSROOT
>> IPC$
>> user1
>>smb://DOMAIN;user2:pass2@10.1.3.161
>> rootdir
>> CVSROOT
>> IPC$
>> user1
>> user2
>>smb://DOMAIN;user1:pass@10.1.3.161
>> rootdir
>> CVSROOT
>> IPC$
>> user1
>> user2
>>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3229 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.samba.org/archive/jcifs/attachments/20020115/97beb849/smime.bin
More information about the jcifs
mailing list