/*
* HPUX doesn't have the facl call. Fake it using the path.... JRA.
*/
- /* For all I see, the info should already be in the fsp
- * parameter, but get it again to be safe --- necessary? */
- files_struct *file_struct_p = file_find_fd(fsp->conn->sconn,
- fsp->fh->fd);
- if (file_struct_p == NULL) {
- errno = EBADF;
- return NULL;
- }
/*
* We know we're in the same conn context. So we
* can use the relative path.
"hpuxacl_sys_acl_get_file (no facl syscall on HPUX).\n"));
return hpuxacl_sys_acl_get_file(handle,
- file_struct_p->fsp_name->base_name,
+ fsp->fsp_name->base_name,
SMB_ACL_TYPE_ACCESS);
}
/*
* HPUX doesn't have the facl call. Fake it using the path.... JRA.
*/
- /* For all I see, the info should already be in the fsp
- * parameter, but get it again to be safe --- necessary? */
- files_struct *file_struct_p = file_find_fd(fsp->conn->sconn,
- fsp->fh->fd);
- if (file_struct_p == NULL) {
- errno = EBADF;
- return -1;
- }
/*
* We know we're in the same conn context. So we
* can use the relative path.
"hpuxacl_sys_acl_set_file (no facl syscall on HPUX)\n"));
return hpuxacl_sys_acl_set_file(handle,
- file_struct_p->fsp_name->base_name,
+ fsp->fsp_name->base_name,
SMB_ACL_TYPE_ACCESS, theacl);
}
done:
DEBUG(10, ("hpuxacl_sys_acl_delete_def_file %s.\n",
((ret != 0) ? "failed" : "succeeded" )));
- SAFE_FREE(smb_acl);
+ TALLOC_FREE(smb_acl);
return ret;
}
if (!_IS_OF_TYPE(hpux_acl[i], type)) {
continue;
}
- result = SMB_REALLOC(result,
- sizeof(struct smb_acl_t) +
- (sizeof(struct smb_acl_entry) *
- (result->count + 1)));
- if (result == NULL) {
+ result->acl = talloc_realloc(result, result->acl, struct smb_acl_entry, result->count + 1);
+ if (result->acl == NULL) {
DEBUG(10, ("error reallocating memory for SMB_ACL\n"));
goto fail;
}
}
goto done;
fail:
- SAFE_FREE(result);
+ TALLOC_FREE(result);
done:
DEBUG(10, ("hpux_acl_to_smb_acl %s\n",
((result == NULL) ? "failed" : "succeeded")));
/* VFS operations structure */
static struct vfs_fn_pointers hpuxacl_fns = {
- .sys_acl_get_file = hpuxacl_sys_acl_get_file,
- .sys_acl_get_fd = hpuxacl_sys_acl_get_fd,
- .sys_acl_set_file = hpuxacl_sys_acl_set_file,
- .sys_acl_set_fd = hpuxacl_sys_acl_set_fd,
- .sys_acl_delete_def_file = hpuxacl_sys_acl_delete_def_file,
+ .sys_acl_get_file_fn = hpuxacl_sys_acl_get_file,
+ .sys_acl_get_fd_fn = hpuxacl_sys_acl_get_fd,
+ .sys_acl_set_file_fn = hpuxacl_sys_acl_set_file,
+ .sys_acl_set_fd_fn = hpuxacl_sys_acl_set_fd,
+ .sys_acl_delete_def_file_fn = hpuxacl_sys_acl_delete_def_file,
};
NTSTATUS vfs_hpuxacl_init(void)