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

View File

@ -80,6 +80,15 @@ while count < yaml.size
count += 1
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
system "clear"
puts "The very simple password manager for humans".colorize(:yellow).mode(:bold)
@ -142,7 +151,8 @@ while loop
puts item.email.colorize(:red)
end
if !item.login.blank?
print "🏷️ "
# print "🏷️ " # Bug
print "🗿 "
puts item.login.colorize(:yellow)
end
if !item.password.blank?