#define SMBACL4_PARAM_TYPE_NAME "nfs4"
+extern const struct generic_mapping file_generic_mapping;
+
#define SMB_ACE4_INT_MAGIC 0x76F8A967
typedef struct _SMB_ACE4_INT_T
{
SMB_ACE4_INT_T *last;
} SMB_ACL4_INT_T;
-extern struct current_user current_user;
-extern int try_chown(connection_struct *conn, const char *fname, uid_t uid, gid_t gid);
-extern NTSTATUS unpack_nt_owners(int snum, uid_t *puser, gid_t *pgrp,
- uint32 security_info_sent, SEC_DESC *psd);
-
static SMB_ACL4_INT_T *get_validated_aclint(SMB4ACL_T *acl)
{
SMB_ACL4_INT_T *aclint = (SMB_ACL4_INT_T *)acl;
smbacl4_vfs_params *params,
uid_t ownerUID,
gid_t ownerGID,
- SEC_ACE *ace_nt, /* input */
+ const SEC_ACE *ace_nt, /* input */
SMB_ACE4PROP_T *ace_v4 /* output */
)
{
ace_v4->aceMask = ace_nt->access_mask &
(STD_RIGHT_ALL_ACCESS | SA_RIGHT_FILE_ALL_ACCESS);
+ se_map_generic(&ace_v4->aceMask, &file_generic_mapping);
+
if (ace_v4->aceFlags!=ace_nt->flags)
DEBUG(9, ("ace_v4->aceFlags(0x%x)!=ace_nt->flags(0x%x)\n",
ace_v4->aceFlags, ace_nt->flags));
static SMB4ACL_T *smbacl4_win2nfs4(
const char *filename,
- SEC_ACL *dacl,
+ const SEC_ACL *dacl,
smbacl4_vfs_params *pparams,
uid_t ownerUID,
gid_t ownerGID
NTSTATUS smb_set_nt_acl_nfs4(files_struct *fsp,
uint32 security_info_sent,
- SEC_DESC *psd,
+ const SEC_DESC *psd,
set_nfs4acl_native_fn_t set_nfs4_native)
{
smbacl4_vfs_params params;
need_chown = True;
}
if (need_chown) {
- if ((newUID == (uid_t)-1 || newUID == current_user.ut.uid)) {
+ if ((newUID == (uid_t)-1
+ || newUID == fsp->conn->server_info->utok.uid)) {
if(try_chown(fsp->conn, fsp->fsp_name, newUID, newGID)) {
DEBUG(3,("chown %s, %u, %u failed. Error = %s.\n",
fsp->fsp_name, (unsigned int)newUID, (unsigned int)newGID,