diff --git a/_oasis b/_oasis index 3cd8782..c1d7c9e 100644 --- a/_oasis +++ b/_oasis @@ -18,10 +18,10 @@ Library oPasswd Pack: true Modules: Passwd, Shadow, Common BuildDepends: unix, ctypes, ctypes.foreign - ByteOpt: -warn-error +a -bin-annot -short-paths + ByteOpt: -warn-error +a -bin-annot if flag(extra_debugging) ByteOpt+: -g -runtime-variant d -verbose - NativeOpt: -warn-error +a -bin-annot -short-paths + NativeOpt: -warn-error +a -bin-annot if flag(extra_debugging) NativeOpt+: -g -runtime-variant d -verbose @@ -30,7 +30,7 @@ Executable opasswd_test BuildTools: ocamlbuild MainIs: opasswd_test.ml BuildDepends: oPasswd - NativeOpt: -warn-error +a -bin-annot -short-paths + NativeOpt: -warn-error +a -bin-annot if flag(extra_debugging) NativeOpt+: -g -runtime-variant d -verbose CompiledObject: best diff --git a/lib/common.ml b/lib/common.ml index c0e9771..835adac 100644 --- a/lib/common.ml +++ b/lib/common.ml @@ -1,3 +1,5 @@ +let ( |> ) a b = b a + let get_password name = if Shadow.shadow_enabled () then Shadow.(with_lock (fun () -> diff --git a/lib/passwd.ml b/lib/passwd.ml index 5ecca7c..d000587 100644 --- a/lib/passwd.ml +++ b/lib/passwd.ml @@ -2,6 +2,8 @@ open Ctypes open Foreign open PosixTypes +let ( |> ) a b = b a + type file_descr = unit ptr let file_descr : file_descr typ = ptr void diff --git a/lib/shadow.ml b/lib/shadow.ml index a960e30..0ec2521 100644 --- a/lib/shadow.ml +++ b/lib/shadow.ml @@ -2,6 +2,8 @@ open Ctypes open Foreign open PosixTypes +let ( |> ) a b = b a + type t = { name : string; passwd : string; diff --git a/test/opasswd_test.ml b/test/opasswd_test.ml index 55db0c8..7988e79 100644 --- a/test/opasswd_test.ml +++ b/test/opasswd_test.ml @@ -2,6 +2,9 @@ open Unix open OPasswd +let ( |> ) a b = b a +let ( @@ ) f g = f g + let tmp_shadow_file = Unix.getcwd () ^ "/dummy-shadow" let tmp_passwd_file = Unix.getcwd () ^ "/dummy-passwd"