Skip to content

Commit

Permalink
Add test for bug #76296
Browse files Browse the repository at this point in the history
  • Loading branch information
bukka committed May 18, 2018
1 parent d6bc266 commit 798e707
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions ext/openssl/tests/bug76296.phpt
Original file line number Diff line number Diff line change
@@ -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');

0 comments on commit 798e707

Please sign in to comment.