ahoward / sekrets

sekrets is a command line tool and library used to securely manage encrypted files and settings in your rails' applications and git repositories.
BSD 2-Clause "Simplified" License
268 stars 28 forks source link

openr passes O_RDWR to open #13

Closed limitusus closed 6 months ago

limitusus commented 6 years ago

https://github.com/ahoward/sekrets/blob/master/lib/sekrets.rb#L214 open_r seems to support "readonly" file I/O but it tries to open a file with rb+ instead of rb, which causes Errno::EACCES when trying to read encrypted file with read access.

$ bundle exec sekrets read /path/to/secret.yaml.enc
F, [2018-04-09T15:34:04.977756 #20182] FATAL -- : Permission denied @ rb_sysopen - /path/to/secret.yaml.enc (Errno::EACCES)
/path/to/vendor/bundle/ruby/2.4.0/gems/sekrets-1.10.0/lib/sekrets.rb:214:in `initialize'

Like above, even when secret.yaml.enc has mode 0664.

ahoward commented 6 months ago

on main. will release in v2.0