mariadb-java-client/remove_waffle-jna.patch

64 lines
2.7 KiB
Diff
Raw Normal View History

2018-05-05 13:07:27 +00:00
From d4d3f02f3b940693e99f065dd543e6bc03721f53 Mon Sep 17 00:00:00 2001
2017-11-22 11:15:50 +00:00
From: Jakub Janco <jjanco@redhat.com>
2018-05-05 13:07:27 +00:00
Date: Sat, 5 May 2018 15:37:06 +0200
Subject: [PATCH] Remove WindowsNativeSspiAuthentication This dependency is
optional and not in Fedora
2017-06-26 12:11:37 +00:00
---
2017-11-22 11:15:50 +00:00
.../internal/com/send/SendGssApiAuthPacket.java | 26 +---------------------
1 file changed, 1 insertion(+), 25 deletions(-)
2017-06-26 12:11:37 +00:00
diff --git a/src/main/java/org/mariadb/jdbc/internal/com/send/SendGssApiAuthPacket.java b/src/main/java/org/mariadb/jdbc/internal/com/send/SendGssApiAuthPacket.java
2017-11-22 11:15:50 +00:00
index 55771a61..d6a76979 100644
2017-06-26 12:11:37 +00:00
--- a/src/main/java/org/mariadb/jdbc/internal/com/send/SendGssApiAuthPacket.java
+++ b/src/main/java/org/mariadb/jdbc/internal/com/send/SendGssApiAuthPacket.java
2017-11-22 11:15:50 +00:00
@@ -57,7 +57,6 @@ import org.mariadb.jdbc.internal.com.read.Buffer;
2017-06-26 12:11:37 +00:00
import org.mariadb.jdbc.internal.com.read.ErrorPacket;
import org.mariadb.jdbc.internal.com.send.gssapi.GssapiAuth;
import org.mariadb.jdbc.internal.com.send.gssapi.StandardGssapiAuthentication;
-import org.mariadb.jdbc.internal.com.send.gssapi.WindowsNativeSspiAuthentication;
import org.mariadb.jdbc.internal.io.input.PacketInputStream;
import org.mariadb.jdbc.internal.io.output.PacketOutputStream;
2017-11-22 11:15:50 +00:00
2017-06-26 12:11:37 +00:00
@@ -88,7 +87,7 @@ public class SendGssApiAuthPacket extends AbstractAuthSwitchSendResponsePacket i
String mechanisms = buffer.readStringNullEnd(StandardCharsets.UTF_8);
2017-11-22 11:15:50 +00:00
if (mechanisms.isEmpty()) mechanisms = "Kerberos";
2016-09-14 10:49:59 +00:00
- GssapiAuth gssapiAuth = getAuthenticationMethod();
2017-06-26 12:11:37 +00:00
+ GssapiAuth gssapiAuth = new StandardGssapiAuthentication(reader, packSeq);
gssapiAuth.authenticate(pos, serverPrincipalName, mechanisms);
2016-09-14 10:49:59 +00:00
}
2017-11-22 11:15:50 +00:00
@@ -107,28 +106,5 @@ public class SendGssApiAuthPacket extends AbstractAuthSwitchSendResponsePacket i
2016-09-14 10:49:59 +00:00
}
}
2017-11-22 11:15:50 +00:00
2016-09-14 10:49:59 +00:00
- /**
- * Get authentication method according to classpath.
- * Windows native authentication is using Waffle-jna.
- *
- * @return authentication method
- */
- private GssapiAuth getAuthenticationMethod() {
- try {
- //Waffle-jna has jna as dependency, so if not available on classpath, just use standard authentication
2017-11-22 11:15:50 +00:00
- if (Platform.isWindows()) {
2016-09-14 10:49:59 +00:00
- try {
- Class.forName("waffle.windows.auth.impl.WindowsAuthProviderImpl");
2017-06-26 12:11:37 +00:00
- return new WindowsNativeSspiAuthentication(reader, packSeq);
2016-09-14 10:49:59 +00:00
- } catch (ClassNotFoundException cle) {
- //waffle not in the classpath
- }
- }
2017-11-22 11:15:50 +00:00
- } catch (Throwable cle) {
2016-09-14 10:49:59 +00:00
- //jna jar's are not in classpath
- }
2017-06-26 12:11:37 +00:00
- return new StandardGssapiAuthentication(reader, packSeq);
2016-09-14 10:49:59 +00:00
- }
-
}
2017-11-22 11:15:50 +00:00
--
2018-05-05 13:07:27 +00:00
2.14.3
2017-06-26 12:11:37 +00:00