Need help: How to get share permissions
sdhivya at novell.com
Mon Oct 15 07:20:38 MDT 2012
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"
path: C:\Documents and Settings\Administrator\Desktop\sh
type: 0x8004: SEC_DESC_DACL_PRESENT SEC_DESC_SELF_RELATIVE
ACL Num ACEs: 2 revision: 2
type: ACCESS ALLOWED (0) flags: 0x00
Specific bits: 0x1ff
Permissions: 0x1f01ff: SYNCHRONIZE_ACCESS WRITE_OWNER_ACCESS WRITE_DAC_ACCESS READ_CONTROL_ACCESS DELETE_ACCESS
This is the information I am interested in
"Permissions: 0x1f01ff: SYNCHRONIZE_ACCESS WRITE_OWNER_ACCESS WRITE_DAC_ACCESS READ_CONTROL_ACCESS DELETE_ACCESS
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?
More information about the samba-technical