示例#1
0
static int unlink_acl_tdb(vfs_handle_struct *handle,
			  const struct smb_filename *smb_fname)
{
	struct smb_filename *smb_fname_tmp = NULL;
	struct db_context *db = acl_db;
	int ret = -1;

	smb_fname_tmp = cp_smb_filename(talloc_tos(), smb_fname);
	if (smb_fname_tmp == NULL) {
		errno = ENOMEM;
		goto out;
	}

	if (smb_fname_tmp->flags & SMB_FILENAME_POSIX_PATH) {
		ret = SMB_VFS_LSTAT(handle->conn, smb_fname_tmp);
	} else {
		ret = SMB_VFS_STAT(handle->conn, smb_fname_tmp);
	}

	if (ret == -1) {
		goto out;
	}

	ret = unlink_acl_common(handle, smb_fname_tmp);

	if (ret == -1) {
		goto out;
	}

	acl_tdb_delete(handle, db, &smb_fname_tmp->st);
 out:
	return ret;
}
示例#2
0
static int unlink_acl_tdb(vfs_handle_struct *handle,
                          const struct smb_filename *smb_fname)
{
    struct smb_filename *smb_fname_tmp = NULL;
    struct db_context *db = acl_db;
    NTSTATUS status;
    int ret = -1;

    status = copy_smb_filename(talloc_tos(), smb_fname, &smb_fname_tmp);
    if (!NT_STATUS_IS_OK(status)) {
        errno = map_errno_from_nt_status(status);
        goto out;
    }

    if (lp_posix_pathnames()) {
        ret = SMB_VFS_LSTAT(handle->conn, smb_fname_tmp);
    } else {
        ret = SMB_VFS_STAT(handle->conn, smb_fname_tmp);
    }

    if (ret == -1) {
        goto out;
    }

    ret = unlink_acl_common(handle, smb_fname_tmp);

    if (ret == -1) {
        goto out;
    }

    acl_tdb_delete(handle, db, &smb_fname_tmp->st);
out:
    return ret;
}