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",
struct _SECURITY_DESCRIPTOR * PSECURITY_DESCRIPTOR
int nfs_to_windows_error(int status, int default_error)
static int map_name_2_sid(DWORD *sid_len, PSID *sid, LPCSTR name)
BOOL WINAPI MakeSelfRelativeSD(PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor, PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor, LPDWORD lpdwBufferLength)
int nfs41_setattr(IN nfs41_session *session, IN nfs41_path_fh *file, IN stateid_arg *stateid, IN nfs41_file_info *info)
BOOL WINAPI SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, BOOL bDaclPresent, PACL pDacl, BOOL bDaclDefaulted)
enum _SID_NAME_USE SID_NAME_USE
#define ERROR_INTERNAL_ERROR
BOOL WINAPI InitializeAcl(PACL pAcl, DWORD nAclLength, DWORD dwAclRevision)
void nfsacl41_free(nfsacl41 *acl)
static int map_dacl_2_nfs4acl(PACL acl, PSID sid, PSID gsid, nfsacl41 *nfs4_acl, int file_type, char *domain)
ACPI_SIZE strlen(const char *String)
static int map_nfs4ace_who(PSID sid, PSID owner_sid, PSID group_sid, char *who_out, char *domain)
BOOL WINAPI InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD dwRevision)
BOOL WINAPI EqualSid(PSID pSid1, PSID pSid2)
char who[NFS4_OPAQUE_LIMIT]
GLuint GLuint GLsizei count
static void free_sids(PSID *sids, int count)
#define ERROR_NONE_MAPPED
BOOL WINAPI AddAccessAllowedAce(PACL pAcl, DWORD dwAceRevision, DWORD AccessMask, PSID pSid)
void print_hexbuf_no_asci(int level, unsigned char *title, unsigned char *buf, int len)
#define ACE4_GENERIC_EXECUTE
static int marshall_setacl(unsigned char *buffer, uint32_t *length, nfs41_upcall *upcall)
static int check_4_special_identifiers(char *who, PSID *sid, DWORD *sid_len, BOOLEAN *flag)
DWORD WINAPI GetLastError(VOID)
void eprintf(LPCSTR format,...)
#define GROUP_SECURITY_INFORMATION
#define NO_PROPAGATE_INHERIT_ACE
void print_nfs_access_mask(int on, int m)
BOOL WINAPI GetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID *pGroup, LPBOOL lpbGroupDefaulted)
BOOL WINAPI SetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID pOwner, BOOL bOwnerDefaulted)
static int handle_setacl(nfs41_upcall *upcall)
#define SECURITY_DESCRIPTOR_REVISION
static int convert_nfs4acl_2_dacl(nfsacl41 *acl, int file_type, PACL *dacl_out, PSID **sids_out)
#define ACE4_INHERIT_ONLY_ACE
void print_windows_access_mask(int on, ACCESS_MASK m)
#define NFS41_HOSTNAME_LEN
GLenum GLuint GLenum GLsizei length
static int handle_getacl(nfs41_upcall *upcall)
#define NFS4_OPAQUE_LIMIT
BOOL WINAPI SetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID pGroup, BOOL bGroupDefaulted)
#define ACE4_GENERIC_READ
void nfs41_open_stateid_arg(IN nfs41_open_state *state, OUT struct __stateid_arg *arg)
static struct domain * add_domain(struct session *session, WCHAR *name)
int nfs41_getattr(IN nfs41_session *session, IN OPTIONAL nfs41_path_fh *file, IN bitmap4 *attr_request, OUT nfs41_file_info *info)
BOOL WINAPI GetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, LPBOOL lpbDaclPresent, PACL *pDacl, LPBOOL lpbDaclDefaulted)
static int parse_setacl(unsigned char *buffer, uint32_t length, nfs41_upcall *upcall)
#define CONTAINER_INHERIT_ACE
BOOL WINAPI AddAccessDeniedAce(PACL pAcl, DWORD dwAceRevision, DWORD AccessMask, PSID pSid)
#define ACE4_FILE_INHERIT_ACE
static int marshall_getacl(unsigned char *buffer, uint32_t *length, nfs41_upcall *upcall)
int nfs41_delegation_return(IN nfs41_session *session, IN nfs41_path_fh *file, IN enum open_delegation_type4 access, IN bool_t truncate)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
static void convert_nfs4name_2_user_domain(LPSTR nfs4name, LPSTR *domain)
#define ACCESS_ALLOWED_ACE_TYPE
int safe_write(unsigned char **pos, uint32_t *remaining, void *src, uint32_t src_len)
const char * nfs_error_string(int status)
FD_TYPE file_type(FDSC **curr, char *fixed)
#define ACCESS_DENIED_ACE_TYPE
BOOL WINAPI ConvertSidToStringSidA(PSID Sid, LPSTR *StringSid)
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
static int parse_getacl(unsigned char *buffer, uint32_t length, nfs41_upcall *upcall)
#define ACE4_GENERIC_WRITE
const nfs41_upcall_op nfs41_op_getacl
#define memcpy(s1, s2, n)
const nfs41_upcall_op nfs41_op_setacl
#define ACE4_DIRECTORY_INHERIT_ACE
#define ACE4_ACCESS_DENIED_ACE_TYPE
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
BOOL WINAPI GetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID *pOwner, LPBOOL lpbOwnerDefaulted)
BOOL WINAPI GetAce(PACL pAcl, DWORD dwAceIndex, LPVOID *pAce)
HLOCAL NTAPI LocalFree(HLOCAL hMem)
#define ACE4_ACCESS_ALLOWED_ACE_TYPE
static int is_well_known_sid(PSID sid, char *who)
#define OWNER_SECURITY_INFORMATION
nfs41_updowncall_list upcall
#define ERROR_NOT_SUPPORTED
ACCESS_MASK * PACCESS_MASK
#define ACE4_AUTHENTICATED
int safe_read(unsigned char **pos, uint32_t *remaining, void *dest, uint32_t dest_len)
BOOL WINAPI IsValidSid(PSID pSid)
static void map_aceflags(BYTE win_aceflags, uint32_t *nfs4_aceflags)
BOOL WINAPI IsWellKnownSid(IN PSID pSid, IN WELL_KNOWN_SID_TYPE WellKnownSidType)
GLuint GLuint GLsizei GLenum type
#define ACE4_NO_PROPAGATE_INHERIT_ACE
BOOL WINAPI CreateWellKnownSid(IN WELL_KNOWN_SID_TYPE WellKnownSidType, IN PSID DomainSid OPTIONAL, OUT PSID pSid, IN OUT DWORD *cbSid)
static SERVICE_STATUS status
static int create_unknownsid(WELL_KNOWN_SID_TYPE type, PSID *sid, DWORD *sid_len)
#define OBJECT_INHERIT_ACE
#define DACL_SECURITY_INFORMATION
#define LookupAccountName
#define ACE4_INHERITED_ACE
char localdomain_name[NFS41_HOSTNAME_LEN]
static void map_acemask(ACCESS_MASK mask, int file_type, uint32_t *nfs4_mask)
#define ERROR_INSUFFICIENT_BUFFER