check file permissions

This commit is contained in:
Alexander Popov 2022-04-08 17:35:56 +03:00
parent ddaa870668
commit d72acba22c
Signed by: iiiypuk
GPG Key ID: 3F76816AEE08F908
2 changed files with 13 additions and 2 deletions

View File

@ -7,7 +7,7 @@
- ♻️ - Edited - ♻️ - Edited
## 0.2.2 - [08/04/2022] ## 0.2.2 - [08/04/2022]
- 🐛 - Before label emoji not insert space symbol (temponary change emoji) - - Added password file check permissions
- - Added title by start program - - Added title by start program
- - Added clear terminal by new search - - Added clear terminal by new search
- - Added by start&close program clear terminal - - Added by start&close program clear terminal
@ -15,6 +15,7 @@
- - Added emoji to output - - Added emoji to output
- ✔️ - Fixed BYE emoji color - ✔️ - Fixed BYE emoji color
- ♻️ - Edited URL color & style output - ♻️ - Edited URL color & style output
- 🐛 - Before label emoji not insert space symbol (temponary change emoji)
## 0.2.1 - [14/03/2022] ## 0.2.1 - [14/03/2022]
- - prompt '>' set color green - - prompt '>' set color green

View File

@ -80,6 +80,15 @@ while count < yaml.size
count += 1 count += 1
end end
# check file ppermissions
password_file_permissions = File.info(password_file_path).permissions.to_s
if /\d{3}/.match(password_file_permissions).try &.[0] != "600"
puts "Password file permissions is not RW for you.".colorize(:red)
exit(1)
end
# pmng title # pmng title
system "clear" system "clear"
puts "The very simple password manager for humans".colorize(:yellow).mode(:bold) puts "The very simple password manager for humans".colorize(:yellow).mode(:bold)
@ -142,7 +151,8 @@ while loop
puts item.email.colorize(:red) puts item.email.colorize(:red)
end end
if !item.login.blank? if !item.login.blank?
print "🏷️ " # print "🏷️ " # Bug
print "🗿 "
puts item.login.colorize(:yellow) puts item.login.colorize(:yellow)
end end
if !item.password.blank? if !item.password.blank?