47 dprintf(1,
"parsing NFS41_ACL_QUERY: info_class=%d\n",
args->query);
60 dprintf(
ACLLVL,
"create_unknownsid: CreateWellKnownSid type %d returned %d "
61 "GetLastError %d sid len %d needed\n",
type,
status,
76 eprintf(
"create_unknownsid: CreateWellKnownSid failed with %d\n",
status);
84 for(;
p[0] !=
'\0';
p++) {
101 dprintf(
ACLLVL,
"map_name_2_sid: LookupAccountName for %s returned %d "
102 "GetLastError %d name len %d domain len %d\n",
name,
status,
122 eprintf(
"map_name_2_sid: LookupAccountName for %s failed "
130 dprintf(1,
"map_name_2_sid: sid_type = %d SID %s\n",
133 dprintf(1,
"map_name_2_sid: ConvertSidToStringSidA failed "
136 dprintf(1,
"map_name_2_sid: Invalid Sid ?\n");
170 type = WinCreatorOwnerSid;
172 type = WinCreatorGroupSid;
235 eprintf(
"convert_nfs4acl_2_dacl: AddAccessAllowedAce failed "
243 eprintf(
"convert_nfs4acl_2_dacl: AddAccessDeniedAce failed "
249 eprintf(
"convert_nfs4acl_2_dacl: unknown acetype %d\n",
258 eprintf(
"convert_nfs4acl_2_dacl: InitializeAcl failed with %d\n",
status);
291 attr_request.
count = 2;
301 eprintf(
"handle_getacl: nfs41_cached_getattr() failed with %d\n",
310 eprintf(
"handle_getacl: InitializeSecurityDescriptor failed with %d\n",
322 dprintf(
ACLLVL,
"handle_getacl: OWNER_SECURITY_INFORMATION: for user=%s "
331 eprintf(
"handle_getacl: SetSecurityDescriptorOwner failed with "
338 dprintf(
ACLLVL,
"handle_getacl: GROUP_SECURITY_INFORMATION: for %s "
347 eprintf(
"handle_getacl: SetSecurityDescriptorGroup failed with "
353 dprintf(
ACLLVL,
"handle_getacl: DACL_SECURITY_INFORMATION\n");
360 eprintf(
"handle_getacl: SetSecurityDescriptorDacl failed with "
366 args->sec_desc_len = 0;
374 eprintf(
"handle_getacl: MakeSelfRelativeSD failes with %d\n",
status);
385 eprintf(
"handle_getacl: MakeSelfRelativeSD failes with %d\n",
status);
392 if (osid)
free(osid);
395 if (gsid)
free(gsid);
439 dprintf(1,
"parsing NFS41_ACL_SET: info_class=%d sec_desc_len=%d\n",
440 args->query, sec_desc_len);
448 for (
i = 0;
i < 78;
i++) {
454 case WinCreatorOwnerSid:
460 case WinAnonymousSid:
466 case WinCreatorGroupSid:
467 case WinBuiltinUsersSid:
470 case WinAuthenticatedUserSid:
482 case WinInteractiveSid:
485 case WinNetworkServiceSid:
486 case WinLocalServiceSid:
490 default:
return FALSE;
510 win_aceflags, *nfs4_aceflags);
518 if (
mask & 0xf000000) {
534 *nfs4_mask =
mask & 0x00ffffff;
575 &tmp_size, &sid_type);
576 dprintf(
ACLLVL,
"map_nfs4ace_who: LookupAccountSid returned %d GetLastError "
589 tmp_buf =
malloc(tmp_size);
593 &tmp_size, &sid_type);
596 eprintf(
"map_nfs4ace_who: LookupAccountSid failed with %d\n",
619 dprintf(
ACLLVL,
"this is a NULL dacl: all access to an object\n");
641 (
unsigned char *)acl, acl->
AclSize);
642 nfs4_acl->
count = acl->AceCount;
649 for (
i = 0;
i < acl->AceCount;
i++) {
653 eprintf(
"map_dacl_2_nfs4acl: GetAce failed with %d\n",
status);
656 tmp_pointer = (
PBYTE)ace;
658 (
unsigned char *)ace, ace->
AceSize);
665 eprintf(
"map_dacl_2_nfs4acl: unsupported ACE type %d\n",
699 BOOL sid_default, gsid_default;
703 dprintf(
ACLLVL,
"handle_setacl: OWNER_SECURITY_INFORMATION\n");
707 eprintf(
"GetSecurityDescriptorOwner failed with %d\n",
status);
721 dprintf(
ACLLVL,
"handle_setacl: GROUP_SECURITY_INFORMATION\n");
725 eprintf(
"GetSecurityDescriptorOwner failed with %d\n",
status);
739 BOOL dacl_present, dacl_default;
741 dprintf(
ACLLVL,
"handle_setacl: DACL_SECURITY_INFORMATION\n");
743 &acl, &dacl_default);
746 eprintf(
"GetSecurityDescriptorDacl failed with %d\n",
status);
752 eprintf(
"GetSecurityDescriptorOwner failed with %d\n",
status);
758 eprintf(
"GetSecurityDescriptorOwner failed with %d\n",
status);
766 info.acl = &nfs4_acl;
780 dprintf(
ACLLVL,
"handle_setacl: nfs41_setattr() failed with error %s.\n",
ACPI_SIZE strlen(const char *String)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
static void map_aceflags(BYTE win_aceflags, uint32_t *nfs4_aceflags)
static int parse_getacl(unsigned char *buffer, uint32_t length, nfs41_upcall *upcall)
static int handle_setacl(nfs41_upcall *upcall)
static void free_sids(PSID *sids, int count)
static int create_unknownsid(WELL_KNOWN_SID_TYPE type, PSID *sid, DWORD *sid_len)
const nfs41_upcall_op nfs41_op_setacl
static int convert_nfs4acl_2_dacl(nfsacl41 *acl, int file_type, PACL *dacl_out, PSID **sids_out)
static int map_dacl_2_nfs4acl(PACL acl, PSID sid, PSID gsid, nfsacl41 *nfs4_acl, int file_type, char *domain)
static int parse_setacl(unsigned char *buffer, uint32_t length, nfs41_upcall *upcall)
char localdomain_name[NFS41_HOSTNAME_LEN]
static int handle_getacl(nfs41_upcall *upcall)
static int is_well_known_sid(PSID sid, char *who)
static int marshall_getacl(unsigned char *buffer, uint32_t *length, nfs41_upcall *upcall)
static int check_4_special_identifiers(char *who, PSID *sid, DWORD *sid_len, BOOLEAN *flag)
static int marshall_setacl(unsigned char *buffer, uint32_t *length, nfs41_upcall *upcall)
static int map_name_2_sid(DWORD *sid_len, PSID *sid, LPCSTR name)
static void map_acemask(ACCESS_MASK mask, int file_type, uint32_t *nfs4_mask)
static void convert_nfs4name_2_user_domain(LPSTR nfs4name, LPSTR *domain)
const nfs41_upcall_op nfs41_op_getacl
static int map_nfs4ace_who(PSID sid, PSID owner_sid, PSID group_sid, char *who_out, char *domain)
int safe_write(unsigned char **pos, uint32_t *remaining, void *src, uint32_t src_len)
int safe_read(unsigned char **pos, uint32_t *remaining, void *dest, uint32_t dest_len)
int nfs_to_windows_error(int status, int default_error)
void eprintf(LPCSTR format,...)
const char * nfs_error_string(int status)
void print_nfs_access_mask(int on, int m)
void print_hexbuf_no_asci(int level, unsigned char *title, unsigned char *buf, int len)
void print_windows_access_mask(int on, ACCESS_MASK m)
#define ERROR_INSUFFICIENT_BUFFER
int nfs41_delegation_return(IN nfs41_session *session, IN nfs41_path_fh *file, IN enum open_delegation_type4 access, IN bool_t truncate)
BOOL WINAPI IsValidSid(PSID pSid)
BOOL WINAPI IsWellKnownSid(IN PSID pSid, IN WELL_KNOWN_SID_TYPE WellKnownSidType)
BOOL WINAPI InitializeAcl(PACL pAcl, DWORD nAclLength, DWORD dwAclRevision)
BOOL WINAPI InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD dwRevision)
BOOL WINAPI AddAccessAllowedAce(PACL pAcl, DWORD dwAceRevision, DWORD AccessMask, PSID pSid)
BOOL WINAPI ConvertSidToStringSidA(PSID Sid, LPSTR *StringSid)
BOOL WINAPI EqualSid(PSID pSid1, PSID pSid2)
BOOL WINAPI GetAce(PACL pAcl, DWORD dwAceIndex, LPVOID *pAce)
BOOL WINAPI AddAccessDeniedAce(PACL pAcl, DWORD dwAceRevision, DWORD AccessMask, PSID pSid)
BOOL WINAPI CreateWellKnownSid(IN WELL_KNOWN_SID_TYPE WellKnownSidType, IN PSID DomainSid OPTIONAL, OUT PSID pSid, IN OUT DWORD *cbSid)
#define ERROR_NOT_SUPPORTED
GLuint GLuint GLsizei GLenum type
GLuint GLuint GLsizei count
GLuint GLsizei GLsizei * length
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean flag
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
HLOCAL NTAPI LocalFree(HLOCAL hMem)
enum _SID_NAME_USE SID_NAME_USE
#define memcpy(s1, s2, n)
struct _SECURITY_DESCRIPTOR * PSECURITY_DESCRIPTOR
void nfs41_open_stateid_arg(IN nfs41_open_state *state, OUT struct __stateid_arg *arg)
#define ACE4_GENERIC_WRITE
#define ACE4_GENERIC_READ
#define ACE4_INHERIT_ONLY_ACE
#define ACE4_FILE_INHERIT_ACE
#define NFS41_HOSTNAME_LEN
@ FATTR4_WORD1_OWNER_GROUP
#define ACE4_NO_PROPAGATE_INHERIT_ACE
#define ACE4_AUTHENTICATED
#define ACE4_ACCESS_ALLOWED_ACE_TYPE
#define ACE4_DIRECTORY_INHERIT_ACE
#define ACE4_ACCESS_DENIED_ACE_TYPE
#define NFS4_OPAQUE_LIMIT
#define ACE4_GENERIC_EXECUTE
#define ACE4_INHERITED_ACE
nfs41_updowncall_list upcall
int nfs41_getattr(IN nfs41_session *session, IN OPTIONAL nfs41_path_fh *file, IN bitmap4 *attr_request, OUT nfs41_file_info *info)
int nfs41_setattr(IN nfs41_session *session, IN nfs41_path_fh *file, IN stateid_arg *stateid, IN nfs41_file_info *info)
void nfsacl41_free(nfsacl41 *acl)
ACCESS_MASK * PACCESS_MASK
FD_TYPE file_type(FDSC **curr, char *fixed)
BOOL WINAPI GetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID *pGroup, LPBOOL lpbGroupDefaulted)
BOOL WINAPI SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, BOOL bDaclPresent, PACL pDacl, BOOL bDaclDefaulted)
BOOL WINAPI SetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID pOwner, BOOL bOwnerDefaulted)
BOOL WINAPI MakeSelfRelativeSD(PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor, PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor, LPDWORD lpdwBufferLength)
BOOL WINAPI GetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, LPBOOL lpbDaclPresent, PACL *pDacl, LPBOOL lpbDaclDefaulted)
BOOL WINAPI SetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID pGroup, BOOL bGroupDefaulted)
BOOL WINAPI GetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID *pOwner, LPBOOL lpbOwnerDefaulted)
char who[NFS4_OPAQUE_LIMIT]
DWORD WINAPI GetLastError(void)
#define LookupAccountName
#define ERROR_INTERNAL_ERROR
#define ERROR_NONE_MAPPED
static struct domain * add_domain(struct session *session, WCHAR *name)
#define CONTAINER_INHERIT_ACE
#define DACL_SECURITY_INFORMATION
#define ACCESS_ALLOWED_ACE_TYPE
#define OWNER_SECURITY_INFORMATION
#define OBJECT_INHERIT_ACE
#define NO_PROPAGATE_INHERIT_ACE
#define ACCESS_DENIED_ACE_TYPE
#define SECURITY_DESCRIPTOR_REVISION
#define GROUP_SECURITY_INFORMATION