mirror of
https://github.com/vanhauser-thc/thc-hydra.git
synced 2025-08-19 21:03:52 -07:00
xhydra: Fix various global declarations
More -fno-common fixes: - Rename HYDRA_BIN to hydra_bin so it does not get confused for a macro - support.h: Declare some variables as extern - main.c: Define same variables here
This commit is contained in:
parent
c643e4646e
commit
9f3913c4c0
3 changed files with 14 additions and 14 deletions
|
@ -66,7 +66,7 @@ int hydra_get_options(char *options[]) {
|
|||
gchar *tmp;
|
||||
GString *a;
|
||||
|
||||
options[0] = HYDRA_BIN;
|
||||
options[0] = hydra_bin;
|
||||
|
||||
/* get the port */
|
||||
widget = lookup_widget(GTK_WIDGET(wndMain), "spnPort");
|
||||
|
@ -599,7 +599,7 @@ int *popen_re_unbuffered(char *command) {
|
|||
|
||||
(void) hydra_get_options(options);
|
||||
|
||||
execv(HYDRA_BIN, options);
|
||||
execv(hydra_bin, options);
|
||||
|
||||
g_warning("%s %i: popen_rw_unbuffered: execv() returned", __FILE__, __LINE__);
|
||||
|
||||
|
|
|
@ -17,12 +17,12 @@
|
|||
char *hydra_path1 = "./hydra";
|
||||
char *hydra_path2 = "/usr/local/bin/hydra";
|
||||
char *hydra_path3 = "/usr/bin/hydra";
|
||||
|
||||
char *hydra_bin;
|
||||
GtkWidget *wndMain;
|
||||
guint message_id;
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
extern GtkWidget *wndMain;
|
||||
int i;
|
||||
extern guint message_id;
|
||||
GtkWidget *output;
|
||||
GtkTextBuffer *outputbuf;
|
||||
|
||||
|
@ -35,22 +35,22 @@ int main(int argc, char *argv[]) {
|
|||
message_id = 0;
|
||||
|
||||
/* locate the hydra binary */
|
||||
HYDRA_BIN = NULL;
|
||||
hydra_bin = NULL;
|
||||
for (i = 0; i < argc - 1; i++) {
|
||||
if (!strcmp(argv[i], "--hydra-path")) {
|
||||
HYDRA_BIN = argv[i + 1];
|
||||
hydra_bin = argv[i + 1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ((HYDRA_BIN != NULL) && (g_file_test(HYDRA_BIN, G_FILE_TEST_IS_EXECUTABLE))) {
|
||||
if ((hydra_bin != NULL) && (g_file_test(hydra_bin, G_FILE_TEST_IS_EXECUTABLE))) {
|
||||
/* just for obfuscation *g* */
|
||||
} else if (g_file_test(hydra_path1, G_FILE_TEST_IS_EXECUTABLE)) {
|
||||
HYDRA_BIN = hydra_path1;
|
||||
hydra_bin = hydra_path1;
|
||||
} else if (g_file_test(hydra_path2, G_FILE_TEST_IS_EXECUTABLE)) {
|
||||
HYDRA_BIN = hydra_path2;
|
||||
hydra_bin = hydra_path2;
|
||||
} else if (g_file_test(hydra_path3, G_FILE_TEST_IS_EXECUTABLE)) {
|
||||
HYDRA_BIN = hydra_path3;
|
||||
hydra_bin = hydra_path3;
|
||||
} else {
|
||||
g_error("Please tell me where hydra is, use --hydra-path\n");
|
||||
return -1;
|
||||
|
|
|
@ -40,6 +40,6 @@ GdkPixbuf *create_pixbuf(const gchar * filename);
|
|||
void glade_set_atk_action_description(AtkAction * action, const gchar * action_name, const gchar * description);
|
||||
|
||||
|
||||
GtkWidget *wndMain;
|
||||
char *HYDRA_BIN;
|
||||
guint message_id;
|
||||
extern GtkWidget *wndMain;
|
||||
extern char *hydra_bin;
|
||||
extern guint message_id;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue