mirage/ocaml-github

Poor error if chmod fails

Opened this issue · 3 comments

I tried providing my github cookie as a Docker secret. Docker makes it appear inside the container as a world-readable file at /run/secrets/cookie.

It appears that ocaml-github checks the permissions, tries to chmod it (!), fails, throws away the error, and reports that the token doesn't exist. Quite confusing...

I guess this is the problem line:

) (fun _ -> return_none)

avsm commented

odd, why is it trying to chmod it...?

It tries to chmod it to prevent overly readable secrets. In a past version, the default was world-readable secrets. The error behavior should definitely be different. PRs welcome.

avsm commented

Ah yes when I wrote the original jar I didn't set a umask on file creation -- thanks for clarifying!