diff options
Diffstat (limited to 'src/main/java/org/openslx/taskmanager/tasks/DownloadFile.java')
-rw-r--r-- | src/main/java/org/openslx/taskmanager/tasks/DownloadFile.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main/java/org/openslx/taskmanager/tasks/DownloadFile.java b/src/main/java/org/openslx/taskmanager/tasks/DownloadFile.java index 1129200..dc36cfc 100644 --- a/src/main/java/org/openslx/taskmanager/tasks/DownloadFile.java +++ b/src/main/java/org/openslx/taskmanager/tasks/DownloadFile.java @@ -6,7 +6,6 @@ import java.io.FileOutputStream; import java.io.IOException; import java.net.URL; import java.net.URLConnection; -import java.nio.charset.StandardCharsets; import org.apache.commons.io.FileUtils; import org.apache.commons.io.FilenameUtils; @@ -78,7 +77,7 @@ public class DownloadFile extends AbstractTask } fout.close(); // If we have a gpg sig, validate - if ( this.gpg != null ) { + if ( this.gpg != null && !this.gpg.isEmpty() ) { File gpgTempFile = null; try { gpgTempFile = File.createTempFile( "bwlp-", ".gpg", null ); @@ -87,8 +86,8 @@ public class DownloadFile extends AbstractTask status.error = "Could not create temporary file for gpg signature"; return false; } - if ( 0 != Exec.sync( "gpg", "--homedir", "/opt/openslx/gpg", "--verify", gpgTempFile.getAbsolutePath(), tmpFile.getAbsolutePath() ) ) { - status.error = "GPG signature of downloaded file not valid!"; + if ( 0 != Exec.sync( "gpg", "--verify", gpgTempFile.getAbsolutePath(), tmpFile.getAbsolutePath() ) ) { + status.error = "GPG signature of downloaded file not valid!\n\n" + this.gpg; return false; } gpgTempFile.delete(); |