Commit Graph

524 Commits

Author SHA1 Message Date
Nikita Popov
26e424465c Fix bug #81598: Use C.UTF-8 as LC_CTYPE locale by default
Unfortunately, libedit is locale based and does not accept UTF-8
input when the C locale is used. This patch switches the default
locale to C.UTF-8 instead (if it is available). This makes libedit
work and I believe it shouldn't affect behavior of single-byte
locale-dependent functions that PHP otherwise uses.

Closes GH-7635.
2021-12-05 21:03:27 +01:00
Remi Collet
718e91343f
add SHA256 and SHA512 for security protocol 2021-08-11 13:02:18 +02:00
Nikita Popov
c289f5241d Fix snmp test for ipv6
Just check that the port is present, not the exact form of the
IP address.
2021-07-20 15:01:51 +02:00
Nikita Popov
a4db74364d Remove THREAD_LS
This sounds like it will give you a thread local storage, but in
truth ... it does absolutely nothing.
2021-07-19 16:15:31 +02:00
Nikita Popov
b5a14e6c04 Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
Máté Kocsis
dd83ced6bd
Declare tentative return types for ext/snmp
Closes GH-7064
2021-05-28 12:45:33 +02:00
Máté Kocsis
5e8bdafae4
Merge branch 'PHP-8.0'
* Fix the return types in ext/snmp (#7068)
2021-05-28 12:44:15 +02:00
Máté Kocsis
15ec7404f1
Fix the return types in ext/snmp (#7068) 2021-05-28 12:34:46 +02:00
Nikita Popov
92dfd97315 Use early return in snmp
This avoids the odd dangling elses.
2021-05-27 15:03:59 +02:00
Remi Collet
2237102b74
Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix snmp build without DES
2021-05-27 14:59:51 +02:00
Remi Collet
f9fd3595ec
Fix snmp build without DES 2021-05-27 14:58:07 +02:00
Máté Kocsis
87e4970ebc
Declare SNMP properties
Additionally, convert them to typed properties.

Closes GH-6742
2021-05-14 17:03:05 +02:00
KsaR
01b3fc03c3
Update http->https in license (#6945)
1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |
2021-05-06 12:16:35 +02:00
George Peter Banyard
dc402cb0fc
Fix SNMP
This one had objid_query->array_output = ( (st & SNMP_CMD_SET) ? false : true ); initially
which means that if it was equal to 0 it would be equal to true.
2021-04-09 18:53:31 +01:00
George Peter Banyard
633319586a
Refactor SNMP extension a bit
Use RETURN_* macros instead of RETVAL_* + return;
Use proper boolean types
Use zend_string instead of char* to prevent unnecessary strlen calculation

Closes GH-6846
2021-04-09 17:12:54 +01:00
Máté Kocsis
bf0f6aaf18
Improve class entry generation
Related to GH-6701
2021-02-16 13:09:56 +01:00
Máté Kocsis
a730dc0cf9
Generate class entries for snmp, soap, sockets, sodium, sqlite3, sysv*, tidy
Closes GH-6696
2021-02-15 11:45:26 +01:00
Nikita Popov
e591cc7575 Merge branch 'PHP-8.0'
* PHP-8.0:
  Remove unnecessary cast in snmp_set_oid_output_format
2021-02-02 16:44:12 +01:00
Nikita Popov
b20362c24b Remove unnecessary cast in snmp_set_oid_output_format
This cast isn't needed, and could result in the ValueError being
skipped due to truncation.
2021-02-02 16:43:43 +01:00
Christoph M. Becker
34041e6c57 Merge branch 'PHP-8.0'
* PHP-8.0:
  Add missing stub for SNMPException
2021-01-24 17:58:51 +01:00
Christoph M. Becker
a86443f5a3 Add missing stub for SNMPException 2021-01-24 17:58:26 +01:00
Nikita Popov
3e01f5afb1 Replace zend_bool uses with bool
We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.

Of course, zend_bool is retained as an alias.
2021-01-15 12:33:06 +01:00
Nikita Popov
422d1665a2 Make convert_to_*_ex simple aliases of convert_to_*
Historically, the _ex variants separated the zval first, if a
conversion was necessary. This distinction no longer makes sense
since PHP 7.

The only difference that was still left is that _ex checked whether
the type is the same first, but the usage of these macros did not
actually distinguish on whether such an inlined check is valuable
or not in a given context.

Also drop the unused convert_to_explicit_type macros.
2021-01-14 12:11:11 +01:00
Christoph M. Becker
6fc2cab254 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #70461: disable md5 code when it is not supported in net-snmp
2020-11-02 11:41:37 +01:00
Christoph M. Becker
0123f75b5d Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #70461: disable md5 code when it is not supported in net-snmp
2020-11-02 11:39:42 +01:00
Christoph M. Becker
9690ded288 Fix #70461: disable md5 code when it is not supported in net-snmp
Patch contributed by Alexander Bergmann.

Closes GH-6389.
2020-11-02 11:36:26 +01:00
Nikita Popov
5836e3ed97 Update ext/snmp parameter names
Closes GH-6298.
2020-10-08 17:10:52 +02:00
Nikita Popov
5480e6b13d Accept bool in snmp_set_(quick|enum)_print()
The integer parameter here is actually a boolean.
snmp_set_quick_print() already documented it as such, and
snmp_get_quick_print() was already returning a boolean.
2020-10-08 11:11:51 +02:00
Máté Kocsis
e950ca13ea
Consolidate the usage of "either" and "one of" in error messages
Closes GH-6173
2020-09-20 19:41:47 +02:00
Nikita Popov
c5401854fc Run tidy
This should fix most of the remaining issues with tabs and spaces
being mixed in tests.
2020-09-18 14:28:32 +02:00
Máté Kocsis
36fd95b524
Generate arginfos 2020-09-16 21:28:27 +02:00
Máté Kocsis
de912821e0
Display string default values in stubs more uniformly
Settling on using quoted string
2020-09-16 21:27:01 +02:00
George Peter Banyard
62c20c662a Promote warnings to Error in SNMP extension 2020-09-15 13:08:07 +02:00
Máté Kocsis
c98d47696f
Consolidate new union type ZPP macro names
They will now follow the canonical order of types. Older macros are
left intact due to maintaining BC.

Closes GH-6112
2020-09-11 11:00:18 +02:00
Nikita Popov
79efbb1579 Fix leak in snmp 2020-09-10 23:20:46 +02:00
Nikita Popov
41f4e912bb Mark snmp tests as conflicting 2020-09-09 11:24:06 +02:00
Nikita Popov
712c914fd5 Suppress uninitialized variable warning in snmp
These are false positive warnings.
2020-09-09 11:23:34 +02:00
Máté Kocsis
9975986b7e
Improve error messages mentioning parameters instead of arguments
Closes GH-5999
2020-09-09 10:47:43 +02:00
Nikita Popov
e9d1893f15 Wildcard output differences in snmp tests
And point out that snmp-mibs-downloader is needed.
2020-09-09 10:02:25 +02:00
Nikita Popov
b553ba7c0d Avoid use of remote_port in snmp
This field is not used (and has not been used for a long time --
I've seen some mailing list thread from 2003 about it!) and throws
a deprecation warning.  The port is part of peername instead (for
transports that support a port at all).
2020-09-09 09:33:36 +02:00
Nikita Popov
905c79c05c Fix some snmp stubs
As well as some basic mistakes in tests.
2020-09-08 17:16:57 +02:00
Nikita Popov
6e91a2ef5e Suppress unused variable in snmp
force_ipv6 may be unused if compiling without ipv6 support.
2020-09-08 17:16:56 +02:00
Máté Kocsis
8107a1da5a
Use ZPP instead of custom type checks
We can add these types as a native type declaration to stubs as a side-effect. Closes GH-6068
2020-09-04 14:32:34 +02:00
Máté Kocsis
f7fbc6333f
Add more precise type info for stubs
Closes GH-6005
2020-09-01 16:35:56 +02:00
Máté Kocsis
2d32b633b2
Cleanup snmp after resource to object migration 2020-08-04 09:14:12 +02:00
Max Semenik
2b5de6f839
Remove proto comments from C files
Closes GH-5758
2020-07-06 21:13:34 +02:00
Fabien Villepinte
0c6d06ecfa Replace EXPECTF when possible
Closes GH-5779
2020-06-29 21:31:44 +02:00
Nikita Popov
c9b9f525a9 Include stub hash in generated arginfo files
The hash is used to check whether the arginfo file needs to be
regenerated. PHP-Parser will only be downloaded if this is actually
necessary.

This ensures that release artifacts will never try to regenerate
stubs and thus fetch PHP-Parser, as long as you do not modify any
files.

Closes GH-5739.
2020-06-24 09:55:19 +02:00
Christoph M. Becker
5a04796f76 Fix MSVC level 1 (severe) warnings
We fix (hopefully) all instances of:

* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4005>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4024>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4028>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4047>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4087>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4090>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4273>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4312>

`zend_llist_add_element()` and `zend_llist_prepend_element()` now
explicitly expect a *const* pointer.

We use the macro `ZEND_VOIDP()` instead of a `(void*)` cast to suppress
C4090; this should prevent accidential removal of the cast by
clarifying the intention, and makes it easier to remove the casts if
the issue[1] will be resolved sometime.

[1] <https://developercommunity.visualstudio.com/content/problem/390711/c-compiler-incorrect-propagation-of-const-qualifie.html>
2020-06-05 11:17:05 +02:00
Nikita Popov
c4ad8beaa8 Do not inherit LC_CTYPE locale from environment
Treatment of locales in PHP is currently inconsistent: The LC_ALL
locale is set to "C", as is standard behavior on program startup.
The LC_CTYPE locale is set to "", which will inherit it from the
environment. However, the inherited LC_CTYPE locale will only be
used in some cases, while in other cases it is necessary to perform
an explicit setlocale() call in PHP first. This is the case for
the locale-sensitive handling in the PCRE extension.

Make things consistent by *never* inheriting any locales from the
environment. LC_ALL, including LC_CTYPE will be "C" on startup.
A locale can be set or inherited through an explicit setlocale()
call, at which point the behavior will be fully consistent and
predictable.

Closes GH-5488.
2020-04-30 10:22:51 +02:00