Snap for 8426163 from c0c15ff7562525c04d7de3bdb14f2e96ca09ab36 to mainline-tzdata2-release

Change-Id: I4b3e585ea2f3c69f4a788a9e8d800b05c6339f99
diff --git a/Android.bp b/Android.bp
index f9c3b6f..79dd58e 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,45 +1,5 @@
 // Copyright 2017 The Android Open Source Project
 
-package {
-    default_applicable_licenses: ["external_e2fsprogs_license"],
-}
-
-// Added automatically by a large-scale-change that took the approach of
-// 'apply every license found to every target'. While this makes sure we respect
-// every license restriction, it may not be entirely correct.
-//
-// e.g. GPL in an MIT project might only apply to the contrib/ directory.
-//
-// Please consider splitting the single license below into multiple licenses,
-// taking care not to lose any license_kind information, and overriding the
-// default license using the 'licenses: [...]' property on targets as needed.
-//
-// For unused files, consider creating a 'fileGroup' with "//visibility:private"
-// to attach the license to, and including a comment whether the files may be
-// used in the current project.
-// See: http://go/android-license-faq
-license {
-    name: "external_e2fsprogs_license",
-    visibility: [":__subpackages__"],
-    license_kinds: [
-        "SPDX-license-identifier-0BSD",
-        "SPDX-license-identifier-Apache-2.0",
-        "SPDX-license-identifier-BSD",
-        "SPDX-license-identifier-GPL",
-        "SPDX-license-identifier-GPL-2.0",
-        "SPDX-license-identifier-LGPL",
-        "SPDX-license-identifier-LGPL-2.0",
-        "SPDX-license-identifier-LGPL-2.1",
-        "SPDX-license-identifier-LGPL-3.0",
-        "SPDX-license-identifier-MIT",
-        "legacy_notice",
-        "legacy_unencumbered",
-    ],
-    license_text: [
-        "NOTICE",
-    ],
-}
-
 cc_defaults {
     name: "e2fsprogs-defaults",
     cflags: ["-Wall", "-Werror"],
diff --git a/METADATA b/METADATA
deleted file mode 100644
index 6d8601b..0000000
--- a/METADATA
+++ /dev/null
@@ -1,3 +0,0 @@
-third_party {
-  license_type: RESTRICTED
-}
diff --git a/contrib/Android.bp b/contrib/Android.bp
index 5fb5545..8bde657 100644
--- a/contrib/Android.bp
+++ b/contrib/Android.bp
@@ -1,15 +1,5 @@
 // Copyright 2017 The Android Open Source Project
 
-package {
-    // See: http://go/android-license-faq
-    // A large-scale-change added 'default_applicable_licenses' to import
-    // all of the 'license_kinds' from "external_e2fsprogs_license"
-    // to get the below license kinds:
-    //   SPDX-license-identifier-Apache-2.0
-    //   SPDX-license-identifier-GPL
-    default_applicable_licenses: ["external_e2fsprogs_license"],
-}
-
 subdirs = ["android"]
 
 //########################################################################
diff --git a/contrib/android/Android.bp b/contrib/android/Android.bp
index c33ebf4..b1fd0da 100644
--- a/contrib/android/Android.bp
+++ b/contrib/android/Android.bp
@@ -3,15 +3,6 @@
 //##########################################################################
 // Build e2fsdroid
 
-package {
-    // See: http://go/android-license-faq
-    // A large-scale-change added 'default_applicable_licenses' to import
-    // all of the 'license_kinds' from "external_e2fsprogs_license"
-    // to get the below license kinds:
-    //   SPDX-license-identifier-Apache-2.0
-    default_applicable_licenses: ["external_e2fsprogs_license"],
-}
-
 cc_binary {
     name: "e2fsdroid",
     host_supported: true,
diff --git a/contrib/android/e2fsdroid.c b/contrib/android/e2fsdroid.c
index f5d24b8..1beb1e2 100644
--- a/contrib/android/e2fsdroid.c
+++ b/contrib/android/e2fsdroid.c
@@ -76,12 +76,11 @@
 	     token && num_tokens < 3;
 	     token = strtok_r(NULL, " ", &token_saveptr), ++num_tokens) {
 		char* endptr = NULL;
-		unsigned long t = strtoul(token, &endptr, 10);
-		if ((t == ULONG_MAX && errno) || (t > UINT_MAX) || *endptr) {
+		*parsed[num_tokens] = strtoul(token, &endptr, 10);
+		if ((*parsed[num_tokens] == ULONG_MAX && errno) || *endptr) {
 			fprintf(stderr, "Malformed u/gid mapping line\n");
 			return 0;
 		}
-		*parsed[num_tokens] = (unsigned int) t;
 	}
 	if (num_tokens < 3 || strtok_r(NULL, " ", &token_saveptr) != NULL) {
 		fprintf(stderr, "Malformed u/gid mapping line\n");
diff --git a/contrib/android/perms.h b/contrib/android/perms.h
index 7987127..6d6a212 100644
--- a/contrib/android/perms.h
+++ b/contrib/android/perms.h
@@ -51,7 +51,6 @@
 #  endif
 #  include <private/android_filesystem_config.h>
 #  include <private/canned_fs_config.h>
-#  include <private/fs_config.h>
 
 errcode_t android_configure_fs(ext2_filsys fs, char *src_dir,
 			       char *target_out,
diff --git a/debugfs/Android.bp b/debugfs/Android.bp
index dd146e4..b9f299b 100644
--- a/debugfs/Android.bp
+++ b/debugfs/Android.bp
@@ -3,16 +3,6 @@
 //########################
 // Build the debugfs binary
 
-package {
-    // See: http://go/android-license-faq
-    // A large-scale-change added 'default_applicable_licenses' to import
-    // all of the 'license_kinds' from "external_e2fsprogs_license"
-    // to get the below license kinds:
-    //   SPDX-license-identifier-GPL
-    //   SPDX-license-identifier-GPL-2.0
-    default_applicable_licenses: ["external_e2fsprogs_license"],
-}
-
 cc_defaults {
     name: "debugfs-defaults",
     defaults: ["e2fsprogs-defaults"],
diff --git a/e2fsck/Android.bp b/e2fsck/Android.bp
index 166d765..d4326e5 100644
--- a/e2fsck/Android.bp
+++ b/e2fsck/Android.bp
@@ -3,17 +3,6 @@
 //########################
 // Build the e2fsck binary
 
-package {
-    // See: http://go/android-license-faq
-    // A large-scale-change added 'default_applicable_licenses' to import
-    // all of the 'license_kinds' from "external_e2fsprogs_license"
-    // to get the below license kinds:
-    //   SPDX-license-identifier-GPL
-    //   SPDX-license-identifier-GPL-2.0
-    //   SPDX-license-identifier-LGPL
-    default_applicable_licenses: ["external_e2fsprogs_license"],
-}
-
 cc_defaults {
     name: "e2fsck-defaults",
     defaults: ["e2fsprogs-defaults"],
@@ -64,12 +53,10 @@
 cc_binary {
     name: "e2fsck",
     host_supported: true,
-    vendor_ramdisk_available: true,
     defaults: ["e2fsck-defaults"],
 
     shared_libs: e2fsck_libs,
     system_shared_libs: ["libc", "libdl"],
-    required: ["badblocks"],
 }
 
 cc_binary {
diff --git a/lib/Android.bp b/lib/Android.bp
index fb0ea07..d877475 100644
--- a/lib/Android.bp
+++ b/lib/Android.bp
@@ -3,30 +3,11 @@
 // All the libraries under this directory export their headers as relative
 // paths to this directory (external/e2fsprogs/lib). This is a helper headers
 // only library to allow exporting
-package {
-    // See: http://go/android-license-faq
-    // A large-scale-change added 'default_applicable_licenses' to import
-    // all of the 'license_kinds' from "external_e2fsprogs_license"
-    // to get the below license kinds:
-    //   SPDX-license-identifier-0BSD
-    //   SPDX-license-identifier-BSD
-    //   SPDX-license-identifier-GPL
-    //   SPDX-license-identifier-GPL-2.0
-    //   SPDX-license-identifier-LGPL
-    //   SPDX-license-identifier-LGPL-2.1
-    //   SPDX-license-identifier-LGPL-3.0
-    //   SPDX-license-identifier-MIT
-    //   legacy_unencumbered
-    default_applicable_licenses: ["external_e2fsprogs_license"],
-}
-
 cc_library_headers {
     name: "libext2-headers",
     host_supported: true,
     vendor_available: true,
-    product_available: true,
     ramdisk_available: true,
-    vendor_ramdisk_available: true,
     recovery_available: true,
     target: {
         windows: {
@@ -34,10 +15,6 @@
         },
     },
     export_include_dirs: ["."],
-    apex_available: [
-        "//apex_available:platform",
-        "com.android.virt",
-    ],
 }
 
 
diff --git a/lib/blkid/Android.bp b/lib/blkid/Android.bp
index 9e0e291..ccfdf8b 100644
--- a/lib/blkid/Android.bp
+++ b/lib/blkid/Android.bp
@@ -1,22 +1,9 @@
 // Copyright 2017 The Android Open Source Project
 
-package {
-    // See: http://go/android-license-faq
-    // A large-scale-change added 'default_applicable_licenses' to import
-    // all of the 'license_kinds' from "external_e2fsprogs_license"
-    // to get the below license kinds:
-    //   SPDX-license-identifier-GPL
-    //   SPDX-license-identifier-LGPL
-    //   SPDX-license-identifier-LGPL-2.1
-    //   SPDX-license-identifier-LGPL-3.0
-    default_applicable_licenses: ["external_e2fsprogs_license"],
-}
-
 cc_library {
     name: "libext2_blkid",
     host_supported: true,
     ramdisk_available: true,
-    vendor_ramdisk_available: true,
     recovery_available: true,
     unique_host_soname: true,
     defaults: ["e2fsprogs-defaults"],
diff --git a/lib/e2p/Android.bp b/lib/e2p/Android.bp
index 566afd2..aa09ad0 100644
--- a/lib/e2p/Android.bp
+++ b/lib/e2p/Android.bp
@@ -1,20 +1,9 @@
 // Copyright 2017 The Android Open Source Project
 
-package {
-    // See: http://go/android-license-faq
-    // A large-scale-change added 'default_applicable_licenses' to import
-    // all of the 'license_kinds' from "external_e2fsprogs_license"
-    // to get the below license kinds:
-    //   SPDX-license-identifier-GPL
-    //   SPDX-license-identifier-LGPL
-    default_applicable_licenses: ["external_e2fsprogs_license"],
-}
-
 cc_library {
     name: "libext2_e2p",
     host_supported: true,
     ramdisk_available: true,
-    vendor_ramdisk_available: true,
     recovery_available: true,
     unique_host_soname: true,
     defaults: ["e2fsprogs-defaults"],
diff --git a/lib/et/Android.bp b/lib/et/Android.bp
index 07f3c27..7df5bf6 100644
--- a/lib/et/Android.bp
+++ b/lib/et/Android.bp
@@ -1,22 +1,9 @@
 // Copyright 2017 The Android Open Source Project
 
-package {
-    // See: http://go/android-license-faq
-    // A large-scale-change added 'default_applicable_licenses' to import
-    // all of the 'license_kinds' from "external_e2fsprogs_license"
-    // to get the below license kinds:
-    //   SPDX-license-identifier-0BSD
-    //   SPDX-license-identifier-BSD
-    //   SPDX-license-identifier-GPL-2.0
-    //   SPDX-license-identifier-MIT
-    default_applicable_licenses: ["external_e2fsprogs_license"],
-}
-
 cc_library {
     name: "libext2_com_err",
     host_supported: true,
     ramdisk_available: true,
-    vendor_ramdisk_available: true,
     recovery_available: true,
     unique_host_soname: true,
     defaults: ["e2fsprogs-defaults"],
diff --git a/lib/ext2fs/Android.bp b/lib/ext2fs/Android.bp
index 919adb1..8a46c02 100644
--- a/lib/ext2fs/Android.bp
+++ b/lib/ext2fs/Android.bp
@@ -1,24 +1,9 @@
 // Copyright 2017 The Android Open Source Project
 
-package {
-    // See: http://go/android-license-faq
-    // A large-scale-change added 'default_applicable_licenses' to import
-    // all of the 'license_kinds' from "external_e2fsprogs_license"
-    // to get the below license kinds:
-    //   SPDX-license-identifier-GPL
-    //   SPDX-license-identifier-GPL-2.0
-    //   SPDX-license-identifier-LGPL
-    //   SPDX-license-identifier-LGPL-2.1
-    //   SPDX-license-identifier-LGPL-3.0
-    //   legacy_unencumbered
-    default_applicable_licenses: ["external_e2fsprogs_license"],
-}
-
 cc_library {
     name: "libext2fs",
     host_supported: true,
     ramdisk_available: true,
-    vendor_ramdisk_available: true,
     recovery_available: true,
     unique_host_soname: true,
     defaults: ["e2fsprogs-defaults"],
diff --git a/lib/ss/Android.bp b/lib/ss/Android.bp
index ebc1e1a..0933251 100644
--- a/lib/ss/Android.bp
+++ b/lib/ss/Android.bp
@@ -1,15 +1,5 @@
 // Copyright 2017 The Android Open Source Project
 
-package {
-    // See: http://go/android-license-faq
-    // A large-scale-change added 'default_applicable_licenses' to import
-    // all of the 'license_kinds' from "external_e2fsprogs_license"
-    // to get the below license kinds:
-    //   SPDX-license-identifier-0BSD
-    //   SPDX-license-identifier-MIT
-    default_applicable_licenses: ["external_e2fsprogs_license"],
-}
-
 cc_library {
     name: "libext2_ss",
     host_supported: true,
diff --git a/lib/support/Android.bp b/lib/support/Android.bp
index a0b064d..14f2f23 100644
--- a/lib/support/Android.bp
+++ b/lib/support/Android.bp
@@ -1,20 +1,9 @@
 // Copyright 2017 The Android Open Source Project
 
-package {
-    // See: http://go/android-license-faq
-    // A large-scale-change added 'default_applicable_licenses' to import
-    // all of the 'license_kinds' from "external_e2fsprogs_license"
-    // to get the below license kinds:
-    //   SPDX-license-identifier-GPL
-    //   SPDX-license-identifier-MIT
-    default_applicable_licenses: ["external_e2fsprogs_license"],
-}
-
 cc_library {
     name: "libext2_quota",
     host_supported: true,
     ramdisk_available: true,
-    vendor_ramdisk_available: true,
     recovery_available: true,
     unique_host_soname: true,
     defaults: ["e2fsprogs-defaults"],
diff --git a/lib/uuid/Android.bp b/lib/uuid/Android.bp
index 67968db..37b4467 100644
--- a/lib/uuid/Android.bp
+++ b/lib/uuid/Android.bp
@@ -1,30 +1,11 @@
 // Copyright 2017 The Android Open Source Project
 
-package {
-    default_applicable_licenses: ["external_e2fsprogs_lib_uuid_license"],
-}
-
-// Added automatically by a large-scale-change
-// See: http://go/android-license-faq
-license {
-    name: "external_e2fsprogs_lib_uuid_license",
-    visibility: [":__subpackages__"],
-    license_kinds: [
-        "SPDX-license-identifier-BSD",
-    ],
-    license_text: [
-        "COPYING",
-    ],
-}
-
 cc_library {
     name: "libext2_uuid",
     host_supported: true,
     ramdisk_available: true,
-    vendor_ramdisk_available: true,
     recovery_available: true,
     vendor_available: true,
-    product_available: true,
     unique_host_soname: true,
     defaults: ["e2fsprogs-defaults"],
     srcs: [
@@ -54,8 +35,4 @@
     header_libs: ["libext2-headers"],
     export_include_dirs: ["."],
     export_header_lib_headers: ["libext2-headers"],
-    apex_available: [
-        "//apex_available:platform",
-        "com.android.virt",
-    ],
 }
diff --git a/misc/Android.bp b/misc/Android.bp
index ca4267b..a93bea4 100644
--- a/misc/Android.bp
+++ b/misc/Android.bp
@@ -2,18 +2,6 @@
 
 // Library used to export files from this directory to other programs in this
 // project.
-package {
-    // See: http://go/android-license-faq
-    // A large-scale-change added 'default_applicable_licenses' to import
-    // all of the 'license_kinds' from "external_e2fsprogs_license"
-    // to get the below license kinds:
-    //   SPDX-license-identifier-GPL
-    //   SPDX-license-identifier-LGPL
-    //   SPDX-license-identifier-LGPL-2.1
-    //   SPDX-license-identifier-LGPL-3.0
-    default_applicable_licenses: ["external_e2fsprogs_license"],
-}
-
 cc_library {
     name: "libext2_misc",
     host_supported: true,
@@ -141,7 +129,6 @@
 cc_binary {
     name: "tune2fs",
     host_supported: true,
-    vendor_ramdisk_available: true,
     defaults: ["tune2fs-defaults"],
 
     shared_libs: tune2fs_libs,
diff --git a/misc/tune2fs.8.in b/misc/tune2fs.8.in
index 94b6c8e..8b3604f 100644
--- a/misc/tune2fs.8.in
+++ b/misc/tune2fs.8.in
@@ -229,18 +229,21 @@
 was previously enabled.
 .TP
 .BI encoding_flags= encoding-flags
-Define parameters for file name character encoding operations.  If a
-flag is not changed using this parameter, its default value is used.
-.I encoding-flags
-should be a comma-separated lists of flags to be enabled.  The flags cannot be
-altered if casefold was previously enabled.
-
-The only flag that can be set right now is
+Override the flags for filename encoding.  This option may only be specified
+when
+.I encoding-name
+is also specified and when the file system doesn't already have the
+.I casefold
+feature enabled.  Currently the only recognized flag is
 .I strict
-which means that invalid strings should be rejected by the file system.
-In the default configuration, the
+which means that invalid filenames are rejected by the file system.  By default,
 .I strict
-flag is disabled.
+is not enabled.
+Flags may be prefixed with "no" to explicitly leave them disabled, e.g.
+.I nostrict
+to explicitly leave the
+.I strict
+flag disabled.
 .TP
 .BI mount_opts= mount_option_string
 Set a set of default mount options which will be used when the file
diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index b721696..b01497c 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -101,7 +101,7 @@
 static int feature_64bit;
 static int fsck_requested;
 static char *undo_file;
-int enabling_casefold;
+static int enabling_casefold;
 
 int journal_size, journal_flags;
 char *journal_device;
@@ -2029,7 +2029,7 @@
 	char	*buf, *token, *next, *p, *arg;
 	int	len, hash_alg;
 	int	r_usage = 0;
-	int encoding = 0;
+	int	encoding = 0;
 	char	*encoding_flags = NULL;
 
 	len = strlen(opts);
diff --git a/resize/Android.bp b/resize/Android.bp
index fe72824..8acdcf6 100644
--- a/resize/Android.bp
+++ b/resize/Android.bp
@@ -1,14 +1,5 @@
 // Copyright 2017 The Android Open Source Project
 
-package {
-    // See: http://go/android-license-faq
-    // A large-scale-change added 'default_applicable_licenses' to import
-    // all of the 'license_kinds' from "external_e2fsprogs_license"
-    // to get the below license kinds:
-    //   SPDX-license-identifier-GPL
-    default_applicable_licenses: ["external_e2fsprogs_license"],
-}
-
 resize2fs_libs = [
     "libext2fs",
     "libext2_com_err",
@@ -33,7 +24,6 @@
 cc_binary {
     name: "resize2fs",
     host_supported: true,
-    vendor_ramdisk_available: true,
     defaults: ["resize2fs-defaults"],
 
     // Host binaries can be compiled statically to be re-used in other environments.