I'm running a PHP process from root which calls posix_setuid(1500); and then tries to open a file output.log
The ls -l output.log shows this output:
-rwxrwxr-x 1 www-data www-data 2294376 Mar 19 12:05 output.log
The id command from my user account(jonny) shows this output:
uid=1500(jonny) gid=1500(jonny) groups=1500(jonny),27(sudo),33(www-data)
Even after changing the uid to jonny why is PHP process not able to write to output.log file?