Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Unified Diff: lib/src/io.dart

Issue 2233893004: Don't use large UIDs in tar files on Linux. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/io.dart
diff --git a/lib/src/io.dart b/lib/src/io.dart
index 69248cdb8a2f30d1dcf8959a11d3e66e07f8bd77..9ea932de0f031f14c113fa0edf1d55e2f977a25b 100644
--- a/lib/src/io.dart
+++ b/lib/src/io.dart
@@ -1012,7 +1012,7 @@ ByteStream createTarGz(List contents, {String baseDir}) {
return path.relative(entry, from: baseDir);
}).toList();
- if (Platform.operatingSystem != "windows") {
+ if (!Platform.isWindows) {
var args = [
// ustar is the most recent tar format that's compatible across all
// OSes.
@@ -1025,6 +1025,12 @@ ByteStream createTarGz(List contents, {String baseDir}) {
"/dev/stdin"
];
+ // The ustar format doesn't support large UIDs, which can happen if
+ // someone's using Active Directory on Linux. We don't care about
+ // preserving ownership anyway, so we just set them to 0. Note that BSD
+ // tar doesn't support the `--owner` or `--group` arguments.
+ if (Platform.isLinux) args.addAll(["--owner=0", "--group=0"]);
+
var process = await startProcess("tar", args);
process.stdin.add(UTF8.encode(contents.join("\n")));
process.stdin.close();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698