Skip to content

Commit

Permalink
Fix chmod
Browse files Browse the repository at this point in the history
  • Loading branch information
patricoferris committed Mar 22, 2024
1 parent 9d8bf26 commit 86e56ef
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
3 changes: 1 addition & 2 deletions vendor/container-image/src/checkout.ml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ let bytes_to_size ?(decimals = 2) ppf = function


external lchown : string -> int -> int -> unit = "container_image_unix_lchown"
external lchmod : string -> int -> unit = "container_image_unix_lchmod"

let checkout_layer ~sw ~cache layer dir =
let fd = Cache.Blob.get_fd ~sw cache layer in
Expand Down Expand Up @@ -51,7 +50,7 @@ let checkout_layer ~sw ~cache layer dir =
let path = Eio.Path.native_exn path in
lchown path hdr.user_id hdr.group_id;
(* For setting the user bit etc. *)
(if hdr.link_indicator <> Symbolic then lchmod path file_mode);
(if hdr.link_indicator <> Symbolic then Unix.chmod path file_mode);
(* Setting times *)
let access_time =
Option.value ~default:0. @@
Expand Down
14 changes: 0 additions & 14 deletions vendor/container-image/src/container_image_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,3 @@ CAMLprim value container_image_unix_lchown(value path, value uid, value gid)
if (ret == -1) caml_uerror("lchown", path);
CAMLreturn(Val_unit);
}

CAMLprim value container_image_unix_lchmod(value path, value v_mode)
{
CAMLparam1(path);
char * p; int ret;
caml_unix_check_path(path, "lchmod");
p = caml_stat_strdup(String_val(path));
caml_enter_blocking_section();
ret = lchmod(p, Int_val(v_mode));
caml_leave_blocking_section();
caml_stat_free(p);
if (ret == -1) caml_uerror("lchmod", path);
CAMLreturn(Val_unit);
}

0 comments on commit 86e56ef

Please sign in to comment.