Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package php8 for openSUSE:Factory checked in at 2023-03-15 18:53:25 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/php8 (Old) and /work/SRC/openSUSE:Factory/.php8.new.31432 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "php8" Wed Mar 15 18:53:25 2023 rev:42 rq:1071456 version:8.1.16 Changes: -------- --- /work/SRC/openSUSE:Factory/php8/php8.changes 2023-03-07 16:48:46.897094283 +0100 +++ /work/SRC/openSUSE:Factory/.php8.new.31432/php8.changes 2023-03-15 18:53:31.428069383 +0100 @@ -1,0 +2,10 @@ +Tue Mar 14 09:50:55 UTC 2023 - pgaj...@suse.com + +- update to newest systzdata patch [bsc#1208199] +- deleted patches + - php-systzdata-v21.patch (upstreamed) +- added patches + fix use of the system timezone database + + php-systzdata-v23.patch + +------------------------------------------------------------------- Old: ---- php-systzdata-v21.patch New: ---- php-systzdata-v23.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ php8.spec ++++++ --- /var/tmp/diff_new_pack.t1K9Wl/_old 2023-03-15 18:53:32.284073936 +0100 +++ /var/tmp/diff_new_pack.t1K9Wl/_new 2023-03-15 18:53:32.304074042 +0100 @@ -84,7 +84,7 @@ # SUSE specific ini defaults Patch3: php-ini.patch # use of the system timezone database -Patch4: php-systzdata-v21.patch +Patch4: php-systzdata-v23.patch # adjust upstream systemd unit to SUSE needs Patch5: php-systemd-unit.patch # PATCH-FEATURE-OPENSUSE use ordered input files for reproducible /usr/bin/phar.phar ++++++ php-build-reproducible-phar.patch ++++++ --- /var/tmp/diff_new_pack.t1K9Wl/_old 2023-03-15 18:53:32.476074957 +0100 +++ /var/tmp/diff_new_pack.t1K9Wl/_new 2023-03-15 18:53:32.484075000 +0100 @@ -16,11 +16,11 @@ ext/phar/zip.c | 2 +- 6 files changed, 18 insertions(+), 5 deletions(-) -Index: php-8.0.0/ext/phar/phar.c +Index: php-8.1.16/ext/phar/phar.c =================================================================== ---- php-8.0.0.orig/ext/phar/phar.c 2020-11-24 18:04:03.000000000 +0100 -+++ php-8.0.0/ext/phar/phar.c 2021-01-07 10:56:10.978719743 +0100 -@@ -2995,7 +2995,7 @@ int phar_flush(phar_archive_data *phar, +--- php-8.1.16.orig/ext/phar/phar.c ++++ php-8.1.16/ext/phar/phar.c +@@ -3004,7 +3004,7 @@ int phar_flush(phar_archive_data *phar, 4: metadata-len +: metadata */ @@ -29,10 +29,10 @@ phar_set_32(entry_buffer, entry->uncompressed_filesize); phar_set_32(entry_buffer+4, mytime); phar_set_32(entry_buffer+8, entry->compressed_filesize); -Index: php-8.0.0/ext/phar/phar_internal.h +Index: php-8.1.16/ext/phar/phar_internal.h =================================================================== ---- php-8.0.0.orig/ext/phar/phar_internal.h 2020-11-24 18:04:03.000000000 +0100 -+++ php-8.0.0/ext/phar/phar_internal.h 2021-01-07 10:56:10.978719743 +0100 +--- php-8.1.16.orig/ext/phar/phar_internal.h ++++ php-8.1.16/ext/phar/phar_internal.h @@ -427,6 +427,21 @@ static inline enum phar_fp_type phar_get return PHAR_G(cached_fp)[entry->phar->phar_pos].manifest[entry->manifest_pos].fp_type; } @@ -55,10 +55,10 @@ static inline zend_off_t phar_get_fp_offset(phar_entry_info *entry) { if (!entry->is_persistent) { -Index: php-8.0.0/ext/phar/stream.c +Index: php-8.1.16/ext/phar/stream.c =================================================================== ---- php-8.0.0.orig/ext/phar/stream.c 2020-11-24 18:04:03.000000000 +0100 -+++ php-8.0.0/ext/phar/stream.c 2021-01-07 10:56:10.978719743 +0100 +--- php-8.1.16.orig/ext/phar/stream.c ++++ php-8.1.16/ext/phar/stream.c @@ -463,7 +463,7 @@ static int phar_stream_flush(php_stream phar_entry_data *data = (phar_entry_data *) stream->abstract; @@ -68,10 +68,10 @@ ret = phar_flush(data->phar, 0, 0, 0, &error); if (error) { php_stream_wrapper_log_error(stream->wrapper, REPORT_ERRORS, "%s", error); -Index: php-8.0.0/ext/phar/tar.c +Index: php-8.1.16/ext/phar/tar.c =================================================================== ---- php-8.0.0.orig/ext/phar/tar.c 2020-11-24 18:04:03.000000000 +0100 -+++ php-8.0.0/ext/phar/tar.c 2021-01-07 10:56:10.978719743 +0100 +--- php-8.1.16.orig/ext/phar/tar.c ++++ php-8.1.16/ext/phar/tar.c @@ -971,7 +971,7 @@ int phar_tar_flush(phar_archive_data *ph char halt_stub[] = "__HALT_COMPILER();"; @@ -81,10 +81,10 @@ entry.is_modified = 1; entry.is_crc_checked = 1; entry.is_tar = 1; -Index: php-8.0.0/ext/phar/util.c +Index: php-8.1.16/ext/phar/util.c =================================================================== ---- php-8.0.0.orig/ext/phar/util.c 2020-11-24 18:04:03.000000000 +0100 -+++ php-8.0.0/ext/phar/util.c 2021-01-07 10:56:10.982719768 +0100 +--- php-8.1.16.orig/ext/phar/util.c ++++ php-8.1.16/ext/phar/util.c @@ -574,7 +574,7 @@ phar_entry_data *phar_get_or_create_entr phar_add_virtual_dirs(phar, path, path_len); @@ -94,10 +94,10 @@ etemp.is_crc_checked = 1; etemp.phar = phar; etemp.filename = estrndup(path, path_len); -Index: php-8.0.0/ext/phar/zip.c +Index: php-8.1.16/ext/phar/zip.c =================================================================== ---- php-8.0.0.orig/ext/phar/zip.c 2020-11-24 18:04:03.000000000 +0100 -+++ php-8.0.0/ext/phar/zip.c 2021-01-07 10:56:10.982719768 +0100 +--- php-8.1.16.orig/ext/phar/zip.c ++++ php-8.1.16/ext/phar/zip.c @@ -1214,7 +1214,7 @@ int phar_zip_flush(phar_archive_data *ph pass.error = &temperr; ++++++ php-systzdata-v21.patch -> php-systzdata-v23.patch ++++++ --- /work/SRC/openSUSE:Factory/php8/php-systzdata-v21.patch 2022-02-06 23:55:23.446372528 +0100 +++ /work/SRC/openSUSE:Factory/.php8.new.31432/php-systzdata-v23.patch 2023-03-15 18:53:31.412069297 +0100 @@ -5,6 +5,8 @@ than embedding a copy. Discussed upstream but was not desired. History: +r23: fix possible buffer overflow +r22: retrieve tzdata version from /usr/share/zoneinfo/tzdata.zi r21: adapt for timelib 2021.03 (in 8.1.0) r20: adapt for timelib 2020.03 (in 8.0.10RC1) r19: adapt for timelib 2020.02 (in 8.0.0beta2) @@ -32,9 +34,10 @@ r2: add filesystem trawl to set up name alias index r1: initial revision -diff -up php-8.0.0beta3/ext/date/config0.m4.systzdata php-8.0.0beta3/ext/date/config0.m4 ---- php-8.0.0beta3/ext/date/config0.m4.systzdata 2020-09-01 19:13:26.000000000 +0200 -+++ php-8.0.0beta3/ext/date/config0.m4 2020-09-02 08:07:51.039979873 +0200 +diff --git a/ext/date/config0.m4 b/ext/date/config0.m4 +index 18b8106bd2..3d1f63c758 100644 +--- a/ext/date/config0.m4 ++++ b/ext/date/config0.m4 @@ -4,6 +4,19 @@ AC_CHECK_HEADERS([io.h]) dnl Check for strtoll, atoll AC_CHECK_FUNCS(strtoll atoll) @@ -55,9 +58,10 @@ PHP_DATE_CFLAGS="-Wno-implicit-fallthrough -I@ext_builddir@/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1" timelib_sources="lib/astro.c lib/dow.c lib/parse_date.c lib/parse_tz.c lib/parse_posix.c lib/timelib.c lib/tm2unixtime.c lib/unixtime2tm.c lib/parse_iso_intervals.c lib/interval.c" -diff -up php-8.0.0beta3/ext/date/lib/parse_tz.c.systzdata php-8.0.0beta3/ext/date/lib/parse_tz.c ---- php-8.0.0beta3/ext/date/lib/parse_tz.c.systzdata 2020-09-01 19:13:26.000000000 +0200 -+++ php-8.0.0beta3/ext/date/lib/parse_tz.c 2020-09-02 08:07:51.039979873 +0200 +diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c +index e41315efdb..4b6547c0a3 100644 +--- a/ext/date/lib/parse_tz.c ++++ b/ext/date/lib/parse_tz.c @@ -26,9 +26,22 @@ #include "timelib.h" #include "timelib_private.h" @@ -81,7 +85,7 @@ #if (defined(__APPLE__) || defined(__APPLE_CC__)) && (defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__)) # if defined(__LITTLE_ENDIAN__) -@@ -95,6 +108,11 @@ static int read_php_preamble(const unsig +@@ -95,6 +108,11 @@ static int read_php_preamble(const unsigned char **tzf, timelib_tzinfo *tz) { uint32_t version; @@ -93,7 +97,7 @@ /* read ID */ version = (*tzf)[3] - '0'; *tzf += 4; -@@ -577,7 +595,429 @@ void timelib_dump_tzinfo(timelib_tzinfo +@@ -577,7 +595,467 @@ void timelib_dump_tzinfo(timelib_tzinfo *tz) } } @@ -323,6 +327,44 @@ + return timelib_strcasecmp(alpha->id, beta->id); +} + ++/* Retrieve tzdata version. */ ++static void retrieve_zone_version(timelib_tzdb *db) ++{ ++ static char buf[30]; ++ char path[PATH_MAX]; ++ FILE *fp; ++ ++ strncpy(path, ZONEINFO_PREFIX "/tzdata.zi", sizeof(path)); ++ ++ fp = fopen(path, "r"); ++ if (fp) { ++ if (fgets(buf, sizeof(buf), fp)) { ++ if (!memcmp(buf, "# version ", 10) && ++ isdigit(buf[10]) && ++ isdigit(buf[11]) && ++ isdigit(buf[12]) && ++ isdigit(buf[13]) && ++ islower(buf[14])) { ++ if (buf[14] >= 't') { /* 2022t = 2022.20 */ ++ buf[17] = 0; ++ buf[16] = buf[14] - 't' + '0'; ++ buf[15] = '2'; ++ } else if (buf[14] >= 'j') { /* 2022j = 2022.10 */ ++ buf[17] = 0; ++ buf[16] = buf[14] - 'j' + '0'; ++ buf[15] = '1'; ++ } else { /* 2022a = 2022.1 */ ++ buf[16] = 0; ++ buf[15] = buf[14] - 'a' + '1'; ++ } ++ buf[14] = '.'; ++ db->version = buf+10; ++ } ++ } ++ fclose(fp); ++ } ++} ++ + +/* Create the zone identifier index by trawling the filesystem. */ +static void create_zone_index(timelib_tzdb *db) @@ -415,7 +457,7 @@ + size_t n; + char *data, *p; + -+ data = malloc(3 * sysdb->index_size + 7); ++ data = malloc(3 * sysdb->index_size + sizeof(FAKE_HEADER) - 1); + + p = mempcpy(data, FAKE_HEADER, sizeof(FAKE_HEADER) - 1); + @@ -524,7 +566,7 @@ { int left = 0, right = tzdb->index_size - 1; -@@ -603,9 +1043,48 @@ static int seek_to_tz_position(const uns +@@ -603,9 +1081,49 @@ static int seek_to_tz_position(const unsigned char **tzf, const char *timezone, return 0; } @@ -561,6 +603,7 @@ + tmp->version = "0.system"; + tmp->data = NULL; + create_zone_index(tmp); ++ retrieve_zone_version(tmp); + system_location_table = create_location_table(); + fake_data_segment(tmp, system_location_table); + timezonedb_system = tmp; @@ -573,7 +616,7 @@ } const timelib_tzdb_index_entry *timelib_timezone_identifiers_list(const timelib_tzdb *tzdb, int *count) -@@ -617,7 +1096,30 @@ const timelib_tzdb_index_entry *timelib_ +@@ -617,7 +1135,30 @@ const timelib_tzdb_index_entry *timelib_timezone_identifiers_list(const timelib_ int timelib_timezone_id_is_valid(const char *timezone, const timelib_tzdb *tzdb) { const unsigned char *tzf; @@ -605,7 +648,7 @@ } static int skip_64bit_preamble(const unsigned char **tzf, timelib_tzinfo *tz) -@@ -662,6 +1164,8 @@ static timelib_tzinfo* timelib_tzinfo_ct +@@ -662,6 +1203,8 @@ static timelib_tzinfo* timelib_tzinfo_ctor(const char *name) timelib_tzinfo *timelib_parse_tzfile(const char *timezone, const timelib_tzdb *tzdb, int *error_code) { const unsigned char *tzf; @@ -614,7 +657,7 @@ timelib_tzinfo *tmp; int version; int transitions_result, types_result; -@@ -669,7 +1173,7 @@ timelib_tzinfo *timelib_parse_tzfile(con +@@ -669,7 +1212,7 @@ timelib_tzinfo *timelib_parse_tzfile(const char *timezone, const timelib_tzdb *t *error_code = TIMELIB_ERROR_NO_ERROR; @@ -623,7 +666,7 @@ tmp = timelib_tzinfo_ctor(timezone); version = read_preamble(&tzf, tmp, &type); -@@ -712,11 +1216,36 @@ timelib_tzinfo *timelib_parse_tzfile(con +@@ -712,11 +1255,36 @@ timelib_tzinfo *timelib_parse_tzfile(const char *timezone, const timelib_tzdb *t return NULL; } @@ -660,3 +703,20 @@ } else { *error_code = TIMELIB_ERROR_NO_SUCH_TIMEZONE; tmp = NULL; +diff --git a/ext/date/php_date.c b/ext/date/php_date.c +index cf4a11b8a2..cd49abc78d 100644 +--- a/ext/date/php_date.c ++++ b/ext/date/php_date.c +@@ -457,7 +457,11 @@ PHP_MINFO_FUNCTION(date) + php_info_print_table_row(2, "date/time support", "enabled"); + php_info_print_table_row(2, "timelib version", TIMELIB_ASCII_VERSION); + php_info_print_table_row(2, "\"Olson\" Timezone Database Version", tzdb->version); ++#ifdef HAVE_SYSTEM_TZDATA ++ php_info_print_table_row(2, "Timezone Database", "system"); ++#else + php_info_print_table_row(2, "Timezone Database", php_date_global_timezone_db_enabled ? "external" : "internal"); ++#endif + php_info_print_table_row(2, "Default timezone", guess_timezone(tzdb)); + php_info_print_table_end(); + +