Set file upload to inherit permission of parent directory

I currently have OOD 3.1.9
SELinux enabled
We are still testing OOD for production use.

When we upload files or directories, they work fine, but for some reason, they do not inherit the group ownership of the parent directory.

How can I fix this?

This was actually a bugfix in 3.1.9. The issue I suspect is that you’re not actually able to chown that file to that group. You’ll see errors in /var/log/ondemand-nginx/$USER/error.log for the same.

On that same file in the same directory - are you able to open a shell and chown to that group manually? I suspect you can’t.

Here’s the relevant block of code where we attempt to chown, but rescue and log the failure to do so.

The error shows operation not permitted.

Are you able to open a shell and chown the file to the group you’d expect?

Hi @jeff.ohrstrom. Picking this up from my colleague…

Your assumption is correct, users uploading files do not have the necessary permission to chown to the group, which is intended.

Based on the findings from another recent issue
(File upload and posix acl support - updated)
related to FileUtils.mv versus FileUtils.cp, for the handle_upload function in posix_file.rb, I’ve achieved the desired behavior by enabling setgid on all home directories and switching mv to cp.

What are your thoughts on this approach?

Hi and welcome!

To cp we’d need to rm the temp file as well I think. I’ll have to look into FileUtils.mv as the other topic seems to suggest it’s doing a chown by itself.