Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f76f0f81 authored by Tao Bao's avatar Tao Bao Committed by Android Git Automerger
Browse files

am 906550f2: am bf8e85ab: am 2e4dd9ab: Merge "Fix the permission in common.ZipWriteStr()."

* commit '906550f2':
  Fix the permission in common.ZipWriteStr().
parents 3803c8df 906550f2
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -921,7 +921,7 @@ def ZipWriteStr(zip_file, zinfo_or_arcname, data, perms=None,
    zinfo = zipfile.ZipInfo(filename=zinfo_or_arcname)
    zinfo.compress_type = zip_file.compression
    if perms is None:
      perms = 0o644
      perms = 0o100644
  else:
    zinfo = zinfo_or_arcname

@@ -931,6 +931,9 @@ def ZipWriteStr(zip_file, zinfo_or_arcname, data, perms=None,

  # If perms is given, it has a priority.
  if perms is not None:
    # If perms doesn't set the file type, mark it as a regular file.
    if perms & 0o770000 == 0:
      perms |= 0o100000
    zinfo.external_attr = perms << 16

  # Use a fixed timestamp so the output is repeatable.