Skip to content

Commit 37ed20a

Browse files
committed
Upgrade security branches to Ubuntu 22.04
20.04 goes out of security support in 2 months. Cherry-picked from d98963a
1 parent 4694c3e commit 37ed20a

File tree

9 files changed

+51
-9
lines changed

9 files changed

+51
-9
lines changed

.github/scripts/setup-slapd.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
2-
set -ex
2+
set -e
33

44
# Create TLS certificate
55
sudo mkdir -p /etc/ldap/ssl

.github/workflows/push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
- debug: false
6969
zts: true
7070
name: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
71-
runs-on: ubuntu-20.04
71+
runs-on: ubuntu-22.04
7272
steps:
7373
- name: git checkout
7474
uses: actions/checkout@v4

.github/workflows/root.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
with:
4949
asan_ubuntu_version: ${{
5050
(((matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 5) || matrix.branch.version[0] >= 9) && '24.04')
51-
|| '20.04' }}
51+
|| '22.04' }}
5252
branch: ${{ matrix.branch.ref }}
5353
community_verify_type_inference: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 4) || matrix.branch.version[0] >= 9 }}
5454
libmysqlclient_with_mysqli: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] == 1) }}
@@ -57,8 +57,7 @@ jobs:
5757
run_macos_arm64: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 4) || matrix.branch.version[0] >= 9 }}
5858
ubuntu_version: ${{
5959
(((matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 5) || matrix.branch.version[0] >= 9) && '24.04')
60-
|| ((matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 3) && '22.04')
61-
|| '20.04' }}
60+
|| '22.04' }}
6261
windows_version: ${{ ((matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 4) || matrix.branch.version[0] >= 9) && '2022' || '2019' }}
6362
skip_symfony: ${{ matrix.branch.version[0] == 8 && matrix.branch.version[1] == 1 }}
6463
skip_wordpress: ${{ matrix.branch.version[0] == 8 && matrix.branch.version[1] == 1 }}

Zend/zend_portability.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,4 +685,17 @@ extern "C++" {
685685
# define ZEND_INDIRECT_RETURN
686686
#endif
687687

688+
#if __GNUC__ && !defined(__clang__)
689+
# define __DO_PRAGMA(x) _Pragma(#x)
690+
# define _DO_PRAGMA(x) __DO_PRAGMA(x)
691+
# define ZEND_CGG_DIAGNOSTIC_IGNORED_START(warning) \
692+
_Pragma("GCC diagnostic push") \
693+
_DO_PRAGMA(GCC diagnostic ignored warning)
694+
# define ZEND_CGG_DIAGNOSTIC_IGNORED_END \
695+
_Pragma("GCC diagnostic pop")
696+
#else
697+
# define ZEND_CGG_DIAGNOSTIC_IGNORED_START(warning)
698+
# define ZEND_CGG_DIAGNOSTIC_IGNORED_END
699+
#endif
700+
688701
#endif /* ZEND_PORTABILITY_H */

ext/imap/php_imap.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -695,11 +695,9 @@ PHP_RINIT_FUNCTION(imap)
695695
}
696696
/* }}} */
697697

698-
/* {{{ PHP_RSHUTDOWN_FUNCTION */
699-
PHP_RSHUTDOWN_FUNCTION(imap)
698+
static void free_errorlist(void)
700699
{
701700
ERRORLIST *ecur = NIL;
702-
STRINGLIST *acur = NIL;
703701

704702
if (IMAPG(imap_errorstack) != NIL) {
705703
/* output any remaining errors at their original error level */
@@ -715,6 +713,11 @@ PHP_RSHUTDOWN_FUNCTION(imap)
715713
mail_free_errorlist(&IMAPG(imap_errorstack));
716714
IMAPG(imap_errorstack) = NIL;
717715
}
716+
}
717+
718+
static void free_stringlist(void)
719+
{
720+
STRINGLIST *acur = NIL;
718721

719722
if (IMAPG(imap_alertstack) != NIL) {
720723
/* output any remaining alerts at E_NOTICE level */
@@ -730,6 +733,13 @@ PHP_RSHUTDOWN_FUNCTION(imap)
730733
mail_free_stringlist(&IMAPG(imap_alertstack));
731734
IMAPG(imap_alertstack) = NIL;
732735
}
736+
}
737+
738+
/* {{{ PHP_RSHUTDOWN_FUNCTION */
739+
PHP_RSHUTDOWN_FUNCTION(imap)
740+
{
741+
free_errorlist();
742+
free_stringlist();
733743
return SUCCESS;
734744
}
735745
/* }}} */

ext/imap/php_imap.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@
4747
# endif
4848

4949
/* these are used for quota support */
50+
ZEND_CGG_DIAGNOSTIC_IGNORED_START("-Wstrict-prototypes")
5051
# include "c-client.h" /* includes mail.h and rfc822.h */
52+
ZEND_CGG_DIAGNOSTIC_IGNORED_END
5153
# include "imap4r1.h" /* location of c-client quota functions */
5254
#else
5355
# include "mail.h"

ext/oci8/php_oci8_int.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@
5353
/* }}} */
5454

5555
#include "ext/standard/php_string.h"
56+
ZEND_CGG_DIAGNOSTIC_IGNORED_START("-Wstrict-prototypes")
5657
#include <oci.h>
58+
ZEND_CGG_DIAGNOSTIC_IGNORED_END
5759

5860
extern int le_connection;
5961
extern int le_pconnection;

ext/pdo_oci/php_pdo_oci_int.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@
1414
+----------------------------------------------------------------------+
1515
*/
1616

17+
#ifndef PHP_PDO_OCI_INT_H
18+
#define PHP_PDO_OCI_INT_H
19+
20+
#include "zend_portability.h"
21+
22+
ZEND_CGG_DIAGNOSTIC_IGNORED_START("-Wstrict-prototypes")
1723
#include <oci.h>
24+
ZEND_CGG_DIAGNOSTIC_IGNORED_END
1825

1926
typedef struct {
2027
const char *file;
@@ -105,3 +112,5 @@ enum {
105112
PDO_OCI_ATTR_MODULE,
106113
PDO_OCI_ATTR_CALL_TIMEOUT
107114
};
115+
116+
#endif /* PHP_PDO_OCI_INT_H */

ext/soap/php_encoding.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2388,7 +2388,14 @@ static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNod
23882388
if (style == SOAP_ENCODED) {
23892389
if (soap_version == SOAP_1_1) {
23902390
smart_str_0(&array_type);
2391-
if (strcmp(ZSTR_VAL(array_type.s),"xsd:anyType") == 0) {
2391+
#if defined(__GNUC__) && __GNUC__ >= 11
2392+
ZEND_CGG_DIAGNOSTIC_IGNORED_START("-Wstringop-overread")
2393+
#endif
2394+
bool is_xsd_any_type = strcmp(ZSTR_VAL(array_type.s),"xsd:anyType") == 0;
2395+
#if defined(__GNUC__) && __GNUC__ >= 11
2396+
ZEND_CGG_DIAGNOSTIC_IGNORED_END
2397+
#endif
2398+
if (is_xsd_any_type) {
23922399
smart_str_free(&array_type);
23932400
smart_str_appendl(&array_type,"xsd:ur-type",sizeof("xsd:ur-type")-1);
23942401
}

0 commit comments

Comments
 (0)