PHP 8.5.0 Alpha 1 available for testing

Voting

: max(seven, three)?
(Example: nine)

The Note You're Voting On

Leigh
11 years ago
Note that on unix, if your target user does not have a valid shell, some php functions (eg: tempnam) will not work correctly:

$ grep www-data /etc/passwd
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin

$ cat test.php
#!/usr/bin/php -q
<?php
$info
=posix_getpwnam("www-data");
$id=$info["uid"];

$file=tempnam("/tmp","something");
print
"PRE SetUID: $file\n";

$SETUID=posix_setuid($id);

$file=tempnam("/tmp","something");
print
"POST SetUID: $file\n";
?>

$ sudo ./test.php
PRE SetUID: /tmp/somethingrsb1qZ
POST SetUID:

<< Back to user notes page

To Top