Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <errno.h> | 5 #include <errno.h> |
| 6 #include <fcntl.h> | 6 #include <fcntl.h> |
| 7 #include <limits.h> | 7 #include <limits.h> |
| 8 #include <sandbox.h> | 8 #include <sandbox.h> |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| 11 #include <stdio.h> | 11 #include <stdio.h> |
| 12 #include <stdlib.h> | 12 #include <stdlib.h> |
| 13 #include <string.h> | 13 #include <string.h> |
| 14 #include <sys/stat.h> | 14 #include <sys/stat.h> |
| 15 | 15 |
| 16 #include <string> | 16 #include <string> |
| 17 | 17 |
| 18 #include "base/files/file.h" | 18 #include "base/files/file.h" |
| 19 #include "base/logging.h" | 19 #include "base/logging.h" |
| 20 #include "base/macros.h" | 20 #include "base/macros.h" |
| 21 #include "base/posix/eintr_wrapper.h" | 21 #include "base/posix/eintr_wrapper.h" |
| 22 #include "base/strings/stringprintf.h" | 22 #include "base/strings/stringprintf.h" |
| 23 #include "base/strings/utf_string_conversions.h" | 23 #include "base/strings/utf_string_conversions.h" |
| 24 #include "chrome/utility/safe_browsing/mac/hfs.h" | 24 #include "chrome/utility/safe_browsing/mac/hfs.h" |
| 25 #include "chrome/utility/safe_browsing/mac/read_stream.h" | 25 #include "chrome/utility/safe_browsing/mac/read_stream.h" |
| 26 #include "chrome/utility/safe_browsing/mac/udif.h" | 26 #include "chrome/utility/safe_browsing/mac/udif.h" |
| 27 | 27 |
| 28 extern "C" { | |
|
Nico
2016/09/09 20:45:44
Maybe add some `// This executable is only suppose
Robert Sesek
2016/09/09 20:47:28
Done.
| |
| 29 int mkdirat(int, const char *, mode_t); | |
| 30 int openat(int, const char *, int, ...); | |
| 31 int unlinkat(int, const char *, int); | |
| 32 } | |
| 33 | |
| 28 namespace { | 34 namespace { |
| 29 | 35 |
| 30 // SafeDMG (crdmg) is a utility that can perform a list or extract operation | 36 // SafeDMG (crdmg) is a utility that can perform a list or extract operation |
| 31 // for DMG files. It does so without using the OS X built-in support for DMG | 37 // for DMG files. It does so without using the OS X built-in support for DMG |
| 32 // files, and it operates under a restrictive sandbox. This is suitable for | 38 // files, and it operates under a restrictive sandbox. This is suitable for |
| 33 // examining DMG files of untrusted origins. | 39 // examining DMG files of untrusted origins. |
| 34 // | 40 // |
| 35 // Usage: crdmg file.dmg [unpack-path] | 41 // Usage: crdmg file.dmg [unpack-path] |
| 36 // If unpack-path is provided, it will extract the contents of file.dmg to the | 42 // If unpack-path is provided, it will extract the contents of file.dmg to the |
| 37 // directory, creating it if it does not exit. Otherwise, it will merely list | 43 // directory, creating it if it does not exit. Otherwise, it will merely list |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 248 | 254 |
| 249 return true; | 255 return true; |
| 250 } | 256 } |
| 251 | 257 |
| 252 } // namespace | 258 } // namespace |
| 253 | 259 |
| 254 int main(int argc, const char* argv[]) { | 260 int main(int argc, const char* argv[]) { |
| 255 SafeDMG safe_dmg; | 261 SafeDMG safe_dmg; |
| 256 return safe_dmg.Main(argc, argv); | 262 return safe_dmg.Main(argc, argv); |
| 257 } | 263 } |
| OLD | NEW |