diff options
author | Jakub Zelenka <bukka@php.net> | 2018-05-18 17:13:55 +0100 |
---|---|---|
committer | Jakub Zelenka <bukka@php.net> | 2018-05-18 17:15:36 +0100 |
commit | 798e707eb32244e9053e7846a766bfbf88aa8d15 (patch) | |
tree | 1c83b86fba0aae7768f8f7e26429ff0e5b820d31 | |
parent | d6bc266ba057743f18a95c1727493f161257fe41 (diff) | |
download | php-git-798e707eb32244e9053e7846a766bfbf88aa8d15.tar.gz |
Add test for bug #76296
-rw-r--r-- | ext/openssl/tests/bug76296.phpt | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ext/openssl/tests/bug76296.phpt b/ext/openssl/tests/bug76296.phpt new file mode 100644 index 0000000000..7ab15dfbf3 --- /dev/null +++ b/ext/openssl/tests/bug76296.phpt @@ -0,0 +1,22 @@ +--TEST-- +Bug #76296 openssl_pkey_get_public does not respect open_basedir +--SKIPIF-- +<?php if (!extension_loaded("openssl")) print "skip"; ?> +--FILE-- +<?php +$dir = __DIR__ . '/bug76296_openbasedir'; +$pem = 'file://' . __DIR__ . '/public.key'; +if (!is_dir($dir)) { + mkdir($dir); +} + +ini_set('open_basedir', $dir); + +var_dump(openssl_pkey_get_public($pem)); +?> +--EXPECTF-- + +Warning: openssl_pkey_get_public(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (%s) in %s on line %d +bool(false) +--CLEAN-- +@rmdir(__DIR__ . '/bug76296_openbasedir'); |