I have a problem with file permissions.
When a user uploads a file with my php script, a directory is created, and the file is created within.
The directory is created by user apache, and the file is also owned by apache. I don't want this.
The root directory for uploads is owned by user "webuser", in group webuser". I want the subdirectories and all files uploaded having "webuser" as owner, and "webuser" as group owner.
I set the permission on my root upload directory to 6XXX, so SUID and GUID are set. I tought it would make everything under the directory owned by "webuser".
When the upload is executed, the file are owned by "apache", so SUID did not work, and the group owner is "webuser", so GUID worked.
I can not use chown function of php, because I am not the root user.
Anyone knows what should I do? My goal is to have "webuser" as owner of every file uploaded.