crash-manager: don't store in zip archive files referred by symlinks 04/171104/7
authorMateusz Moscicki <m.moscicki2@partner.samsung.com>
Mon, 26 Feb 2018 12:22:47 +0000 (13:22 +0100)
committerKarol Lewandowski <k.lewandowsk@samsung.com>
Fri, 16 Mar 2018 14:03:09 +0000 (14:03 +0000)
minicoredump (will be introduced in next commit) has an option to save
/proc/<pid>/ files in report. As /proc/<pid>/fd/* contains symlinks, the
created archive will contain the contents of these fds. This is
undesirable as files might be quite big and contain private (sensitive)
data.

This commit adds -y option to zip, which will allow storing symlinks to
actual files instead of their contents (as it was available originally
under /proc/<pid>/)"

Change-Id: I0a7c9211eab1acd39da7db3930e967ddab5eceef

src/crash-manager/crash-manager.c

index 4a5a44a..28d9cd0 100644 (file)
@@ -762,7 +762,7 @@ static void compress(void)
                return;
        }
 
-       ret = snprintf(command, sizeof(command), "cd %s && /bin/zip -r %s %s > /dev/null 2>&1",
+       ret = snprintf(command, sizeof(command), "cd %s && /bin/zip -y -r %s %s > /dev/null 2>&1",
                        crash_info.temp_dir, zip_path, crash_info.name);
        if (ret < 0) {
                _E("Failed to snprintf for zip command");