From 785f216837cc799e1aa1256c800d692fb84a8222 Mon Sep 17 00:00:00 2001 From: Przemyslaw Motacki Date: Fri, 19 Jul 2024 15:02:20 +0200 Subject: [PATCH] SNOW-1454054 - add check of user permission for token file --- .../snowflake/client/config/SFConnectionConfigParser.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/snowflake/client/config/SFConnectionConfigParser.java b/src/main/java/net/snowflake/client/config/SFConnectionConfigParser.java index 4a36d7b22..f37b606fb 100644 --- a/src/main/java/net/snowflake/client/config/SFConnectionConfigParser.java +++ b/src/main/java/net/snowflake/client/config/SFConnectionConfigParser.java @@ -60,14 +60,14 @@ private static Map readParametersMap(Path configFilePath) throws SnowflakeSQLException { try { File file = new File(configFilePath.toUri()); - varifyFilePermissionSecure(configFilePath); + verifyFilePermissionSecure(configFilePath); return mapper.readValue(file, Map.class); } catch (IOException ex) { throw new SnowflakeSQLException(ex, "Problem during reading a configuration file."); } } - private static void varifyFilePermissionSecure(Path configFilePath) + private static void verifyFilePermissionSecure(Path configFilePath) throws IOException, SnowflakeSQLException { if (Constants.getOS() != Constants.OS.WINDOWS) { PosixFileAttributeView posixFileAttributeView = @@ -108,7 +108,7 @@ public static ConnectionParameters buildConnectionParameters() throws SnowflakeS .orElse(SNOWFLAKE_TOKEN_FILE_PATH)); logger.debug("Token used in connect is read from file: {}", path); try { - varifyFilePermissionSecure(path); + verifyFilePermissionSecure(path); String token = new String(Files.readAllBytes(path), Charset.defaultCharset()); if (!token.isEmpty()) { putPropertyIfNotNull(conectionProperties, "token", token.trim());