From: Jens Steube Date: Tue, 12 Jul 2016 10:02:14 +0000 (+0200) Subject: Merge branch 'master' of https://github.com/hashcat/hashcat X-Git-Url: https://www.flypig.org.uk/git/?a=commitdiff_plain;h=752e548f4e696ab7bd09c301bff2729e200b2dac;hp=-c;p=hashcat.git Merge branch 'master' of https://github.com/hashcat/hashcat --- 752e548f4e696ab7bd09c301bff2729e200b2dac diff --combined src/hashcat.c index 0158b81,c45ede9..9d4299e --- a/src/hashcat.c +++ b/src/hashcat.c @@@ -6147,6 -6147,22 +6147,22 @@@ int main (int argc, char **argv umask (077); + /** + * There's some buggy OpenCL runtime that do not support -I. + * A workaround is to chdir() to the OpenCL folder, + * then compile the kernels, + * then chdir() back to where we came from so we need to save it first + */ + + char cwd[1024]; + + if (getcwd (cwd, sizeof (cwd) - 1) == NULL) + { + log_error ("ERROR: getcwd(): %s", strerror (errno)); + + return -1; + } + /** * Real init */ @@@ -14260,7 -14276,6 +14276,7 @@@ } if (platform_skipped == 1) continue; + if (platform_skipped == 2) continue; for (uint platform_devices_id = 0; platform_devices_id < platform_devices_cnt; platform_devices_id++) { @@@ -16141,17 -16156,20 +16157,20 @@@ "inc_vendor.cl", }; - for (int i = 0; i < files_cnt; i++) + if (chdir (cpath_real) == -1) { - char path[1024] = { 0 }; + log_error ("ERROR: %s: %s", cpath_real, strerror (errno)); - snprintf (path, sizeof (path) - 1, "%s/%s", cpath_real, files_names[i]); + return -1; + } - FILE *fd = fopen (path, "r"); + for (int i = 0; i < files_cnt; i++) + { + FILE *fd = fopen (files_names[i], "r"); if (fd == NULL) { - log_error ("ERROR: %s: fopen(): %s", path, strerror (errno)); + log_error ("ERROR: %s: fopen(): %s", files_names[i], strerror (errno)); return -1; } @@@ -16162,7 -16180,7 +16181,7 @@@ if (n != 1) { - log_error ("ERROR: %s: fread(): %s", path, strerror (errno)); + log_error ("ERROR: %s: fread(): %s", files_names[i], strerror (errno)); return -1; } @@@ -16719,6 -16737,15 +16738,15 @@@ local_free (kernel_sources); } + // return back to the folder we came from initially (workaround) + + if (chdir (cwd) == -1) + { + log_error ("ERROR: %s: %s", cwd, strerror (errno)); + + return -1; + } + // some algorithm collide too fast, make that impossible if (benchmark == 1)