From: Christoph M. Becker Date: Thu, 2 Jul 2020 10:24:49 +0000 (+0200) Subject: Merge branch 'PHP-7.4' X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=66a5f9fb18065a95dff3dba2347489dc361694e7;p=php Merge branch 'PHP-7.4' * PHP-7.4: Extract test helper function for SeCreateSymbolicLinkPrivilege check --- 66a5f9fb18065a95dff3dba2347489dc361694e7 diff --cc ext/standard/tests/file/windows_links/common.inc index 4d4409e9d8,caa3758d44..b4a09e00c2 --- a/ext/standard/tests/file/windows_links/common.inc +++ b/ext/standard/tests/file/windows_links/common.inc @@@ -15,9 -15,16 +15,16 @@@ function get_junction() } function get_mountvol() { - $sysroot = get_sysroot(); + $sysroot = get_sysroot(); - return "$sysroot\\System32\\mountvol.exe"; + return "$sysroot\\System32\\mountvol.exe"; } - ?> + function skipIfSeCreateSymbolicLinkPrivilegeIsDisabled(string $filename) { + $ln = "$filename.lnk"; + $ret = exec("mklink $ln " . __FILE__ .' 2>&1', $out); + @unlink($ln); + if (strpos($ret, 'privilege') !== false) { + die('skip SeCreateSymbolicLinkPrivilege not enabled'); + } + }