Skip to content

Commit 5fcc8d4

Browse files
committed
Upgrade security branches to Ubuntu 22.04
20.04 goes out of security support in 2 months. Backporting various commits. See d98963a See af721c9 See 378b79b Closes GH-17963
1 parent 8a69937 commit 5fcc8d4

File tree

13 files changed

+75
-13
lines changed

13 files changed

+75
-13
lines changed

.github/actions/setup-mssql/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ runs:
1111
-p 1433:1433 \
1212
--name sql1 \
1313
-h sql1 \
14-
-d mcr.microsoft.com/mssql/server:2019-CU8-ubuntu-16.04
14+
-d mcr.microsoft.com/mssql/server:2022-CU14-ubuntu-22.04

.github/actions/setup-x64/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ runs:
77
set -x
88
99
sudo service slapd start
10-
docker exec sql1 /opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -U SA -P "<YourStrong@Passw0rd>" -Q "create login pdo_test with password='password', check_policy=off; create user pdo_test for login pdo_test; grant alter, control to pdo_test;"
10+
docker exec sql1 /opt/mssql-tools18/bin/sqlcmd -S 127.0.0.1 -U SA -C -P "<YourStrong@Passw0rd>" -Q "create login pdo_test with password='password', check_policy=off; create user pdo_test for login pdo_test; grant alter, control to pdo_test;"
1111
sudo locale-gen de_DE
1212
1313
./.github/scripts/setup-slapd.sh

.github/scripts/setup-slapd.sh

+4-2
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
@@ -42,7 +42,9 @@ sudo sed -e 's|^\s*SLAPD_SERVICES\s*=.*$|SLAPD_SERVICES="ldap:/// ldaps:/// ldap
4242
# Configure LDAP database.
4343
DBDN=`sudo ldapsearch -Q -LLL -Y EXTERNAL -H ldapi:/// -b cn=config '(&(olcRootDN=*)(olcSuffix=*))' dn | grep -i '^dn:' | sed -e 's/^dn:\s*//'`;
4444

45-
sudo ldapadd -Q -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/ppolicy.ldif
45+
if test -f "/etc/ldap/schema/ppolicy.ldif"; then
46+
sudo ldapadd -Q -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/ppolicy.ldif
47+
fi
4648

4749
sudo ldapmodify -Q -Y EXTERNAL -H ldapi:/// << EOF
4850
dn: $DBDN

.github/workflows/push.yml

+1-1
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

+2-3
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

+24
Original file line numberDiff line numberDiff line change
@@ -685,4 +685,28 @@ extern "C++" {
685685
# define ZEND_INDIRECT_RETURN
686686
#endif
687687

688+
#define __ZEND_DO_PRAGMA(x) _Pragma(#x)
689+
#define _ZEND_DO_PRAGMA(x) __ZEND_DO_PRAGMA(x)
690+
#if defined(__clang__)
691+
# define ZEND_DIAGNOSTIC_IGNORED_START(warning) \
692+
_Pragma("clang diagnostic push") \
693+
_ZEND_DO_PRAGMA(clang diagnostic ignored warning)
694+
# define ZEND_DIAGNOSTIC_IGNORED_END \
695+
_Pragma("clang diagnostic pop")
696+
#elif defined(__GNUC__)
697+
# define ZEND_DIAGNOSTIC_IGNORED_START(warning) \
698+
_Pragma("GCC diagnostic push") \
699+
_ZEND_DO_PRAGMA(GCC diagnostic ignored warning)
700+
# define ZEND_DIAGNOSTIC_IGNORED_END \
701+
_Pragma("GCC diagnostic pop")
702+
#else
703+
# define ZEND_DIAGNOSTIC_IGNORED_START(warning)
704+
# define ZEND_DIAGNOSTIC_IGNORED_END
705+
#endif
706+
707+
/** @deprecated */
708+
#define ZEND_CGG_DIAGNOSTIC_IGNORED_START ZEND_DIAGNOSTIC_IGNORED_START
709+
/** @deprecated */
710+
#define ZEND_CGG_DIAGNOSTIC_IGNORED_END ZEND_DIAGNOSTIC_IGNORED_END
711+
688712
#endif /* ZEND_PORTABILITY_H */

ext/imap/php_imap.c

+13-3
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

+2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@
4747
# endif
4848

4949
/* these are used for quota support */
50+
ZEND_DIAGNOSTIC_IGNORED_START("-Wstrict-prototypes")
5051
# include "c-client.h" /* includes mail.h and rfc822.h */
52+
ZEND_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

+2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@
5353
/* }}} */
5454

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

5860
extern int le_connection;
5961
extern int le_pconnection;

ext/opcache/jit/dynasm/dasm_x86.h

+7
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,14 @@ void dasm_free(Dst_DECL)
124124
void dasm_setupglobal(Dst_DECL, void **gl, unsigned int maxgl)
125125
{
126126
dasm_State *D = Dst_REF;
127+
#ifdef __GNUC__
128+
# pragma GCC diagnostic push
129+
# pragma GCC diagnostic ignored "-Warray-bounds"
130+
#endif
127131
D->globals = gl - 10; /* Negative bias to compensate for locals. */
132+
#ifdef __GNUC__
133+
# pragma GCC diagnostic pop
134+
#endif
128135
DASM_M_GROW(Dst, int, D->lglabels, D->lgsize, (10+maxgl)*sizeof(int));
129136
}
130137

ext/pdo/pdo_dbh.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ void pdo_raise_impl_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *sqlstate
8181
pdo_err = &stmt->error_code;
8282
}
8383

84-
strncpy(*pdo_err, sqlstate, 6);
84+
memcpy(*pdo_err, sqlstate, sizeof(pdo_error_type));
8585

8686
/* hash sqlstate to error messages */
8787
msg = pdo_sqlstate_state_to_description(*pdo_err);

ext/pdo_oci/php_pdo_oci_int.h

+9
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_DIAGNOSTIC_IGNORED_START("-Wstrict-prototypes")
1723
#include <oci.h>
24+
ZEND_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

+8-1
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_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_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)