summaryrefslogtreecommitdiffstats
path: root/chrome/common/zip_internal.h
diff options
context:
space:
mode:
authorhshi@chromium.org <hshi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-21 19:33:59 +0000
committerhshi@chromium.org <hshi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-21 19:33:59 +0000
commitea0bb718e2027f6205433ddd0d78783595b5c40a (patch)
tree81eb2786a7947005e5ad3fd22e27c1b7cfcd1392 /chrome/common/zip_internal.h
parent23bf56f2d05f21fc3715ce4979e8e667bfd320de (diff)
downloadchromium_src-ea0bb718e2027f6205433ddd0d78783595b5c40a.zip
chromium_src-ea0bb718e2027f6205433ddd0d78783595b5c40a.tar.gz
chromium_src-ea0bb718e2027f6205433ddd0d78783595b5c40a.tar.bz2
Change zip::ZipFiles() function to take a file descriptor for the dest zip file.
We want the browser process to validate the destination zip file path to make sure it is not asked to overwrite an existing file or to a directory that could cause security problems. By replacing the destination file path |dest_file| with a file descriptor |dest_fd|: this CL allows the dest file to be opened and owned by the browser process then passed via IPC to utility process. There is no need to have a duplicate function that takes destination file path. The new function will be used for CrOS only. BUG=138359 TEST=builds, passes unit tests. See also https://codereview.chromium.org/11392005/ for relevant discussion. Review URL: https://chromiumcodereview.appspot.com/11413100 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169090 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/zip_internal.h')
-rw-r--r--chrome/common/zip_internal.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/chrome/common/zip_internal.h b/chrome/common/zip_internal.h
index 3bf8683..cc13a71 100644
--- a/chrome/common/zip_internal.h
+++ b/chrome/common/zip_internal.h
@@ -38,6 +38,12 @@ unzFile PreprareMemoryForUnzipping(const std::string& data);
// Windows. |append_flag| will be passed to zipOpen2().
zipFile OpenForZipping(const std::string& file_name_utf8, int append_flag);
+#if defined(OS_POSIX)
+// Opens the file referred to by |zip_fd| for zipping. |append_flag| will be
+// passed to zipOpen2().
+zipFile OpenFdForZipping(int zip_fd, int append_flag);
+#endif
+
const int kZipMaxPath = 256;
const int kZipBufSize = 8192;