Is there a way to allow chown command to be run by www-data but limiting it in a way that the files owner can be changed only to uids greator than that of www-data user?
I already researched a lot and only way to allow chown to be run by any other user than root requires to give sudo privileges to that user but that is not an option for me until I can make sure that the owner is not set to any user with smaller uid than www-data.
To give the context, I am creating an app where I am trying to simulate hosting by creating a new linux user for each signed up user. The user can then upload files but I need to change the owner of these files to the corresponding linux user.