Compare commits

...
Sign in to create a new pull request.

3 commits

Author SHA1 Message Date
Miroslav Lisik
0d1e3b09c6 Fixed ruby socket permissions 2022-09-08 11:39:42 +02:00
Miroslav Lisik
2ed9e0e643 Rebased to latest upstream sources (see CHANGELOG.md)
- Updated pcs-web-ui
- Resolves: rhbz#2068452
2022-06-28 16:33:11 +02:00
Miroslav Lisik
72f74d535a Rebased to latest upstream sources (see CHANGELOG.md)
- Updated pcs-web-ui
2022-02-01 15:06:31 +01:00
5 changed files with 97 additions and 25 deletions

6
.gitignore vendored
View file

@ -94,3 +94,9 @@
/pcs-0.10.11.tar.gz
/pcs-web-ui-0.1.9.tar.gz
/pcs-web-ui-node-modules-0.1.9.tar.xz
/pcs-web-ui-0.1.12.tar.gz
/pcs-web-ui-node-modules-0.1.12.tar.xz
/pcs-0.10.13.tar.gz
/pcs-0.10.14.tar.gz
/pcs-web-ui-0.1.14.tar.gz
/pcs-web-ui-node-modules-0.1.14.tar.xz

View file

@ -0,0 +1,46 @@
From 70b2d3840336db9df0577b85c0a551b8867526d1 Mon Sep 17 00:00:00 2001
From: Tomas Jelinek <tojeline@redhat.com>
Date: Wed, 10 Aug 2022 14:47:53 +0200
Subject: [PATCH] fix ruby socket permissions
---
pcsd/rserver.rb | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/pcsd/rserver.rb b/pcsd/rserver.rb
index c37f9df4..a54509fe 100644
--- a/pcsd/rserver.rb
+++ b/pcsd/rserver.rb
@@ -7,6 +7,29 @@ require 'thin'
require 'settings.rb'
+# Replace Thin::Backends::UnixServer:connect
+# The only change is 'File.umask(0o777)' instead of 'File.umask(0)' to properly
+# set python-ruby socket permissions
+module Thin
+ module Backends
+ class UnixServer < Base
+ def connect
+ at_exit { remove_socket_file } # In case it crashes
+ old_umask = File.umask(0o077)
+ begin
+ EventMachine.start_unix_domain_server(@socket, UnixConnection, &method(:initialize_connection))
+ # HACK EventMachine.start_unix_domain_server doesn't return the connection signature
+ # so we have to go in the internal stuff to find it.
+ @signature = EventMachine.instance_eval{@acceptors.keys.first}
+ ensure
+ File.umask(old_umask)
+ end
+ end
+ end
+ end
+end
+
+
def pack_response(response)
return [200, {}, [response.to_json.to_str]]
end
--
2.37.3

View file

@ -1,6 +1,6 @@
Name: pcs
Version: 0.10.11
Release: 1%{?dist}
Version: 0.10.14
Release: 2%{?dist}
# https://docs.fedoraproject.org/en-US/packaging-guidelines/LicensingGuidelines/
# https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing#Good_Licenses
# GPLv2: pcs
@ -17,8 +17,8 @@ Summary: Pacemaker Configuration System
%global pcs_source_name %{name}-%{version_or_commit}
# ui_commit can be determined by hash, tag or branch
%global ui_commit 0.1.9
%global ui_modules_version 0.1.9
%global ui_commit 0.1.14
%global ui_modules_version 0.1.14
%global ui_src_name pcs-web-ui-%{ui_commit}
%global pcs_snmp_pkg_name pcs-snmp
@ -51,7 +51,12 @@ Source88: https://rubygems.org/downloads/thin-%{version_rubygem_thin}.gem
Source100: https://github.com/ClusterLabs/pcs-web-ui/archive/%{ui_commit}/%{ui_src_name}.tar.gz
Source101: https://github.com/ClusterLabs/pcs-web-ui/releases/download/%{ui_commit}/pcs-web-ui-node-modules-%{ui_modules_version}.tar.xz
# pcs patches: <= 200
# Patch0: name.patch
Patch0: fix-ruby-socket-permissions.patch
# ui patches: >200
# Patch201: name.patch
# git for patches
BuildRequires: git-core
@ -211,8 +216,6 @@ Provides: bundled(pyagentx) = %{pyagentx_version}
SNMP agent that provides information about pacemaker cluster to the master agent (snmpd)
%prep
%autosetup -p1 -S git -n %{pcs_source_name}
# -- following is inspired by python-simplejon.el5 --
# Update timestamps on the files touched by a patch, to avoid non-equal
# .pyc/.pyo files across the multilib peers within a build
@ -252,12 +255,18 @@ update_times_patch(){
update_times ${patch_file_name} `diffstat -p1 -l ${patch_file_name}`
}
# update_times_patch %{PATCH0}
# documentation for setup/autosetup/autopatch:
# * http://ftp.rpm.org/max-rpm/s1-rpm-inside-macros.html
# * https://rpm-software-management.github.io/rpm/manual/autosetup.html
# patch web-ui sources
%autosetup -D -T -b 100 -a 101 -S git -n %{ui_src_name} -N
%autopatch -p1 -m 201
# update_times_patch %%{PATCH201}
# prepare dirs/files necessary for building web ui
# inside SOURCE100 is only directory %%{ui_src_name}
tar -xzf %SOURCE100 -C %{pcsd_public_dir}
tar -xf %SOURCE101 -C %{pcsd_public_dir}/%{ui_src_name}
# patch pcs sources
%autosetup -S git -n %{pcs_source_name} -N
%autopatch -p1 -M 200
update_times_patch %{PATCH0}
# prepare dirs/files necessary for building all bundles
# -----------------------------------------------------
@ -275,19 +284,20 @@ cp -f %SOURCE42 rpm/
%define debug_package %{nil}
./autogen.sh
%{configure} --enable-local-build --enable-use-local-cache-only --enable-individual-bundling PYTHON=%{__python3}
%{configure} --enable-local-build --enable-use-local-cache-only --enable-individual-bundling PYTHON=%{__python3} ruby_CFLAGS="%{optflags}" ruby_LIBS="%{build_ldflags}"
make all
# build pcs-web-ui
make -C %{_builddir}/%{ui_src_name} build BUILD_USE_EXISTING_NODE_MODULES=true
%install
rm -rf $RPM_BUILD_ROOT
pwd
%make_install
# build web ui and put it to pcsd
make -C %{pcsd_public_dir}/%{ui_src_name} build BUILD_USE_EXISTING_NODE_MODULES=true
mv %{pcsd_public_dir}/%{ui_src_name}/build ${RPM_BUILD_ROOT}%{_libdir}/%{pcsd_public_dir}/ui
rm -r %{pcsd_public_dir}/%{ui_src_name}
# install pcs-web-ui
cp -r %{_builddir}/%{ui_src_name}/build ${RPM_BUILD_ROOT}%{_libdir}/%{pcsd_public_dir}/ui
# symlink favicon into pcsd directories
ln -fs /etc/favicon.png ${RPM_BUILD_ROOT}%{_libdir}/%{pcsd_public_dir}/images/favicon.png
@ -434,6 +444,18 @@ remove_all_tests
%license pyagentx_LICENSE.txt
%changelog
* Thu Sep 08 2022 Miroslav Lisik <mlisik@redhat.com> - 0.10.14-2
- Fixed ruby socket permissions
* Tue Jun 28 2022 Miroslav Lisik <mlisik@redhat.com> - 0.10.14-1
- Rebased to latest upstream sources (see CHANGELOG.md)
- Updated pcs-web-ui
- Resolves: rhbz#2068452
* Tue Feb 01 2022 Miroslav Lisik <mlisik@redhat.com> - 0.10.13-1
- Rebased to latest upstream sources (see CHANGELOG.md)
- Updated pcs-web-ui
* Tue Oct 05 2021 Miroslav Lisik <mlisik@redhat.com> - 0.10.11-1
- Rebased to latest upstream sources (see CHANGELOG.md)
- Updated pcs-web-ui

View file

@ -1,6 +1,6 @@
SHA512 (pyagentx-0.4.pcs.2.tar.gz) = d4194fec9a3e5fefe3793d49b7fec1feafef294c7e613a06046c2993daeefc5cb39d7c5b2b402ff83e49b2d976953f862264288c758c0be09d997b5323cc558a
SHA512 (dacite-1.6.0.tar.gz) = 034255f095589d309fe5805413d8b148f430cd20a0de305b7954083b530d516da1d8f3f00ebb5264a8cfb77f2b2a76f1e2d863e78bd191f1d85021c5553815da
SHA512 (thin-1.8.1.gem) = c200ea03b7876b2a17b5875557fa967b8d01db20cc401811f314f3285f8249b8793e4709b7bc033a9c5813b9a51e3093c55f717b4a98b8fda171aa82813b7419
SHA512 (pcs-0.10.11.tar.gz) = 220dcba99c479a6a7c6d35c7a4c04e46a336c0ff6454da997560c1e9c8fd39f41d16cbcc247502baa9508ac7e6a4cf7357f4d5bfccafc3d36164dbc7334877a4
SHA512 (pcs-web-ui-0.1.9.tar.gz) = 6572c9afcc31cac4be89e474e6abb31f0e21ebbc4ebf6cbcff4d391496003b8abbfb44e99752447741b3ca8bab551d55ddd442a7ead94fa44240f9879776fc60
SHA512 (pcs-web-ui-node-modules-0.1.9.tar.xz) = de1adaeb0c6e93f9487ccfa20f6c517d71d0a3d40ede98c09dac2fa4d7f3f1e58eb4d47b598b56e4d07ace5faf157229c53878e095eb0d11806dfa539e90261d
SHA512 (pcs-0.10.14.tar.gz) = c1760b733a4cf8fdd799adabaf857f45627bf227cf142c6deb5fffdf61368c8dde6dd28e2ca527bea54a320433f201dcaae96cb3875d1b55b0c541f188ac3d05
SHA512 (pcs-web-ui-0.1.14.tar.gz) = aaaef6dcdd2255a3d48b9b03984debb61a5f83761fa70e5e2ecaf5c99bc38328cb8fc4347f2115b155ebcc862823ac6f89ef573f011ffe1118cb389e3cbe5661
SHA512 (pcs-web-ui-node-modules-0.1.14.tar.xz) = 5042023409fb49fd0fee12d86794d410e3e28608e28e5bc419aa1cf98f17dd3668081821edbf4f6d660707d40697b3dbde697702c7039459325fb6a4171d5d93

View file

@ -37,14 +37,10 @@
- fence-agents-ipmilan
- fence-agents-scsi
- fence-virt
- fontconfig
- openssl
- pcs
- pcs-snmp
- python3-pip
- python3-setuptools_scm
- python3-wheel
- rubygem-json
- rubygem-test-unit
- wget
required_services:
@ -54,12 +50,14 @@
- prepare-source:
dir: ./
run: rpmbuild -bp {{tenv_workdir}}/*.spec --nodeps --define "_sourcedir {{tenv_workdir}}" --define "_builddir {{tenv_workdir}}/source"
# pcs-web-ui sources are deleted because there are conflicts during move of sources
# pcs-web-ui sources aren't needed during testing
- flatten-source:
dir: ./
run: shopt -s dotglob; mv {{tenv_workdir}}/source/*/* {{tenv_workdir}}/source
run: rm -rf {{tenv_workdir}}/source/pcs-web-ui-*; shopt -s dotglob; mv {{tenv_workdir}}/source/*/* {{tenv_workdir}}/source
- build_sources:
dir: ./source
run: "export PYTHONPATH=/usr/lib64/pcs/pcs_bundled/packages/; export GEM_HOME=/usr/lib64/pcsd/vendor/bundle/; ./autogen.sh && ./configure"
run: "export PYTHONPATH=/usr/lib64/pcs/pcs_bundled/packages/; export GEM_HOME=/usr/lib64/pcsd/vendor/bundle/; ./autogen.sh && ./configure --enable-tests-only"
- remove_sources:
dir: ./source
run: rm -rfv pcs