diff options
author | Remi Collet <remi@remirepo.net> | 2023-09-04 13:52:08 +0200 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2023-09-04 13:52:08 +0200 |
commit | 977c79aa11f258bbac9e90e563daca35aa630402 (patch) | |
tree | 055ff59dc335f88e95ad444353ff5b8f59f9bdae | |
parent | f248ae8e4297fa01e13b12289d3d280f9a8e45c5 (diff) |
simplified patchv2.0.21
-rw-r--r-- | uwsgi-plugin-php.spec | 2 | ||||
-rw-r--r-- | uwsgi_fix_php83.patch | 24 |
2 files changed, 9 insertions, 17 deletions
diff --git a/uwsgi-plugin-php.spec b/uwsgi-plugin-php.spec index dce61f2..7d4ebad 100644 --- a/uwsgi-plugin-php.spec +++ b/uwsgi-plugin-php.spec @@ -45,7 +45,7 @@ Patch3: uwsgi_fix_php83.patch BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel >= 7.0 BuildRequires: %{?scl_prefix}php-embedded -BuildRequires: %{project}-devel = %{version} +BuildRequires: %{project}-devel BuildRequires: bzip2-devel BuildRequires: libxml2-devel BuildRequires: libedit-devel diff --git a/uwsgi_fix_php83.patch b/uwsgi_fix_php83.patch index 156921b..ed343a9 100644 --- a/uwsgi_fix_php83.patch +++ b/uwsgi_fix_php83.patch @@ -1,14 +1,14 @@ -From 15df465bcb3a2725209f7ac261c5eeacd90ad672 Mon Sep 17 00:00:00 2001 +From 064984116e86ac0a5d5d3805765395b661fc4455 Mon Sep 17 00:00:00 2001 From: Remi Collet <remi@remirepo.net> Date: Mon, 4 Sep 2023 13:10:52 +0200 Subject: [PATCH] ini_entries is read-only PHP 8.3 --- - plugins/php/php_plugin.c | 25 ++++++++++++++++++------- - 1 file changed, 18 insertions(+), 7 deletions(-) + plugins/php/php_plugin.c | 18 ++++++++++-------- + 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/plugins/php/php_plugin.c b/plugins/php/php_plugin.c -index b3efa006a..e0ead46ab 100644 +index b3efa006a..d9b615bac 100644 --- a/plugins/php/php_plugin.c +++ b/plugins/php/php_plugin.c @@ -27,6 +27,7 @@ struct uwsgi_php { @@ -19,7 +19,7 @@ index b3efa006a..e0ead46ab 100644 size_t ini_size; int dump_config; char *server_software; -@@ -232,21 +233,31 @@ static sapi_module_struct uwsgi_sapi_module; +@@ -232,21 +233,22 @@ static sapi_module_struct uwsgi_sapi_module; void uwsgi_php_append_config(char *filename) { size_t file_size = 0; @@ -27,11 +27,7 @@ index b3efa006a..e0ead46ab 100644 - uwsgi_sapi_module.ini_entries = realloc(uwsgi_sapi_module.ini_entries, uphp.ini_size + file_size); - memcpy(uwsgi_sapi_module.ini_entries + uphp.ini_size, file_content, file_size); + char *file_content = uwsgi_open_and_read(filename, &file_size, 1, NULL); -+ if (uphp.ini_size) { -+ uphp.ini_entries = realloc(uphp.ini_entries, uphp.ini_size + file_size); -+ } else { -+ uphp.ini_entries = malloc(file_size); -+ } ++ uphp.ini_entries = realloc(uphp.ini_entries, uphp.ini_size + file_size); + memcpy(uphp.ini_entries + uphp.ini_size, file_content, file_size); uphp.ini_size += file_size-1; free(file_content); @@ -42,13 +38,9 @@ index b3efa006a..e0ead46ab 100644 - uwsgi_sapi_module.ini_entries = realloc(uwsgi_sapi_module.ini_entries, uphp.ini_size + strlen(opt)+2); - memcpy(uwsgi_sapi_module.ini_entries + uphp.ini_size, opt, strlen(opt)); -+ if (uphp.ini_size) { -+ uphp.ini_entries = realloc(uphp.ini_entries, uphp.ini_size + strlen(opt)+2); -+ } else { -+ uphp.ini_entries = malloc(strlen(opt)+2); -+ } +- ++ uphp.ini_entries = realloc(uphp.ini_entries, uphp.ini_size + strlen(opt)+2); + memcpy(uphp.ini_entries + uphp.ini_size, opt, strlen(opt)); - uphp.ini_size += strlen(opt)+1; - uwsgi_sapi_module.ini_entries[uphp.ini_size-1] = '\n'; - uwsgi_sapi_module.ini_entries[uphp.ini_size] = 0; |