1--TEST--
2FPM: UNIX socket owner and group settings can be numeric
3--SKIPIF--
4<?php
5include "skipif.inc";
6FPM\Tester::skipIfPosixNotLoaded();
7FPM\Tester::skipIfNotRoot();
8?>
9--FILE--
10<?php
11
12require_once "tester.inc";
13
14$cfg = <<<EOT
15[global]
16error_log = {{FILE:LOG}}
17[unconfined]
18listen = {{ADDR:UDS}}
19listen.owner = 1234
20listen.group = 1234
21user = 1234
22ping.path = /ping
23ping.response = pong
24pm = dynamic
25pm.max_children = 5
26pm.start_servers = 2
27pm.min_spare_servers = 1
28pm.max_spare_servers = 3
29EOT;
30
31$tester = new FPM\Tester($cfg);
32$tester->start();
33$tester->expectLogStartNotices();
34$tester->ping('{{ADDR:UDS}}');
35$st = stat($tester->getListen('{{ADDR:UDS}}'));
36if ($st) {
37  $pw = posix_getpwuid($st['uid']);
38  $gr = posix_getgrgid($st['gid']);
39  $user  = $pw ? $pw['name'] : 'UNKNOWN';
40  $group = $gr ? $gr['name'] : 'UNKNOWN';
41  echo "{$st['uid']}/{$user},{$st['gid']}/{$group}\n";
42} else {
43  echo "stat failed for " . $tester->getListen('{{ADDR:UDS}}');
44}
45$tester->terminate();
46$tester->expectLogTerminatingNotices();
47$tester->close();
48
49?>
50Done
51--EXPECT--
521234/UNKNOWN,1234/UNKNOWN
53Done
54--CLEAN--
55<?php
56require_once "tester.inc";
57FPM\Tester::clean();
58?>
59