pdfsam icon indicating copy to clipboard operation
pdfsam copied to clipboard

The tarball for the free version contains jars with irregular ownership

Open dtonhofer opened this issue 2 years ago • 0 comments

Thank you for the excellent program (but why mix politics about the Ukrainian civil war into it?)

Problem:

If we download the tarball pdfsam-basic-4.3.1.jar and it install the content under /usr/local/pdfsam (say), then change ownership to "root" uniformly, it turns out that the permissions of the unpacked jars, third-party or otherwise, is irregular in that some are not world-readable:

rw-rw-r--. 1 root root 1482064 Apr 21 15:04 javafx-media-17.0.2-linux.jar
-rw-rw----. 1 root root    2497 Dec 15  2018 javax.inject-1.jar
-rw-rw-r--. 1 root root   16555 Mar  3 17:24 jcl-over-slf4j-1.7.36.jar
-rw-rw-r--. 1 root root  231851 Mar 28 15:01 logback-classic-1.2.11.jar
-rw-rw-r--. 1 root root  448764 Mar 28 15:01 logback-core-1.2.11.jar
-rw-rw-r--. 1 root root  732543 May 29 18:03 metadata-extractor-2.18.0.jar
-rw-rw-r--. 1 root root   11218 Jun 25 10:58 pdfsam-alternate-mix-4.3.1.jar

This means that pdfsam is non-executable for the non-root user of the machine.

Starting pdfsam (while taking care to erase JAVA_HOME and CLASSPATH environment variables) yields:

$ env --unset=JAVA_HOME --unset=CLASSPATH /usr/local/pdfsam/pdfsam-4.3.1-linux/bin/pdfsam.sh 
Jun 27, 2022 12:22:59 AM com.sun.javafx.application.PlatformImpl startup
WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @5d4f5fbf'
INFO  00:23:00.277 o.p.PdfsamApp[JavaFX-Launcher] Starting PDFsam
Exception in Application start method
Exception in Application stop method
Exception in thread "main" java.lang.RuntimeException: Exception in Application start method
        at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:901)
        at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:196)
        at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: javax/inject/Provider
        at org.pdfsam.injector.Injector.<init>(Injector.java:116)
        at org.pdfsam.injector.Injector.start(Injector.java:105)
        at org.pdfsam.PdfsamApp.initInjector(PdfsamApp.java:189)
        at org.pdfsam.PdfsamApp.start(PdfsamApp.java:159)
        at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:847)
        at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:484)
        at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:457)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:456)
        at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
        at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
        at com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:290)
        ... 1 more
Caused by: java.lang.ClassNotFoundException: javax.inject.Provider
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
        at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
        ... 13 more

Of course this is easily fixed:

chmod 644 /usr/local/pdfsam/pdfsam/lib/*

And we are good to go. Nevertheless, the tarball should contain jarfiles with permission 644 uniformly.

dtonhofer avatar Jun 26 '22 22:06 dtonhofer