On Thu, Mar 30, 2017 at 8:55 AM, Fernando Vicente <fvice...@mwneo.com> wrote:
>
> apr_file_copy does not copies permissions from source if the destination
> already exists, even when the flag APR_FILE_SOURCE_PERMS is set.
> I made a quick test by creating 3 files with the following permissions:
> -rwx------. test1.txt
> -rwxrwx---. test2.txt
> -rwxrwx---. test3.txt
>
> then I copied test1.txt over test3.txt, using apr_file_copy with the
> APR_FILE_SOURCE_PERMS flag, so I was expecting that test3.txt permissions
> would be copied from test1.txt, but that didn't happened. The content of the
> file was copied correctly, I can see that test3.txt now has the content of
> test1.txt, however the permissions were not copied from the source.
>
> Is this the expected behaviour? should documentation warn that if the
> destination already exists, then permissions will not be copied even with
> that flag?

Since we make no statement either way I wouldn't call this 'expected'.

The linux behavior of cp -p differs from the APR 1.5.x and earlier behavior.

We will need to @bug the API docs page either way as an informational
entry. We can certainly fix this behavior in APR 2.0.x.

I'd suggest we treat it as a bug, change the behavior accordingly in 1.6.0,
and @bug the API to indicate the old vs new behavior. Thoughts?

Reply via email to