diff options
author | tg(x) <*@tg-x.net> | 2017-02-24 20:10:46 +0100 |
---|---|---|
committer | tg(x) <*@tg-x.net> | 2017-02-24 20:10:46 +0100 |
commit | b7002d3f8016478d716236238bd43a7c06c924d2 (patch) | |
tree | 3a37e4ffc3dfbb53c7dd571b85126ec762ffbbae /src/util | |
parent | cb1165ecfc5c89c22aa4a6fffb72e27e0bde43a3 (diff) | |
parent | fa0b5c44f096a68ac0a51c4cbb37c920ceb36bce (diff) | |
download | gnunet-b7002d3f8016478d716236238bd43a7c06c924d2.tar.gz gnunet-b7002d3f8016478d716236238bd43a7c06c924d2.zip |
Merge branch 'master' of gnunet.org:gnunet
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/mq.c | 3 | ||||
-rw-r--r-- | src/util/os_installation.c | 49 | ||||
-rw-r--r-- | src/util/service_new.c | 7 |
3 files changed, 44 insertions, 15 deletions
diff --git a/src/util/mq.c b/src/util/mq.c index a8216d964..71619bda4 100644 --- a/src/util/mq.c +++ b/src/util/mq.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2012-2014 GNUnet e.V. | 3 | Copyright (C) 2012-2017 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -362,6 +362,7 @@ GNUNET_MQ_send (struct GNUNET_MQ_Handle *mq, | |||
362 | GNUNET_assert (NULL == ev->parent_queue); | 362 | GNUNET_assert (NULL == ev->parent_queue); |
363 | 363 | ||
364 | mq->queue_length++; | 364 | mq->queue_length++; |
365 | GNUNET_break (mq->queue_length < 10000); /* This would seem like a bug... */ | ||
365 | ev->parent_queue = mq; | 366 | ev->parent_queue = mq; |
366 | /* is the implementation busy? queue it! */ | 367 | /* is the implementation busy? queue it! */ |
367 | if ( (NULL != mq->current_envelope) || | 368 | if ( (NULL != mq->current_envelope) || |
diff --git a/src/util/os_installation.c b/src/util/os_installation.c index caceeea0c..1226c5966 100644 --- a/src/util/os_installation.c +++ b/src/util/os_installation.c | |||
@@ -823,9 +823,13 @@ GNUNET_OS_check_helper_binary (const char *binary, | |||
823 | #ifdef MINGW | 823 | #ifdef MINGW |
824 | char *binaryexe; | 824 | char *binaryexe; |
825 | 825 | ||
826 | GNUNET_asprintf (&binaryexe, "%s.exe", binary); | 826 | GNUNET_asprintf (&binaryexe, |
827 | if ( (GNUNET_YES == GNUNET_STRINGS_path_is_absolute (binaryexe, GNUNET_NO, | 827 | "%s.exe", |
828 | NULL, NULL)) || | 828 | binary); |
829 | if ( (GNUNET_YES == | ||
830 | GNUNET_STRINGS_path_is_absolute (binaryexe, | ||
831 | GNUNET_NO, | ||
832 | NULL, NULL)) || | ||
829 | (0 == strncmp (binary, "./", 2)) ) | 833 | (0 == strncmp (binary, "./", 2)) ) |
830 | p = GNUNET_strdup (binaryexe); | 834 | p = GNUNET_strdup (binaryexe); |
831 | else | 835 | else |
@@ -840,16 +844,24 @@ GNUNET_OS_check_helper_binary (const char *binary, | |||
840 | } | 844 | } |
841 | GNUNET_free (binaryexe); | 845 | GNUNET_free (binaryexe); |
842 | #else | 846 | #else |
843 | if ( (GNUNET_YES == GNUNET_STRINGS_path_is_absolute (binary, GNUNET_NO, | 847 | if ( (GNUNET_YES == |
844 | NULL, NULL)) || | 848 | GNUNET_STRINGS_path_is_absolute (binary, |
849 | GNUNET_NO, | ||
850 | NULL, | ||
851 | NULL)) || | ||
845 | (0 == strncmp (binary, "./", 2)) ) | 852 | (0 == strncmp (binary, "./", 2)) ) |
853 | { | ||
846 | p = GNUNET_strdup (binary); | 854 | p = GNUNET_strdup (binary); |
855 | } | ||
847 | else | 856 | else |
848 | { | 857 | { |
849 | p = get_path_from_PATH (binary); | 858 | p = get_path_from_PATH (binary); |
850 | if (NULL != p) | 859 | if (NULL != p) |
851 | { | 860 | { |
852 | GNUNET_asprintf (&pf, "%s/%s", p, binary); | 861 | GNUNET_asprintf (&pf, |
862 | "%s/%s", | ||
863 | p, | ||
864 | binary); | ||
853 | GNUNET_free (p); | 865 | GNUNET_free (p); |
854 | p = pf; | 866 | p = pf; |
855 | } | 867 | } |
@@ -862,9 +874,12 @@ GNUNET_OS_check_helper_binary (const char *binary, | |||
862 | binary); | 874 | binary); |
863 | return GNUNET_SYSERR; | 875 | return GNUNET_SYSERR; |
864 | } | 876 | } |
865 | if (0 != ACCESS (p, X_OK)) | 877 | if (0 != ACCESS (p, |
878 | X_OK)) | ||
866 | { | 879 | { |
867 | LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "access", p); | 880 | LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, |
881 | "access", | ||
882 | p); | ||
868 | GNUNET_free (p); | 883 | GNUNET_free (p); |
869 | return GNUNET_SYSERR; | 884 | return GNUNET_SYSERR; |
870 | } | 885 | } |
@@ -873,22 +888,30 @@ GNUNET_OS_check_helper_binary (const char *binary, | |||
873 | { | 888 | { |
874 | /* as we run as root, we don't insist on SUID */ | 889 | /* as we run as root, we don't insist on SUID */ |
875 | GNUNET_free (p); | 890 | GNUNET_free (p); |
876 | return GNUNET_OK; | 891 | return GNUNET_YES; |
877 | } | 892 | } |
878 | #endif | 893 | #endif |
879 | if (0 != STAT (p, &statbuf)) | 894 | if (0 != STAT (p, |
895 | &statbuf)) | ||
880 | { | 896 | { |
881 | LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "stat", p); | 897 | LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, |
898 | "stat", | ||
899 | p); | ||
882 | GNUNET_free (p); | 900 | GNUNET_free (p); |
883 | return GNUNET_SYSERR; | 901 | return GNUNET_SYSERR; |
884 | } | 902 | } |
885 | if (check_suid){ | 903 | if (check_suid) |
904 | { | ||
886 | #ifndef MINGW | 905 | #ifndef MINGW |
887 | if ((0 != (statbuf.st_mode & S_ISUID)) && (0 == statbuf.st_uid)) | 906 | if ( (0 != (statbuf.st_mode & S_ISUID)) && |
907 | (0 == statbuf.st_uid) ) | ||
888 | { | 908 | { |
889 | GNUNET_free (p); | 909 | GNUNET_free (p); |
890 | return GNUNET_YES; | 910 | return GNUNET_YES; |
891 | } | 911 | } |
912 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | ||
913 | _("Binary `%s' exists, but is not SUID\n"), | ||
914 | p); | ||
892 | /* binary exists, but not SUID */ | 915 | /* binary exists, but not SUID */ |
893 | #else | 916 | #else |
894 | STARTUPINFO start; | 917 | STARTUPINFO start; |
diff --git a/src/util/service_new.c b/src/util/service_new.c index a832b070c..987fb1c3b 100644 --- a/src/util/service_new.c +++ b/src/util/service_new.c | |||
@@ -1996,8 +1996,9 @@ service_mq_send (struct GNUNET_MQ_Handle *mq, | |||
1996 | { | 1996 | { |
1997 | struct GNUNET_SERVICE_Client *client = impl_state; | 1997 | struct GNUNET_SERVICE_Client *client = impl_state; |
1998 | 1998 | ||
1999 | if (NULL != client->drop_task) | ||
2000 | return; /* we're going down right now, do not try to send */ | ||
1999 | GNUNET_assert (NULL == client->send_task); | 2001 | GNUNET_assert (NULL == client->send_task); |
2000 | GNUNET_assert (NULL == client->drop_task); | ||
2001 | client->msg = msg; | 2002 | client->msg = msg; |
2002 | client->msg_pos = 0; | 2003 | client->msg_pos = 0; |
2003 | client->send_task | 2004 | client->send_task |
@@ -2466,6 +2467,10 @@ finish_client_drop (void *cls) | |||
2466 | struct GNUNET_SERVICE_Client *c = cls; | 2467 | struct GNUNET_SERVICE_Client *c = cls; |
2467 | struct GNUNET_SERVICE_Handle *sh = c->sh; | 2468 | struct GNUNET_SERVICE_Handle *sh = c->sh; |
2468 | 2469 | ||
2470 | c->drop_task = NULL; | ||
2471 | GNUNET_assert (NULL == c->send_task); | ||
2472 | GNUNET_assert (NULL == c->recv_task); | ||
2473 | GNUNET_assert (NULL == c->warn_task); | ||
2469 | GNUNET_MST_destroy (c->mst); | 2474 | GNUNET_MST_destroy (c->mst); |
2470 | GNUNET_MQ_destroy (c->mq); | 2475 | GNUNET_MQ_destroy (c->mq); |
2471 | if (GNUNET_NO == c->persist) | 2476 | if (GNUNET_NO == c->persist) |