Detect Vista symlinks with libsmbclient
derrell at samba.org
derrell at samba.org
Thu Apr 26 12:20:38 GMT 2007
Henrik Zagerholm <henke at mac.se> writes:
> 25 apr 2007 kl. 18:43 skrev derrell at samba.org:
>
>> Henrik Zagerholm <henke at mac.se> writes:
>>
>>> I've just started to experiment with Vista and I wonder if I can somehow
>>> tell if a file object is an ordinary file or a symlink/junction?
>>>
>>> As I understand it I will not be able to follow symlinks until the
>>> implementation of SMB2 so in the meantime I would like to ignore those
>>> files
>>> (instead of throwing a bunch of EBADF).
>>>
>>> Any ideas?
>>
>> Henrik, have you tried calling smbc_stat() on a symlink to see what it gives
>> you? There may be some useful bit set in the mode field.
>>
>> If that doesn't provide any useful information, please post a bugzilla
>> ticket
>> for this. I expect to have a Vista environment available to me fairly soon,
>> at which time I'll be able to look into this.
>>
>
> I've now tried both smbc_stat and smbc_getxattr and can't see any difference
> in the mode bits.
> I've opened up a bug at https://bugzilla.samba.org/show_bug.cgi?id=4557
Thanks.
> As I understand it we will be able to handle these things better with SMB
> 2.0 or? :)
Given my very limited experience with Vista, I can't give you an answer right
now. Once I get a Vista environment installed, I'll be able to look into
this. I expect that it'll still be a number of weeks before I get that set
up, though. If you want to experiment with packet traces between (a) two
Vista machines and (b) from an older Windows system to Vista to see whether
any useful information can be gleaned by comparing, I'd certainly be
interested in your results. In case (a) I expect a purely SMB2 conversation.
The real question will be if case (b) yields any useful ability with original
SMB to retrieve the information in question.
Cheers,
Derrell
More information about the samba-technical
mailing list