libsmb : Cannot get certain attributes using getattrE function

Satwik Hebbar satwikh at calsoftinc.com
Mon Mar 28 15:58:54 GMT 2005


Hey everybody,

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 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  
someone tell me what I need to do to get this working? Is there some other  
function I need to use? I tried getatr too with similar results.

I carried my tests against a WIN2K server.
I open the file with read and write permissions and in the backup-user  
context before making the getattrE call with the file handle I get.

An  interesting thing to note is that during the open action (using  
nt_create_andx), ethereal shows that we also get the file attributes in  
the response from the server and here the appropriate bits (encrypted et  
al. as required) are set. I was wondering if there is a way I could get  
attributes from the nt_create_andx call, if I cannot get it like the  
nt_create_andx call using getattrE.

Thanks for your patience,
Satwik.


-- 
----------------------------------------------------------------------
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