Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency net.java.dev.jna:jna-platform to v5 #296

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mend-for-github-com[bot]
Copy link

@mend-for-github-com mend-for-github-com bot commented Nov 20, 2022

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
net.java.dev.jna:jna-platform 4.4.0 -> 5.0.0 age adoption passing confidence
net.java.dev.jna:jna-platform 4.5.2 -> 5.0.0 age adoption passing confidence

By merging this PR, the below issues will be automatically resolved and closed:

Severity CVSS Score CVE GitHub Issue
High 7.5 WS-2014-0065 #290

By merging this PR, the below issues will be automatically resolved and closed:

Severity CVSS Score CVE GitHub Issue
High 7.5 WS-2014-0065 #290

Release Notes

java-native-access/jna (net.java.dev.jna:jna-platform)

v5.0.0

Compare Source

=============

Features

  • #​975: Add package versions to OSGi metadata. - @​io7m.
  • #​915: Adding interfaces to call to Cryptui and Crypt32 windows libraries and adding related structures to Wincrypt. - @​rosh89.
  • #​903: Carry HRESULT in c.s.j.p.win32.COM.COMException, introduce c.s.j.p.win32.COM.COMInvokeException as subclass of COMException for exception as the result of a IDispatch#Invoke. The EXECPINFO is unwrapped into fields in the COMInvokeException and correctly freed. - @​matthiasblaesing.
  • #​822: Native#loadLibrary requires that the interface class passed in is an instance of Library. The runtime check can be enhanced by using a constraint generic. This breaks binary compatibility (see notes below) - @​d-noll.

    In a followup, the original loadLibrary methods were deprecated and Native#load methods were introduced, that hold the new generic definitions. So this change is now binary compatible.
  • #​889: The Structure#newInstance receive the target type as a parameter. This adds a limited generic type, so that the return type ist the target type and not a generic structure, removing the necessity to do an explizit cast - @​matthiasblaesing.
  • #​913: Add @ComInterface annotation to com.sun.jna.platform.win32.COM.util.IConnectionPoint to make it possible to retrieve it via IUnknown#queryInterface - @​matthiasblaesing.
  • #​797: Binding Advapi32#EnumDependendServices, Advapi32#EnumServicesStatusEx and Advapi32#QueryServiceStatus. W32Service#stopService was modified to be more resilent when stopping service - @​matthiasblaesing.
  • Bind com.sun.jna.platform.win32.Kernel32.ExpandEnvironmentStrings and add helper method for it as Kernel32Util#expandEnvironmentStrings - @​matthiasblaesing.
  • #​935: Add RegConnectRegistry to Advapi32 mappings. - @​cxcorp.
  • #​947: Allow retrieval of ACEs from com.sun.jna.platform.win32.WinNT.ACL even if the contained ACE is not currently supported - @​jrobhoward.
  • #​954: Add c.s.j.Structure.FieldOrder annotation to define the field order of a structures without implementing Structure#getFieldOrder() - @​idosu.
  • #​959: Added GetProcessTimes and GetProcessIoCounters to com.sun.jna.platform.win32.Kernel32 - @​dbwiddis.
  • #​952: Added CreateMutex, OpenMutex and ReleaseMutex to com.sun.jna.platform.win32.Kernel32 - @​matthiasblaesing.
  • #​973: Added PdhLookupPerfNameByIndex, PdhLookupPerfIndexByName, and PdhEnumObjectItems to c.s.j.platform.win32.Pdh and a c.s.j.platform.win32.PdhUtil class to access them - @​dbwiddis.
  • #​980: Added PERF_OBJECT_TYPE, PERF_COUNTER_BLOCK, and PERF_COUNTER_DEFINITION to c.s.j.platform.win32.WinPerf and added Pointer constructors to ``PERF_INSTANCE_DEFINITIONandPERF_DATA_BLOCK` - @​dbwiddis.
  • #​981: Added WTS_PROCESS_INFO_EX, WTSEnumerateProcessesEx, and WTSFreeMemoryEx to c.s.j.platform.win32.Wtsapi32 - @​dbwiddis.
  • #​983: Added GetIfEntry, GetIfEntry2, and GetNetworkParams and supporting structures MIB_IFROW, MIB_IF_ROW2, and FIXED_INFO to c.s.j.platform.win32.IPHlpAPI.java - @​dbwiddis.
  • #​984: Added CM_Locate_DevNode, CM_Get_Parent, CM_Get_Child, CM_Get_Sibling, CM_Get_Device_ID, and CM_Get_Device_ID_Size to c.s.j.platform.win32.Cfgmgr32.java and a c.s.j.platform.win32.Cfgmgr32Util class for CM_Get_Device_ID - @​dbwiddis.
  • #​988: Added PdhLookupPerfIndexByEnglishName to c.s.j.platform.win32.PdhUtil - @​dbwiddis.
  • #​992: Improve stability of windows tests and add appveyor configuration for windows CI builds - @​matthiasblaesing.
  • #​995: Added structures and methods to c.s.j.platform.mac.SystemB for Process, Network interface, Swapfile, Time, and Filesystem info - @​dbwiddis.
  • #​997: Added Sysinfo structure and function to c.s.j.platform.linux.LibC - @​dbwiddis.
  • #​1001: Added overloads to c.s.j.platform.win32.Advapi32Util methods which allow the caller to specify samDesiredExtra to request additional registry key security and access rights - @​camw.
  • #​1007: Added OSGi export of Solaris package - @​swimmesberger.
  • #​1003: Allow NativeMapped to be used with enums - @​koraktor.
  • #​994: Added CoInitializeSecurity and CoSetProxyBlanket to c.s.j.platform.win32.Ole32, added new c.s.j.platform.win32.Wbemcli classes needed to query WMI, and added a WbemcliUtil class implementing WMI queries. - @​dbwiddis.
  • #​1013: Add automatic module name entries to manifest of jna and jna-platform - @​matthiasblaesing.
  • #​985: Improve handling of dynamicaly extracted native library. On Mac OS X systems ~/Library/Application Support/JNA/temp and on other Unix like systems $XDG_CACHE_DIR/JNA/temp (Default value is: ~/.cache/JNA/temp) is used - @​matthiasblaesing.
  • Bind com.sun.jna.platform.win32.Kernel32#ExitProcess - @​Groostav.

Bug Fixes

  • #​652: Dead Lock in class initialization - @​matthiasblaesing.
  • #​843: Correctly bind com.sun.jna.platform.win32.SecBufferDesc and add convenience binding as com.sun.jna.platform.win32.SspiUtil.ManagedSecBufferDesc. Bind SSPI functions InitializeSecurityContext, AcceptSecurityContext, QueryCredentialsAttributes, QuerySecurityPackageInfo, EncryptMessage, DecryptMessage, MakeSignature, VerifySignature in com.sun.jna.platform.win32.Secur32 - @​matthiasblaesing.
  • #​863: Fix ARM softfloat/hardfloat detection by modifying armSoftFloat condition in ELFAnalyser. Before this fix a softfloat binary could be misdetected as hardfloat. - @​kunkun26.
  • #​867: Fix memory leak in COMLateBindingObject#getStringProperty - @​matthiasblaesing.
  • #​871: Fix mapping of libc function gethostname, sethostname, getdomainname and setdomainname and bind com.sun.jna.platform.win32.Winsock2.gethostname(byte[], int) - @​matthiasblaesing.
  • #​876: Restore java 6 compatibility - @​matthiasblaesing.
  • #​882: Correctly close file in ELFAnalyser#runDetection, fix suggested by @​Sylvyrfysh in #​880 - @​matthiasblaesing.
  • #​887: MacFileUtils.moveToTrash() doesn't work in a sandboxed app fix suggested by @​sobakasu - @​matthiasblaesing.
  • #​894: NullPointerException can be caused by calling com.sun.jna.platform.win32.COM.util.ProxyObject#dispose multiple times - @​matthiasblaesing.
  • #​925: Optimize Structure#validate and prevent ArrayIndexOutOfBoundsException in SAFEARRAY#read for zero dimensions - @​matthiasblaesing.
  • #​340: Guard registry handling against out-of-bounds reads by ensuring all read strings are NULL terminated - @​matthiasblaesing.
  • #​902: Allow building JNA on JDK 10. javah
    was removed from the JDK and javac is now used to create the necessary headers.
    JNA now has JDK 8 as the minimum build version, at runtime Java 6 is the minimum version.

    Native code for platforms with a JDK version lower than 8 can still be build by (demonstrated for Solaris x86):
    1. Run `ant -Dbuild.os.name=SunOS -Dbuild.os.arch=x86 native-build-package`
    2. Transfer the `build/build-package-sunos-x86-5.2.1.zip` file to the target system. The file holds the native sources, the necessary headers and and a shell script for the build.
    3. Expand the zip on the target system.
    4. Setup `JAVA_HOME` to point to the JDK sources.
    5. Change into the expanded directory and run `bash build.sh`.
    6. The resulting `sunos-x86.jar` is copied back to the original build system to `lib/native/sunos-x86.jar`
    - [@​matthiasblaesing](https://togithub.com/matthiasblaesing).
  • #​958: Update for PR 863: Old toolchains produce binaries without hard-/softfloat markers. Rasbian is missing the markers and the oracle JDK is also affected. For hardfloat detection now also the Arm EABI section is also considered - @​matthiasblaesing.
  • #​974: If the callback code failed to attach to the JVM, this lead to a segfault. The success of attaching to the JVM was checked to late and an invalid JNIEnv pointer was used to access the JVM - @​matthiasblaesing.
  • #​1010: Fix binding of lpAccessName parameter of com.sun.jna.platform.win32.Mpr#WNetUseConnection - @​matthiasblaesing.
  • #​384: Switch default value for jna.nosys to true. By default then the embedded native library is used - @​matthiasblaesing.

Breaking Changes

  • com.sun.jna.Pointer#SIZE is removed. Its use is replaced by com.sun.jna.Native#POINTER_SIZE
    to prevent a class loading deadlock, when JNA is initialized from multiple threads
  • com.sun.jna.Pointer#getString(long offset, boolean wide) is removed. It was replaced by
    com.sun.jna.Pointer#getString(long offset) or
    com.sun.jna.Pointer#getWideString(long offset)
  • com.sun.jna.Pointer#getStringArray(long offset, boolean wide) is removed. It was replaced by
    com.sun.jna.Pointer#getStringArray(long offset) or
    com.sun.jna.Pointer#getWideStringArray(long offset)
  • com.sun.jna.Pointer#setString(long offset, String value, boolean wide) is removed. It was replaced by
    com.sun.jna.Pointer#setString(long offset, String value) or
    com.sun.jna.Pointer#setWideString(long offset, String value)
  • com.sun.jna.Structure#setFieldOrder is removed. It was replaced by
    com.sun.jna.Structure#getFieldOrder and threw an java.lang.Error on call.
  • com.sun.jna.Native#parseVersion was removed without replacement
  • com.sun.jna.Native#setPreserveLastError and com.sun.jna.Native#getPreserveLastError
    were removed without replacement. They were turned into NOOPs in the past.
  • com.sun.jna.Native#getDirectByteBuffer was replaced by com.sun.jna.Pointer#getByteBuffer
  • the parameters of the methods gethostname, sethostname, getdomainname
    and setdomainname in the interface com.sun.jna.platform.unix.LibCAPI
    were changed from (char[] name, int len) to (byte[] name, int len)
  • com.sun.jna.Platform#isAix was replaced by com.sun.jna.Platform#isAIX
  • com.sun.jna.platform.win32.Sspi.SecBufferDesc was incompatibly changed to
    match the correct native semantics. SecBufferDesc describing more than one
    buffer were broken. For most usecases
    com.sun.jna.platform.win32.SspiUtil.ManagedSecBufferDesc is the best
    alternative.
  • com.sun.jna.platform.win32.WinBase.FILETIME#toLong() was replaced by
    com.sun.jna.platform.win32.WinBase.FILETIME#toTime()
  • com.sun.jna.platform.win32.Variant#COM_DAYS_ADJUSTMENT was removed
  • com.sun.jna.platform.win32.Variant#MICRO_SECONDS_PER_DAY was removed
  • com.sun.jna.platform.win32.Variant.VARIANT#toJavaDate was removed
  • com.sun.jna.platform.win32.Variant.VARIANT#fromJavaDate was removed
  • com.sun.jna.platform.win32.User32#MonitorFromPoint(Point pt, int dwFlags)
    was replaced by
    com.sun.jna.platform.win32.User32#MonitorFromPoint(Point.ByValue pt, int dwFlags)
  • com.sun.jna.platform.win32.OleAuto.LoadTypeLib(WString, PointerByReference)
    was replaced by
    com.sun.jna.platform.win32.OleAuto.LoadTypeLib(String, PointerByReference)
  • com.sun.jna.platform.win32.Kernel32Util.formatMessageFromHR(HRESULT)
    was replaced by
    com.sun.jna.platform.win32.Kernel32Util.formatMessage(HRESULT)
  • com.sun.jna.platform.win32.COM.COMException was structurally modified. The
    pExcepInfo and puArgErr members were removed and hresult member was added.
    The now missing information in COMException was moved to COMInvokeException.
  • The third parameter of com.sun.jna.platform.win32.COM.IShellFolder#GetDisplayNameOf
    was changed from PointerByReference to STRRET and matching this,
    the first parameter of com.sun.jna.platform.win32.Shlwapi.StrRetToStr was
    changed identically.
  • ACE_HEADER replaces ACEStructure as the base class for ACEs.
    com.sun.jna.platform.win32.WinNT.ACL was modified to support ACLS, that contain
    ACEs other than ACCESS_ALLOWED_ACE_TYPE and ACCESS_DENIED_ACE_TYPE by
    widening the return type of getACEStructures to ACE_HEADER[] and renaming
    the method to getACEs. In
    consequence com.sun.jna.platform.win32.Advapi32Util#getFileSecurity was
    changed similarly. The SID accessors getSidString and getSID were moved
    from ACEStructure to ACCESS_ACEStructure.
  • com.sun.jna.platform.win32.Ole32#CoCreateGuid(GUID.ByReference pguid) was replaced by
    com.sun.jna.platform.win32.Ole32#CoCreateGuid(GUID pguid) and
    com.sun.jna.platform.win32.Ole32#CLSIDFromString(WString lpsz, CLSID.ByReference pclsid) was replaced by
    com.sun.jna.platform.win32.Ole32#CLSIDFromString(String lpsz, CLSID.ByReference pclsid)

v4.5.2

Compare Source

v4.5.1

Compare Source

v4.5.0

Compare Source

=============

Features

  • #​774: Addition win32 api : SendMessage, GetActiveWindow, COPYDATASTRUCT and a few constants + a demo application - @​cnico.
  • #​783: Add Ole32 functions: OleBuildVersion, OleInitialize, OleUninitialize, OleFlushClipboard, OleRun, add VARIANT conversion functions to OleAuto, add default locale, LCID and LANG to WinNT - @​matthiasblaesing.
  • #​784: Added Solaris Kstat library - @​dbwiddis.
  • #​805: Provide a way to pass JNIEnv pointer to native method and support OPTION_ALLOW_OBJECTs for direct mapping - @​ncruces.
  • #​816: Support boolean[] in direct mapping - @​ncruces.
  • #​827: Add support for linux-mips64el - @​all7.
  • #​845: Add support for linux-s390x - @​matthiasblaesing.
  • #​771: Rebuild native libraries for linux-x86 and linux-x86-64 with an against an older GLIBC (minimum version of glibc for these architectures is now 2.7) - @​matthiasblaesing.
  • #​821: Move windows service related functions and structures in ntservice sample project to com.sun.jna.platform.win32.Advapi32: StartServiceCtrlDispatcher, RegisterServiceCtrlHandler, RegisterServiceCtrlHandlerEx, SetServiceStatus, CreateService, DeleteService and com.sun.jna.platform.win32.Winsvc: Handler, HandlerEx, SERVICE_MAIN_FUNCTION, SERVICE_TABLE_ENTRY, SERVICE_DESCRIPTION, SERVICE_STATUS_HANDLE - @​matthiasblaesing.

Bug Fixes


  • If you want to rebase/retry this PR, check this box

@mend-for-github-com mend-for-github-com bot added the security fix Security fix generated by WhiteSource label Nov 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
security fix Security fix generated by WhiteSource
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

0 participants