bin/ovpn-key in ovpn-key-0.8.4 vs bin/ovpn-key in ovpn-key-0.8.5
- old
+ new
@@ -63,11 +63,10 @@
end
if options[:generate_client] && options[:generate_zip]
# I assume that user likely wants one of them and is confused with usage
abort 'There can be only one: --client or --zip'
end
-umask = File.umask 0o077
if options[:init]
unless options[:init] == '.'
create_dir options[:init]
Dir.chdir options[:init]
@@ -178,10 +177,9 @@
gen_and_sign('client', options[:generate_zip], options[:no_password] ? nil : ask_password(options[:generate_zip]))
zip_file = File.join(File.expand_path(ZIP_DIR), "#{File.basename ovpn_file, '.ovpn'}.tblk.zip")
File.delete(zip_file) if File.exist?(zip_file)
- File.umask umask
Zip::File.open(zip_file, Zip::File::CREATE) do |zip|
zip.get_output_stream(ovpn_file) {|f|
f.write File.read(ovpn_file)
f.write "cert #{options[:generate_zip]}.crt\nkey #{options[:generate_zip]}.key\n"
}