From d1dcf384bc309b97bd3d12110c32449f8f65b8bf Mon Sep 17 00:00:00 2001 From: Germano Massullo Date: Jun 10 2022 00:01:37 +0000 Subject: re-enable patches --- diff --git a/4071.patch b/4071.patch deleted file mode 100644 index 73e0bf6..0000000 --- a/4071.patch +++ /dev/null @@ -1,283 +0,0 @@ -From 86d0e9fbd1589dc1849829b3fac1cd6cc45abfa8 Mon Sep 17 00:00:00 2001 -From: David Anderson -Date: Tue, 27 Oct 2020 19:21:49 -0700 -Subject: [PATCH 1/4] client: allow an empty GUI RPC password, but generate - alert message - -boinccmd: show alert messages after attach RPCs - -PR #3709 disallowed empty GUI RPC password files. -This increased security on shared machines. -But it meant that on Linux, after installing BOINC as a package, -the user had to locate and change the protection -and/or the ownership of the password file, which is undesirable. - -This change allows empty password files but tells the user -that they should think about the security implications. -With the Manager this is delivered as a notice. -With boinccmd the message is written to stderr after an attach operation. ---- - client/boinc_cmd.cpp | 26 ++++++++++++++++++++++++++ - client/gui_rpc_server.cpp | 17 ++++++++--------- - 2 files changed, 34 insertions(+), 9 deletions(-) - -diff --git a/client/boinc_cmd.cpp b/client/boinc_cmd.cpp -index 38b8170a4c..fd05474f76 100644 ---- a/client/boinc_cmd.cpp -+++ b/client/boinc_cmd.cpp -@@ -163,6 +163,30 @@ void acct_mgr_do_rpc( - } - } - -+// Get messages from client, and show any that are USER_ALERT priority. -+// Intended use: show user that GUI RPCs are not password-protected. -+// For now, do this after attach to project or AM -+// -+void show_alerts(RPC_CLIENT &rpc) { -+ MESSAGES messages; -+ int retval = rpc.get_messages(0, messages); -+ if (retval) { -+ fprintf(stderr, "Can't get alerts from client: %s\n", -+ boincerror(retval) -+ ); -+ return; -+ } -+ for (unsigned int j=0; j -Date: Fri, 30 Oct 2020 19:16:33 -0700 -Subject: [PATCH 2/4] client: strip whitespace when read GUI RPC passwd file - ---- - lib/gui_rpc_client.cpp | 12 +++--------- - 1 file changed, 3 insertions(+), 9 deletions(-) - -diff --git a/lib/gui_rpc_client.cpp b/lib/gui_rpc_client.cpp -index 1980d6760d..61d1be67e4 100644 ---- a/lib/gui_rpc_client.cpp -+++ b/lib/gui_rpc_client.cpp -@@ -478,16 +478,10 @@ int read_gui_rpc_password(char* buf, string& msg) { - return ERR_FOPEN; - #endif - } -- char* p = fgets(buf, 256, f); -- if (p) { -- // trim CR -- // -- int n = (int)strlen(buf); -- if (n && buf[n-1]=='\n') { -- buf[n-1] = 0; -- } -+ buf[0] = 0; -+ if (fgets(buf, 256, f)) { -+ strip_whitespace(buf); - } - fclose(f); - return 0; - } -- - -From 2c7c925101ec623e88672ab59ed54298e7bbb444 Mon Sep 17 00:00:00 2001 -From: David Anderson -Date: Sat, 7 Nov 2020 12:40:41 -0800 -Subject: [PATCH 3/4] client, linux: improve error msg if can't find GUI RPC - auth file - ---- - lib/gui_rpc_client.cpp | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) - -diff --git a/lib/gui_rpc_client.cpp b/lib/gui_rpc_client.cpp -index 61d1be67e4..0df494aa5b 100644 ---- a/lib/gui_rpc_client.cpp -+++ b/lib/gui_rpc_client.cpp -@@ -455,8 +455,13 @@ int read_gui_rpc_password(char* buf, string& msg) { - return ERR_FOPEN; - } - } else { -- sprintf(msg_buf, "%s not found. Try reinstalling BOINC.", -- GUI_RPC_PASSWD_FILE -+ char buf2[MAXPATHLEN]; -+ if (!getcwd(buf2, MAXPATHLEN)) { -+ strcpy(buf2, ""); -+ } -+ sprintf(msg_buf, "No BOINC data directory was specified, and %s was not found in the current directory (%s). See https://boinc.berkeley.edu/gui_rpc.php for more information.", -+ GUI_RPC_PASSWD_FILE, -+ buf2 - ); - msg = msg_buf; - return ERR_FOPEN; - -From a11bb44f131be94c55f78f6b71513722ed2d88ed Mon Sep 17 00:00:00 2001 -From: David Anderson -Date: Tue, 10 Nov 2020 15:19:23 -0800 -Subject: [PATCH 4/4] client, Linux: look for GUI RPC pwd in - /var/lib/boinc-client after exhausting other options - ---- - lib/common_defs.h | 1 + - lib/gui_rpc_client.cpp | 50 +++++++++++++++++++++++++++++++----------- - 2 files changed, 38 insertions(+), 13 deletions(-) - -diff --git a/lib/common_defs.h b/lib/common_defs.h -index e8082d1346..060ed2a8eb 100644 ---- a/lib/common_defs.h -+++ b/lib/common_defs.h -@@ -377,5 +377,6 @@ struct DEVICE_STATUS { - #define DEFAULT_SS_EXECUTABLE "boincscr" - #endif - #define LINUX_CONFIG_FILE "/etc/boinc-client/config.properties" -+#define LINUX_DEFAULT_DATA_DIR "/var/lib/boinc-client" - - #endif -diff --git a/lib/gui_rpc_client.cpp b/lib/gui_rpc_client.cpp -index 0df494aa5b..22e9b0997c 100644 ---- a/lib/gui_rpc_client.cpp -+++ b/lib/gui_rpc_client.cpp -@@ -401,15 +401,22 @@ int RPC::parse_reply() { - - // Look for a GUI RPC password file and read it. - // If fail, return a prescriptive message. --// Win/Mac: look in current dir. --// Linux: also look in a directory specified in --// /etc/boinc-client/config.properties -+// Win/Mac: look in -+// - current dir -+// Linux: look in: -+// - current dir -+// - a directory specified in /etc/boinc-client/config.properties -+// - /var/lib/boinc-client - // -+// Note: the Manager (on all platforms) has a -datadir cmdline option. -+// If present, it chdirs to that directory. -+ - int read_gui_rpc_password(char* buf, string& msg) { - char msg_buf[1024]; - FILE* f = fopen(GUI_RPC_PASSWD_FILE, "r"); - if (!f) { - #if defined(__linux__) -+ char path[MAXPATHLEN]; - if (errno == EACCES) { - sprintf(msg_buf, - "%s exists but can't be read. Check the file permissions.", -@@ -418,9 +425,12 @@ int read_gui_rpc_password(char* buf, string& msg) { - msg = msg_buf; - return ERR_FOPEN; - } -+ -+ // look for config file -+ // - FILE* g = fopen(LINUX_CONFIG_FILE, "r"); - if (g) { -- char buf2[MAXPATHLEN], path[MAXPATHLEN]; -+ char buf2[MAXPATHLEN]; - char *p = 0; - while (fgets(buf2, MAXPATHLEN, g)) { - strip_whitespace(buf2); -@@ -455,16 +465,30 @@ int read_gui_rpc_password(char* buf, string& msg) { - return ERR_FOPEN; - } - } else { -- char buf2[MAXPATHLEN]; -- if (!getcwd(buf2, MAXPATHLEN)) { -- strcpy(buf2, ""); -+ // no config file; look in default data dir -+ // -+ sprintf(path, "%s/%s", LINUX_DEFAULT_DATA_DIR, GUI_RPC_PASSWD_FILE); -+ f = fopen(path, "r"); -+ if (!f) { -+ if (errno == EACCES) { -+ sprintf(msg_buf, -+ "%s exists but can't be read. Check the file permissions.", -+ path -+ ); -+ msg = msg_buf; -+ return ERR_FOPEN; -+ } -+ char buf2[MAXPATHLEN]; -+ if (!getcwd(buf2, MAXPATHLEN)) { -+ strcpy(buf2, ""); -+ } -+ sprintf(msg_buf, "No BOINC data directory was specified, and %s was not found in the current directory (%s). See https://boinc.berkeley.edu/gui_rpc.php for more information.", -+ GUI_RPC_PASSWD_FILE, -+ buf2 -+ ); -+ msg = msg_buf; -+ return ERR_FOPEN; - } -- sprintf(msg_buf, "No BOINC data directory was specified, and %s was not found in the current directory (%s). See https://boinc.berkeley.edu/gui_rpc.php for more information.", -- GUI_RPC_PASSWD_FILE, -- buf2 -- ); -- msg = msg_buf; -- return ERR_FOPEN; - } - #else - // non-Linux diff --git a/boinc-client.spec b/boinc-client.spec index f33c246..56e178b 100644 --- a/boinc-client.spec +++ b/boinc-client.spec @@ -18,7 +18,7 @@ Summary: The BOINC client Name: boinc-client Version: 7.18.1 -Release: 2%{?dist} +Release: 3%{?dist} License: LGPLv2+ URL: http://boinc.berkeley.edu/ @@ -42,12 +42,12 @@ Patch0: openssl3.patch # Concerning this patch, read devel mailing list thread "boinc-client build failure on non x86 architectures F>35" Patch1: boinc-client-7.18-AC_CHECK_DECLS-change.patch %endif -#Patch2: disable_idle_time_detection.patch +Patch2: disable_idle_time_detection.patch # disabled systemd_hardening.patch because its tests are still in early stage # on upstream development process #Patch2: systemd_hardening.patch # prevents manager close action from stopping client service -Patch2: manager_close_no_service_stop.patch +Patch3: manager_close_no_service_stop.patch # On Linux distributions, BOINC runs as a service. Users must not be able to # try stopping the service from exit menu entry. # This leads to unexpected behaviour, like: @@ -59,20 +59,19 @@ Patch2: manager_close_no_service_stop.patch # show any frame asking the user if he wants to stop the service. # upstream pull request https://github.com/BOINC/boinc/pull/3094 has ben merged # and unmerged later -Patch3: manager_exit_menu_entry_removal.patch +Patch4: manager_exit_menu_entry_removal.patch # removes menu entry "Shut down the currently connected BOINC client" # upstream pull request https://github.com/BOINC/boinc/pull/3094 has ben merged # and unmerged later -#Patch3: manager_shut_down_connected_client.patch +Patch5: manager_shut_down_connected_client.patch # if user starts manager while client service is not running, manager will # start a client process running it in user session. This patch prevents # the manager from starting the client because on Linux the client should # run as a service only -#Patch4: prevent_manager_from_starting_client.patch +Patch6: prevent_manager_from_starting_client.patch # Fedora / EPEL, the folder /etc/boinc-client does not exist, so it should be removed -#Patch5: remove_etc_boinc-client_from_systemd_unit_file.patch -# Concerning 4071.patch read https://github.com/BOINC/boinc/pull/4071 -#Patch6: 4071.patch +#Patch7: remove_etc_boinc-client_from_systemd_unit_file.patch + Requires: logrotate Requires(post): systemd @@ -335,6 +334,10 @@ fi %{_includedir}/boinc %changelog +* Thu Jun 09 2022 Germano Massullo - 7.18.1-3 +- re-enabled patches disabled in 7.18.1-1 +- removed 4071.patch + * Sun Apr 10 2022 Germano Massullo - 7.18.1-2 - added boinc-client-7.18-AC_CHECK_DECLS-change.patch diff --git a/manager_shut_down_connected_client.patch b/manager_shut_down_connected_client.patch index 788fdb2..ee3c5ea 100644 --- a/manager_shut_down_connected_client.patch +++ b/manager_shut_down_connected_client.patch @@ -1,13 +1,13 @@ -diff -urNr boinc-client_release-7.14-7.14.2-orig/clientgui/AdvancedFrame.cpp boinc-client_release-7.14-7.14.2/clientgui/AdvancedFrame.cpp ---- boinc-client_release-7.14-7.14.2-orig/clientgui/AdvancedFrame.cpp 2018-10-11 02:43:27.000000000 +0200 -+++ boinc-client_release-7.14-7.14.2/clientgui/AdvancedFrame.cpp 2019-03-06 17:10:57.196882227 +0100 -@@ -347,11 +347,13 @@ +diff -urNr boinc-client_release-7.18-7.18.1-orig/clientgui/AdvancedFrame.cpp boinc-client_release-7.18-7.18.1/clientgui/AdvancedFrame.cpp +--- boinc-client_release-7.18-7.18.1-orig/clientgui/AdvancedFrame.cpp 2021-08-03 17:52:19.000000000 +0200 ++++ boinc-client_release-7.18-7.18.1/clientgui/AdvancedFrame.cpp 2022-06-10 01:41:00.031288249 +0200 +@@ -342,11 +342,13 @@ _("Select computer...\tCtrl+Shift+I"), _("Connect to a BOINC client on another computer") ); +#ifndef __WXGTK__ menuFile->Append( - ID_SHUTDOWNCORECLIENT, + ID_SHUTDOWNCORECLIENT, _("Shut down connected client..."), _("Shut down the currently connected BOINC client") ); diff --git a/prevent_manager_from_starting_client.patch b/prevent_manager_from_starting_client.patch index 8427d1b..f8892fb 100644 --- a/prevent_manager_from_starting_client.patch +++ b/prevent_manager_from_starting_client.patch @@ -1,6 +1,6 @@ -diff -urNr boinc-client_release-7.14-7.14.2-orig/clientgui/BOINCClientManager.cpp boinc-client_release-7.14-7.14.2/clientgui/BOINCClientManager.cpp ---- boinc-client_release-7.14-7.14.2-orig/clientgui/BOINCClientManager.cpp 2018-10-11 02:43:27.000000000 +0200 -+++ boinc-client_release-7.14-7.14.2/clientgui/BOINCClientManager.cpp 2019-03-18 16:36:39.032554578 +0100 +diff -urNr boinc-client_release-7.18-7.18.1-orig/clientgui/BOINCClientManager.cpp boinc-client_release-7.18-7.18.1/clientgui/BOINCClientManager.cpp +--- boinc-client_release-7.18-7.18.1-orig/clientgui/BOINCClientManager.cpp 2021-08-03 17:52:19.000000000 +0200 ++++ boinc-client_release-7.18-7.18.1/clientgui/BOINCClientManager.cpp 2022-06-10 01:57:04.426621677 +0200 @@ -199,6 +199,11 @@ if (IsBOINCCoreRunning()) return true; diff --git a/remove_etc_boinc-client_from_systemd_unit_file.patch b/remove_etc_boinc-client_from_systemd_unit_file.patch index 03c8c91..c79386d 100644 --- a/remove_etc_boinc-client_from_systemd_unit_file.patch +++ b/remove_etc_boinc-client_from_systemd_unit_file.patch @@ -1,8 +1,8 @@ -diff -urNr boinc-client_release-7.16-7.16.1-orig/client/scripts/boinc-client.service.in boinc-client_release-7.16-7.16.1/client/scripts/boinc-client.service.in ---- boinc-client_release-7.16-7.16.1-orig/client/scripts/boinc-client.service.in 2019-07-31 00:46:06.000000000 +0200 -+++ boinc-client_release-7.16-7.16.1/client/scripts/boinc-client.service.in 2019-08-12 12:13:34.349621020 +0200 -@@ -9,7 +9,7 @@ - PrivateTmp=true +diff -urNr boinc-client_release-7.18-7.18.1-orig/client/scripts/boinc-client.service.in boinc-client_release-7.18-7.18.1/client/scripts/boinc-client.service.in +--- boinc-client_release-7.18-7.18.1-orig/client/scripts/boinc-client.service.in 2021-08-03 17:52:19.000000000 +0200 ++++ boinc-client_release-7.18-7.18.1/client/scripts/boinc-client.service.in 2022-06-10 02:00:28.630386222 +0200 +@@ -8,7 +8,7 @@ + ProtectHome=true ProtectSystem=strict ProtectControlGroups=true -ReadWritePaths=-/var/lib/boinc -/etc/boinc-client