Need help: How to get share permissions

Dhivya Sundhari SDhivya at novell.com
Thu Oct 18 22:26:49 MDT 2012




>>>> Jim McDonough <jmcd at samba.org> 10/18/2012 9:36 PM >>>
>>On Mon, Oct 15, 2012 at 3:20 PM, Dhivya Sundhari <sdhivya at novell.com> wrote:
>> Hi,>
>>
>> I am using smbc_getxattr (public interface defined in libsmbclient.h) to get share's NTFS permissions. Following that I was looking for apis to get share permissions and figured out its possible using NetrShareGetInfo RPC.
>>
>> Using rpcclient I am able to get the information:
>> =================================================
>> $ rpcclient  serverip -Uusername%password -c "netsharegetinfo sh 502"
>>     remark:
>>     path:    C:\Documents and Settings\Administrator\Desktop\sh
>>     password:    (null)
>>     type:    0x0
>>     perms:    0
>>     max_uses:    -1
>>     num_uses:    1
>> revision: 1
>> type: 0x8004: SEC_DESC_DACL_PRESENT SEC_DESC_SELF_RELATIVE
>> DACL
>>     ACL    Num ACEs:    2    revision:    2
>>     ---
>     ACE
>>         type: ACCESS ALLOWED (0) flags: 0x00
>>         Specific bits: 0x1ff
>>         Permissions: 0x1f01ff: SYNCHRONIZE_ACCESS WRITE_OWNER_ACCESS WRITE_DAC_ACCESS READ_CONTROL_ACCESS DELETE_ACCESS
>>         SID: S-1-1-0
>>
>> ===============================================================
>>
>> This is the information I am interested in
>> "Permissions: 0x1f01ff: SYNCHRONIZE_ACCESS WRITE_OWNER_ACCESS WRITE_DAC_ACCESS READ_CONTROL_ACCESS DELETE_ACCESS
>> SID: S-1-1-0"
>>
> I am using libnetapi's function "NetShareGetInfo" in the test program to get similar result as that of rpcclient.
>> But the rpc call with level 502 is failing with error 50 (not_supported).  Other levels of this rpc dosen't return sec_desc_buf.
>>
>> Can anybody help me in identifying other ways to get share permissions? 

>Are you trying to do this for the local machine only, or across the network? 

No not local, across network.  

Thanks, 
Dhivya 



More information about the samba-technical mailing list