Bug 308373

Summary: ACL default:mask ignored / mask changed for exif rotated images on import
Product: [Applications] digikam Reporter: Thomas Bettler <thomas.bettler>
Component: Import-PostProcessingAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles
Priority: NOR    
Version: 2.9.0   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In: 3.0.0
Sentry Crash Report:

Description Thomas Bettler 2012-10-14 13:24:22 UTC
While importing images directly from camera, the exif rotated ones get their permissions changed in a undesired way...
The destination folder has the following ACL settings:
bash$ getfacl .
# file: .
# owner: t
# group: users
user::rwx
user:r:rwx
user:t:rwx
group::---
mask::rwx
other::---
default:user::rwx
default:user:ra:rwx
default:user:th:rwx
default:group::---
default:mask::rwx
default:other::---

Example 1: landscape oriented image (no need to rotate)
bash$ getfacl IMG_5665.JPG
# file: IMG_5665.JPG
# owner: t
# group: users
user::rw-
user:r:rwx                  #effective:rw-
user:t:rwx                 #effective:rw-
group::---
mask::rw-
other::---

Example2: Portrait oriented image (auto rotated on import)
bash$ getfacl IMG_5666.JPG
# file: IMG_5666.JPG
# owner: t
# group: users
user::rw-
user:r:rwx                  #effective:---
user:t:rwx                 #effective:---
group::---
mask::---
other::---

Unexpectingly and unfortunately the rotated image has mask:: changed to ---
Expected behaviour: It should be mask::rw- as the non rotated images instead.

Reproducible: Always

Steps to Reproduce:
1. Import images with digikam

Actual Results:  
Unexpectingly and unfortunately the rotated image has mask:: changed to ---


Expected Results:  
Expected behaviour: It should be mask::rw- as the non rotated images instead.

Contact me, if you need more information.
Comment 1 Marcel Wiesweg 2012-10-15 17:18:07 UTC
Do you see the same problem if you rotate a file from the normal digikam view?
Comment 2 Thomas Bettler 2012-10-15 19:58:45 UTC
yes
Comment 3 Marcel Wiesweg 2012-12-09 17:21:01 UTC
Git commit 8d3a76cac529b4f07323e801603da533d1b23ae5 by Marcel Wiesweg.
Committed on 04/11/2012 at 18:40.
Pushed by mwiesweg into branch 'master'.

Copy file permissions to a rotated JPEG file

M  +11   -0    libs/jpegutils/jpegutils.cpp

http://commits.kde.org/digikam/8d3a76cac529b4f07323e801603da533d1b23ae5
Comment 4 Marcel Wiesweg 2012-12-09 17:22:36 UTC
This should at least copy the basic Unix permissions. I dont use ACLs, and Qt does not seem to support them (difficult for a cross-platform library), so I cant test the effect of this change.
Comment 5 Thomas Bettler 2012-12-14 09:12:20 UTC
Thanks for your patch marcel. I tried it and can report it corrects the unexpected behaviour with the ACL mask on *nix systems. You may include this patch also in 3.0.0-rc
Thanks a lot
Comment 6 caulier.gilles 2012-12-14 10:41:10 UTC
Thomas,

Marcel patch's is already applied to 3.0.0-RC code. I can close this file now...

Gilles Caulier