summaryrefslogtreecommitdiff
path: root/getcifsacl.c
AgeCommit message (Collapse)AuthorFilesLines
2012-11-09getcifsacl: don't freely cast between wbcDomainSid and cifs_sidJeff Layton1-17/+21
While they are very similar, the cifs_sid is "packed" and the wbcDomainSid isn't. There are also aliasing problems with gcc in some cases. Instead of trying to cast and fix endianness in place, make a separate copy instead. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-11-07getcifsacl: fix up printing of REVISION: and CONTROL: fieldsJeff Layton1-2/+2
They need endianness conversion too... Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-11-07getcifsacl: fix endianness bug in getcifsacl and add better bounds checksJeff Layton1-3/+11
getcifsacl must convert the access_req field from little endian. Also, we should ensure that the "size" field in the ACE is reachable before trying to access it. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-11-07getcifsacl: fix raw SID printing routineJeff Layton1-9/+20
The current routine prints multiple authority values as different numbers instead of combining them, which is wrong. Print the SID according to the rules in MS-DTYP. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-11-07getcifsacl: don't use wbcDomainSid internallyJeff Layton1-15/+16
Use our own cifs_sid instead and cast it to a wbcDomainSid before handing it off to winbind. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-11-07getcifsacl: fix endianness before handing off SID to winbindJeff Layton1-2/+17
winbind expects SIDs to be expressed in host-endian. Convert them from little-endian before asking winbind to convert them to names. Also use the WBC_ERROR_IS_OK() macro to check the return code. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-11-07getcifsacl: clarify magic number if print_aceJeff Layton1-2/+2
Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-11-07get/setcifsacl: set "prog" via basename(argv[0])Jeff Layton1-1/+2
This saves a tiny bit of memory, and doesn't make the program assume that the binary is named something in particular. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-08-21cifs-utils: fix up references to getcifsacl and setcifsacl filesJeff Layton1-1/+1
When I moved the manpages for this to section 1, I missed some references to them. Also, get rid of the unneeded clean-local-aclprogs makefile target. Signed-off-by: Jeff Layton <jlayton@samba.org>
2011-08-25cifsacl: Add file getcifsacl.c (try #2)Shirish Pargaonkar1-0/+389
Parse the blob that contains a security descriptor obtained by calling getxattr API using attribute system.cifs_acl . Start parsing and printing security descriptor including the a DACL within the security descriptor, printing each ACE of the DACL by printing SID, type, flags, and mask. Winbind apis are used to translate raw SID to a name. Signed-off-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>