Skip to content

Commit

Permalink
On Windows, don't check for the chmod/owner file and directory constr…
Browse files Browse the repository at this point in the history
…aint since this is Unix specific
  • Loading branch information
stcarrez committed Dec 22, 2019
1 parent 67345de commit 096fa76
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/keystore-passwords-files.adb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ package body Keystore.Passwords.Files is
Log.Info ("Password file {0} does not exist", Path);
raise Keystore.Bad_Password with "Password file does not exist";
end if;
if (Stat.st_mode and 8#0077#) /= 0 then
if (Stat.st_mode and 8#0077#) /= 0 and Util.Systems.Os.Directory_Separator = '/' then
Log.Info ("Password file {0} is not safe", Path);
raise Keystore.Bad_Password with "Password file is not safe";
end if;
Expand All @@ -104,7 +104,7 @@ package body Keystore.Passwords.Files is
raise Keystore.Bad_Password
with "Directory that contains password file cannot be checked";
end if;
if (Stat.st_mode and 8#0077#) /= 0 then
if (Stat.st_mode and 8#0077#) /= 0 and Util.Systems.Os.Directory_Separator = '/' then
Log.Info ("Directory {0} is not safe for password file", Dir);
raise Keystore.Bad_Password
with "Directory that contains password file is not safe";
Expand Down

0 comments on commit 096fa76

Please sign in to comment.