replace chown with lchown

Version 1.361

Bugfix
Finished

We usually don't want to follow links when setting ownership on a file, so we've swapped chown with lchown. As well, for all configfile and listfile class writes (almost all data files), an fchmod is run after the fopen is called to create the temp file. This is to set the temp file to 600, instead of letting the system decide what it should be. After the temp file is filled, it's renamed to the original and chmod to whatever it's set to be normally.

Interested to try DirectAdmin? Get a 30-day Free Trial!