cli_getattrE problem

Satwik Hebbar satwikh at calsoftinc.com
Fri Apr 1 07:27:15 GMT 2005


Yeah Richard, that seems exactly to be the case. I had noted to Derell  
that the nt_create_andx call actually also fetches the attributes and in  
fact it gets them properly (I checked this on ethereal and the ENCRYPTED,  
COMPRESSED et al. flags were set when the file had those properties). I  
also managed to get this attribute field as a 32-bit integer from the  
nt_create_full call in clifile.c as follows -

IVAL(cli->inbuf, smb_vwv2+39).
and it always gives the correct value.

The problem is that there is some difference in the way nt_create sets its  
flags in the request and the getattrE does but I havent managed to figure  
it out. Will work on that and let you know if I hit upon something.

Satwik.

> On Thu, 31 Mar 2005 derrell at samba.org wrote:
>
>> > I am using the samba-3.0.9 version and basically we use the libsmb  
>> client
>> > for our development work where we access files on CIFS shares. I  
>> wanted to
>> > be able to recognise whether a file has the ENCRYPTED, OFFLINE,  
>> REPARSE
>> > POINT, COMPRESSED and other such attributes set. I believe the
>> > cli_getattrE() function in the libsmb is meant to return this  
>> information as
>> > part of the 16 bit attribute field that it returns. This field gives  
>> correct
>> > info about the rest of the file attributes like TEMPORARY, SYSTEM,  
>> HIDDEN,
>> > etc.  but somehow does not have the rest of the bits set even when I  
>> call
>> > the function on a file which has been encrypted or compressed and so
>> > on. Could you tell me what I need to do to get this working? Is there  
>> some
>> > other function I need to use? I tried cli_getatr too with similar
>> > results.
>>
>> This represents an interesting problem.  libsmbclient exports the smbc_
>> functions, which are intended to emulate POSIX functions.  Since there  
>> is
>> currently no POSIX function that would typically return ENCRYPTED,  
>> OFFLINE,
>> etc., there has been no need to have the internal cli_ functions return  
>> them.
>
> This might have to do with the attributes and flags we set when we start
> up the connection.
>
> Regards
> -----
> Richard Sharpe, rsharpe[at]richardsharpe.com, rsharpe[at]samba.org,
> sharpe[at]ethereal.com, http://www.richardsharpe.com
>



-- 
----------------------------------------------------------------------
When dreaming I'm guided through another world
Time and time again
At sunrise I fight to stay asleep
'Cause I don't want to leave the comfort of this place
'Cause there's a hunger, a longing to escape
 From the life I live when I'm awake
----------------------------------------------------------------------


More information about the samba-technical mailing list