[Archive] Fixed permission handling for windows-zipped files 53/302653/1 tizen_6.0
authorPiotr Kosko/Tizen API (PLT) /SRPOL/Engineer/Samsung Electronics <p.kosko@samsung.com>
Mon, 11 Dec 2023 10:51:01 +0000 (11:51 +0100)
committerPiotr Kosko <p.kosko@samsung.com>
Mon, 11 Dec 2023 12:17:44 +0000 (12:17 +0000)
commit1509b1a02cc00d5833f7aeca5348aa07fa8c4c8e
treec04c06eb4153e0674d5e76f28a1230715463b9f1
parentc36c22e634f5d9ea99b74b209392f7855ad3821e
[Archive] Fixed permission handling for windows-zipped files

[Issue] When having files with added P attribute on windows, then zipped
and unzipped on tizen using Web API, files have invalid access rights.

Reproduction:
1. create file on windows
2. add P attribute: attrib -a +p test_file.txt
3. zip file with 7-zip
4. copy to tizen device and unzip with webapi:
function errorCallback(error) {console.log(error);}
function successCallback() {console.log("done");}
function progressCallback(opId, val, name) {
  console.log(
      "extracting operation (: " + opId + ") is in progress (" + (val * 100).toFixed(1) + "%)");
}
function openSuccess(archive) {
  archive.extractAll("downloads", successCallback, errorCallback, progressCallback);
}
tizen.archive.open("downloads/test_kona.zip", "r", openSuccess);
5. check file permission:
 ------x--- 1 owner priv_mediastorage User::App::Shared 9 Oct 31 14:07 testfile.txt

[Verification] With this commit, above scenario ends with proper 755
permissions (for windows files), and recreated files permissions if
points 1-3 are done on ubuntu.
TCT passrate is 100%.

Change-Id: I8d6e3de036b39f5180b4773eaee5b710b0def9be
(cherry picked from commit 0985b4c8da445e34f517cfa63d94a82f00deabb5)
src/archive/un_zip.cc
src/archive/un_zip_extract_request.cc