diff --git a/jet/main.py b/jet/main.py index 2c0515a..f017d37 100644 --- a/jet/main.py +++ b/jet/main.py @@ -120,9 +120,14 @@ def main(): else: log.info("Checksum for file %s. %s %s:", destination, sha_bits, sha) + if f["mode"] is not None: + fmode = f["mode"] + else: + fmode = f"{os.stat(destination).st_mode&0o777:03o}" + content_manifest += "%s %s=%s uid=%s gid=%s mode=%s program_id=%s\n" % \ (f["destination"][1:] if f["destination"][0] == "/" else f["destination"], - sha_bits, sha, f["uid"], f["gid"], f["mode"], f["program_id"]) + sha_bits, sha, f["uid"], f["gid"], fmode, f["program_id"]) if f["symlink"]: contents_symlink += "%s%s %s\n" % (mount_dir, f["destination"], f["destination"]) diff --git a/jet/utils.py b/jet/utils.py index 61cb9b1..e7f49fb 100644 --- a/jet/utils.py +++ b/jet/utils.py @@ -138,7 +138,7 @@ def required(d, k): "destination": required(file, "destination"), "uid": file.get("uid", 0), "gid": file.get("gid", 0), - "mode": file.get("mode", 555), + "mode": file.get("mode", None), "program_id": file.get("program_id", 1), "symlink": file.get("symlink", True), })