xref: /PHP-8.1/ext/session/tests/bug42596.phpt (revision b5a14e6c)
1--TEST--
2Bug #42596 (session.save_path MODE option will not set "write" bit for group or world)
3--EXTENSIONS--
4session
5--SKIPIF--
6<?php
7    if(substr(PHP_OS, 0, 3) == "WIN") die("skip not for Windows");
8    include('skipif.inc');
9?>
10--INI--
11session.use_cookies=0
12session.cache_limiter=
13session.use_trans_sid=1
14arg_separator.output="&amp;"
15session.name=PHPSESSID
16session.serialize_handler=php
17session.save_handler=files
18--FILE--
19<?php
20$sessdir = __DIR__.'/bug42596/';
21@rmdir($sessdir);
22mkdir($sessdir);
23$save_path = '0;0777;'.$sessdir;
24umask(0);
25session_save_path($save_path);
26session_start();
27echo "hello world\n";
28session_write_close();
29
30foreach (glob($sessdir. "*") as $sessfile) {
31  var_dump(decoct(fileperms($sessfile)));
32  unlink($sessfile);
33}
34rmdir($sessdir);
35?>
36--EXPECT--
37hello world
38string(6) "100777"
39