diff options
57 files changed, 307 insertions, 328 deletions
@@ -46,6 +46,7 @@ These are the direct dependencies for running GNUnet: | |||
46 | - libunistring >= 0.9.2 | 46 | - libunistring >= 0.9.2 |
47 | - gnutls >= 2.12.0 | 47 | - gnutls >= 2.12.0 |
48 | - libidn >= 1.0 | 48 | - libidn >= 1.0 |
49 | - libglpk >= 4.45 | ||
49 | - openssl >= 1.0 (binary, used to generate X.509 certificate) | 50 | - openssl >= 1.0 (binary, used to generate X.509 certificate) |
50 | - libltdl >= 2.2 (part of GNU libtool) | 51 | - libltdl >= 2.2 (part of GNU libtool) |
51 | - sqlite >= 3.8 (default database, required) | 52 | - sqlite >= 3.8 (default database, required) |
diff --git a/src/arm/arm.conf.in b/src/arm/arm.conf.in index b9a33242f..1b079c98c 100644 --- a/src/arm/arm.conf.in +++ b/src/arm/arm.conf.in | |||
@@ -2,7 +2,6 @@ | |||
2 | [arm] | 2 | [arm] |
3 | @UNIXONLY@ PORT = 2087 | 3 | @UNIXONLY@ PORT = 2087 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | HOME = $SERVICEHOME | ||
6 | BINARY = gnunet-service-arm | 5 | BINARY = gnunet-service-arm |
7 | ACCEPT_FROM = 127.0.0.1; | 6 | ACCEPT_FROM = 127.0.0.1; |
8 | ACCEPT_FROM6 = ::1; | 7 | ACCEPT_FROM6 = ::1; |
@@ -16,7 +15,7 @@ UNIX_MATCH_GID = YES | |||
16 | # service. Thus the following option would introduce per-service | 15 | # service. Thus the following option would introduce per-service |
17 | # logging with a new log file each day. Note that only the last 3 | 16 | # logging with a new log file each day. Note that only the last 3 |
18 | # log files are preserved. | 17 | # log files are preserved. |
19 | # GLOBAL_POSTFIX = -l $SERVICEHOME/{}-%Y-%m-%d.log | 18 | # GLOBAL_POSTFIX = -l $GNUNET_CACHE_HOME/{}-%Y-%m-%d.log |
20 | GLOBAL_PREFIX = @MONKEYPREFIX@ | 19 | GLOBAL_PREFIX = @MONKEYPREFIX@ |
21 | # USERNAME = | 20 | # USERNAME = |
22 | # MAXBUF = | 21 | # MAXBUF = |
diff --git a/src/arm/gnunet-arm.c b/src/arm/gnunet-arm.c index 80d3e9c03..a492fac5b 100644 --- a/src/arm/gnunet-arm.c +++ b/src/arm/gnunet-arm.c | |||
@@ -147,7 +147,7 @@ static unsigned int no_stderr; | |||
147 | 147 | ||
148 | 148 | ||
149 | /** | 149 | /** |
150 | * Attempts to delete configuration file and SERVICEHOME | 150 | * Attempts to delete configuration file and GNUNET_HOME |
151 | * on ARM shutdown provided the end and delete options | 151 | * on ARM shutdown provided the end and delete options |
152 | * were specified when gnunet-arm was run. | 152 | * were specified when gnunet-arm was run. |
153 | */ | 153 | */ |
@@ -158,15 +158,17 @@ delete_files () | |||
158 | "Will attempt to remove configuration file %s and service directory %s\n", | 158 | "Will attempt to remove configuration file %s and service directory %s\n", |
159 | config_file, dir); | 159 | config_file, dir); |
160 | 160 | ||
161 | if (UNLINK (config_file) != 0) | 161 | if (0 != UNLINK (config_file)) |
162 | { | 162 | { |
163 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 163 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
164 | _("Failed to remove configuration file %s\n"), config_file); | 164 | _("Failed to remove configuration file %s\n"), |
165 | config_file); | ||
165 | } | 166 | } |
166 | if (GNUNET_DISK_directory_remove (dir) != GNUNET_OK) | 167 | if (GNUNET_OK != GNUNET_DISK_directory_remove (dir)) |
167 | { | 168 | { |
168 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 169 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
169 | _("Failed to remove servicehome directory %s\n"), dir); | 170 | _("Failed to remove servicehome directory %s\n"), |
171 | dir); | ||
170 | 172 | ||
171 | } | 173 | } |
172 | } | 174 | } |
@@ -192,8 +194,8 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
192 | GNUNET_ARM_monitor_disconnect_and_free (m); | 194 | GNUNET_ARM_monitor_disconnect_and_free (m); |
193 | m = NULL; | 195 | m = NULL; |
194 | } | 196 | } |
195 | if ((end == GNUNET_YES) && (delete == GNUNET_YES)) | 197 | if ((GNUNET_YES == end) && (GNUNET_YES == delete)) |
196 | delete_files (); | 198 | delete_files (); |
197 | GNUNET_CONFIGURATION_destroy (cfg); | 199 | GNUNET_CONFIGURATION_destroy (cfg); |
198 | cfg = NULL; | 200 | cfg = NULL; |
199 | } | 201 | } |
@@ -588,7 +590,7 @@ action_loop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
588 | if (list) | 590 | if (list) |
589 | { | 591 | { |
590 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 592 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
591 | "Going to list all running services controlled by ARM.\n"); | 593 | "Going to list all running services controlled by ARM.\n"); |
592 | GNUNET_ARM_request_service_list (h, | 594 | GNUNET_ARM_request_service_list (h, |
593 | (0 == timeout.rel_value_us) ? LIST_TIMEOUT : timeout, | 595 | (0 == timeout.rel_value_us) ? LIST_TIMEOUT : timeout, |
594 | &list_callback, &list); | 596 | &list_callback, &list); |
@@ -673,10 +675,10 @@ run (void *cls, | |||
673 | cfg = GNUNET_CONFIGURATION_dup (c); | 675 | cfg = GNUNET_CONFIGURATION_dup (c); |
674 | config_file = cfgfile; | 676 | config_file = cfgfile; |
675 | if (GNUNET_OK != | 677 | if (GNUNET_OK != |
676 | GNUNET_CONFIGURATION_get_value_string (cfg, "PATHS", "SERVICEHOME", &dir)) | 678 | GNUNET_CONFIGURATION_get_value_string (cfg, "PATHS", "GNUNET_HOME", &dir)) |
677 | { | 679 | { |
678 | GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, | 680 | GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, |
679 | "PATHS", "SERVICEHOME"); | 681 | "PATHS", "GNUNET_HOME"); |
680 | return; | 682 | return; |
681 | } | 683 | } |
682 | if (NULL != cfgfile) | 684 | if (NULL != cfgfile) |
diff --git a/src/arm/test_arm_api_data.conf b/src/arm/test_arm_api_data.conf index 157a03027..1f1ac282f 100644 --- a/src/arm/test_arm_api_data.conf +++ b/src/arm/test_arm_api_data.conf | |||
@@ -16,7 +16,6 @@ PORT = 23355 | |||
16 | AUTOSTART = NO | 16 | AUTOSTART = NO |
17 | PORT = 2223 | 17 | PORT = 2223 |
18 | HOSTNAME = localhost | 18 | HOSTNAME = localhost |
19 | HOME = $SERVICEHOME | ||
20 | BINARY = /will/be/overwritten/by/test_exponential_backoff | 19 | BINARY = /will/be/overwritten/by/test_exponential_backoff |
21 | ACCEPT_FROM = 127.0.0.1; | 20 | ACCEPT_FROM = 127.0.0.1; |
22 | ACCEPT_FROM6 = ::1; | 21 | ACCEPT_FROM6 = ::1; |
diff --git a/src/ats/ats.conf.in b/src/ats/ats.conf.in index 457e86c65..d5116304f 100644 --- a/src/ats/ats.conf.in +++ b/src/ats/ats.conf.in | |||
@@ -2,7 +2,6 @@ | |||
2 | AUTOSTART = YES | 2 | AUTOSTART = YES |
3 | @UNIXONLY@ PORT = 2098 | 3 | @UNIXONLY@ PORT = 2098 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | HOME = $SERVICEHOME | ||
6 | BINARY = gnunet-service-ats | 5 | BINARY = gnunet-service-ats |
7 | ACCEPT_FROM = 127.0.0.1; | 6 | ACCEPT_FROM = 127.0.0.1; |
8 | ACCEPT_FROM6 = ::1; | 7 | ACCEPT_FROM6 = ::1; |
diff --git a/src/ats/test_ats_api.conf b/src/ats/test_ats_api.conf index 5601a1227..8a1b6a14f 100644 --- a/src/ats/test_ats_api.conf +++ b/src/ats/test_ats_api.conf | |||
@@ -11,7 +11,6 @@ UNIXPATH = /tmp/test-ats-scheduling-arm.sock | |||
11 | AUTOSTART = YES | 11 | AUTOSTART = YES |
12 | PORT = 12002 | 12 | PORT = 12002 |
13 | HOSTNAME = localhost | 13 | HOSTNAME = localhost |
14 | HOME = $SERVICEHOME | ||
15 | BINARY = gnunet-service-ats | 14 | BINARY = gnunet-service-ats |
16 | ACCEPT_FROM = 127.0.0.1; | 15 | ACCEPT_FROM = 127.0.0.1; |
17 | ACCEPT_FROM6 = ::1; | 16 | ACCEPT_FROM6 = ::1; |
diff --git a/src/ats/test_ats_mlp.conf b/src/ats/test_ats_mlp.conf index f64c783f6..05e444f09 100644 --- a/src/ats/test_ats_mlp.conf +++ b/src/ats/test_ats_mlp.conf | |||
@@ -11,7 +11,6 @@ UNIXPATH = /tmp/test-ats-scheduling-arm.sock | |||
11 | AUTOSTART = YES | 11 | AUTOSTART = YES |
12 | PORT = 12002 | 12 | PORT = 12002 |
13 | HOSTNAME = localhost | 13 | HOSTNAME = localhost |
14 | HOME = $SERVICEHOME | ||
15 | BINARY = gnunet-service-ats | 14 | BINARY = gnunet-service-ats |
16 | ACCEPT_FROM = 127.0.0.1; | 15 | ACCEPT_FROM = 127.0.0.1; |
17 | ACCEPT_FROM6 = ::1; | 16 | ACCEPT_FROM6 = ::1; |
diff --git a/src/consensus/consensus.conf.in b/src/consensus/consensus.conf.in index 18e976deb..de526305c 100644 --- a/src/consensus/consensus.conf.in +++ b/src/consensus/consensus.conf.in | |||
@@ -2,7 +2,6 @@ | |||
2 | AUTOSTART = YES | 2 | AUTOSTART = YES |
3 | @UNIXONLY@ PORT = 2103 | 3 | @UNIXONLY@ PORT = 2103 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | HOME = $SERVICEHOME | ||
6 | BINARY = gnunet-service-consensus | 5 | BINARY = gnunet-service-consensus |
7 | ACCEPT_FROM = 127.0.0.1; | 6 | ACCEPT_FROM = 127.0.0.1; |
8 | ACCEPT_FROM6 = ::1; | 7 | ACCEPT_FROM6 = ::1; |
diff --git a/src/consensus/test_consensus.conf b/src/consensus/test_consensus.conf index bcfdaba0f..a59a1012a 100644 --- a/src/consensus/test_consensus.conf +++ b/src/consensus/test_consensus.conf | |||
@@ -2,7 +2,6 @@ | |||
2 | AUTOSTART = YES | 2 | AUTOSTART = YES |
3 | PORT = 2110 | 3 | PORT = 2110 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | HOME = $SERVICEHOME | ||
6 | BINARY = gnunet-service-consensus | 5 | BINARY = gnunet-service-consensus |
7 | #PREFIX = gdbserver :12345 | 6 | #PREFIX = gdbserver :12345 |
8 | #PREFIX = valgrind --leak-check=full | 7 | #PREFIX = valgrind --leak-check=full |
diff --git a/src/conversation/conversation.conf.in b/src/conversation/conversation.conf.in index f1efa03ba..b4386e80d 100644 --- a/src/conversation/conversation.conf.in +++ b/src/conversation/conversation.conf.in | |||
@@ -2,6 +2,5 @@ | |||
2 | AUTOSTART = YES | 2 | AUTOSTART = YES |
3 | BINARY = gnunet-service-conversation | 3 | BINARY = gnunet-service-conversation |
4 | UNIXPATH = /tmp/gnunet-service-conversation.sock | 4 | UNIXPATH = /tmp/gnunet-service-conversation.sock |
5 | HOME = $SERVICEHOME | ||
6 | @UNIXONLY@ PORT = 2106 | 5 | @UNIXONLY@ PORT = 2106 |
7 | 6 | ||
diff --git a/src/core/core.conf.in b/src/core/core.conf.in index 839c21eeb..f8e71957a 100644 --- a/src/core/core.conf.in +++ b/src/core/core.conf.in | |||
@@ -2,7 +2,6 @@ | |||
2 | AUTOSTART = YES | 2 | AUTOSTART = YES |
3 | @JAVAPORT@PORT = 2092 | 3 | @JAVAPORT@PORT = 2092 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | HOME = $SERVICEHOME | ||
6 | BINARY = gnunet-service-core | 5 | BINARY = gnunet-service-core |
7 | ACCEPT_FROM = 127.0.0.1; | 6 | ACCEPT_FROM = 127.0.0.1; |
8 | ACCEPT_FROM6 = ::1; | 7 | ACCEPT_FROM6 = ::1; |
@@ -21,4 +20,4 @@ UNIX_MATCH_GID = YES | |||
21 | 20 | ||
22 | # Note: this MUST be set to YES in production, only set to NO for testing | 21 | # Note: this MUST be set to YES in production, only set to NO for testing |
23 | # for performance (testbed/cluster-scale use!). | 22 | # for performance (testbed/cluster-scale use!). |
24 | USE_EPHEMERAL_KEYS = YES \ No newline at end of file | 23 | USE_EPHEMERAL_KEYS = YES |
diff --git a/src/core/test_core_api_send_to_self.conf b/src/core/test_core_api_send_to_self.conf index 704a2b6da..8df557226 100644 --- a/src/core/test_core_api_send_to_self.conf +++ b/src/core/test_core_api_send_to_self.conf | |||
@@ -20,7 +20,6 @@ UNIXPATH = /tmp/gnunet-p1-service-ats.sock | |||
20 | AUTOSTART = YES | 20 | AUTOSTART = YES |
21 | PORT = 9252 | 21 | PORT = 9252 |
22 | HOSTNAME = localhost | 22 | HOSTNAME = localhost |
23 | HOME = $SERVICEHOME | ||
24 | BINARY = test_core_api_send_to_self | 23 | BINARY = test_core_api_send_to_self |
25 | ACCEPT_FROM = 127.0.0.1; | 24 | ACCEPT_FROM = 127.0.0.1; |
26 | ACCEPT_FROM6 = ::1; | 25 | ACCEPT_FROM6 = ::1; |
diff --git a/src/datastore/datastore.conf.in b/src/datastore/datastore.conf.in index 7a92070d7..7d9efff6e 100644 --- a/src/datastore/datastore.conf.in +++ b/src/datastore/datastore.conf.in | |||
@@ -5,17 +5,16 @@ UNIX_MATCH_UID = NO | |||
5 | UNIX_MATCH_GID = YES | 5 | UNIX_MATCH_GID = YES |
6 | @UNIXONLY@ PORT = 2093 | 6 | @UNIXONLY@ PORT = 2093 |
7 | HOSTNAME = localhost | 7 | HOSTNAME = localhost |
8 | HOME = $SERVICEHOME | ||
9 | BINARY = gnunet-service-datastore | 8 | BINARY = gnunet-service-datastore |
10 | ACCEPT_FROM = 127.0.0.1; | 9 | ACCEPT_FROM = 127.0.0.1; |
11 | ACCEPT_FROM6 = ::1; | 10 | ACCEPT_FROM6 = ::1; |
12 | QUOTA = 5 GB | 11 | QUOTA = 5 GB |
13 | BLOOMFILTER = $SERVICEHOME/datastore/bloomfilter | 12 | BLOOMFILTER = $GNUNET_DATA_HOME/datastore/bloomfilter |
14 | DATABASE = sqlite | 13 | DATABASE = sqlite |
15 | # DISABLE_SOCKET_FORWARDING = NO | 14 | # DISABLE_SOCKET_FORWARDING = NO |
16 | 15 | ||
17 | [datastore-sqlite] | 16 | [datastore-sqlite] |
18 | FILENAME = $SERVICEHOME/datastore/sqlite.db | 17 | FILENAME = $GNUNET_DATA_HOME/datastore/sqlite.db |
19 | 18 | ||
20 | [datastore-postgres] | 19 | [datastore-postgres] |
21 | CONFIG = connect_timeout=10; dbname=gnunet | 20 | CONFIG = connect_timeout=10; dbname=gnunet |
@@ -24,7 +23,7 @@ CONFIG = connect_timeout=10; dbname=gnunet | |||
24 | DATABASE = gnunet | 23 | DATABASE = gnunet |
25 | CONFIG = ~/.my.cnf | 24 | CONFIG = ~/.my.cnf |
26 | # USER = gnunet | 25 | # USER = gnunet |
27 | # PASSWORD = | 26 | # PASSWORD = |
28 | # HOST = localhost | 27 | # HOST = localhost |
29 | # PORT = 3306 | 28 | # PORT = 3306 |
30 | 29 | ||
diff --git a/src/dht/dht.conf.in b/src/dht/dht.conf.in index 59c5bc1b7..7a9781a3a 100644 --- a/src/dht/dht.conf.in +++ b/src/dht/dht.conf.in | |||
@@ -2,7 +2,6 @@ | |||
2 | AUTOSTART = YES | 2 | AUTOSTART = YES |
3 | @JAVAPORT@PORT = 2095 | 3 | @JAVAPORT@PORT = 2095 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | HOME = $SERVICEHOME | ||
6 | BINARY = gnunet-service-dht | 5 | BINARY = gnunet-service-dht |
7 | ACCEPT_FROM = 127.0.0.1; | 6 | ACCEPT_FROM = 127.0.0.1; |
8 | ACCEPT_FROM6 = ::1; | 7 | ACCEPT_FROM6 = ::1; |
diff --git a/src/dns/dns.conf.in b/src/dns/dns.conf.in index 7944b410a..ee9a65302 100644 --- a/src/dns/dns.conf.in +++ b/src/dns/dns.conf.in | |||
@@ -1,7 +1,6 @@ | |||
1 | [dns] | 1 | [dns] |
2 | AUTOSTART = YES | 2 | AUTOSTART = YES |
3 | HOSTNAME = localhost | 3 | HOSTNAME = localhost |
4 | HOME = $SERVICEHOME | ||
5 | BINARY = gnunet-service-dns | 4 | BINARY = gnunet-service-dns |
6 | UNIXPATH = /tmp/gnunet-service-dns.sock | 5 | UNIXPATH = /tmp/gnunet-service-dns.sock |
7 | 6 | ||
diff --git a/src/dv/dv.conf.in b/src/dv/dv.conf.in index c0dc21bfd..65f54613a 100644 --- a/src/dv/dv.conf.in +++ b/src/dv/dv.conf.in | |||
@@ -3,7 +3,6 @@ AUTOSTART = YES | |||
3 | ACCEPT_FROM6 = ::1; | 3 | ACCEPT_FROM6 = ::1; |
4 | ACCEPT_FROM = 127.0.0.1; | 4 | ACCEPT_FROM = 127.0.0.1; |
5 | BINARY = gnunet-service-dv | 5 | BINARY = gnunet-service-dv |
6 | HOME = $SERVICEHOME | ||
7 | HOSTNAME = localhost | 6 | HOSTNAME = localhost |
8 | @UNIXONLY@ PORT = 2571 | 7 | @UNIXONLY@ PORT = 2571 |
9 | UNIXPATH = /tmp/gnunet-service-dv.sock | 8 | UNIXPATH = /tmp/gnunet-service-dv.sock |
diff --git a/src/experimentation/experimentation.conf.in b/src/experimentation/experimentation.conf.in index 6597dd0c1..5bfffad86 100644 --- a/src/experimentation/experimentation.conf.in +++ b/src/experimentation/experimentation.conf.in | |||
@@ -2,11 +2,10 @@ | |||
2 | AUTOSTART = NO | 2 | AUTOSTART = NO |
3 | # PORT = 2106 | 3 | # PORT = 2106 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | HOME = $SERVICEHOME | ||
6 | BINARY = gnunet-daemon-experimentation | 5 | BINARY = gnunet-daemon-experimentation |
7 | ACCEPT_FROM = 127.0.0.1; | 6 | ACCEPT_FROM = 127.0.0.1; |
8 | ACCEPT_FROM6 = ::1; | 7 | ACCEPT_FROM6 = ::1; |
9 | UNIXPATH = /tmp/gnunet-daemon-experimentation.sock | 8 | UNIXPATH = /tmp/gnunet-daemon-experimentation.sock |
10 | UNIX_MATCH_UID = YES | 9 | UNIX_MATCH_UID = YES |
11 | UNIX_MATCH_GID = YES | 10 | UNIX_MATCH_GID = YES |
12 | ISSUERS = TFRM29O2RQNKLVBQIGODJ6GD58LSQ2NM9TNFBC6N48BRJHQO38Q73N2OM3V4CLKDM6CILQV4CU8PMJDRG0FNB0PDI057DBRANMLPLRG \ No newline at end of file | 11 | ISSUERS = TFRM29O2RQNKLVBQIGODJ6GD58LSQ2NM9TNFBC6N48BRJHQO38Q73N2OM3V4CLKDM6CILQV4CU8PMJDRG0FNB0PDI057DBRANMLPLRG |
diff --git a/src/fs/fs.conf.in b/src/fs/fs.conf.in index 2375dc7ec..bb4cae99a 100644 --- a/src/fs/fs.conf.in +++ b/src/fs/fs.conf.in | |||
@@ -1,13 +1,11 @@ | |||
1 | [fs] | 1 | [fs] |
2 | AUTOSTART = YES | 2 | AUTOSTART = YES |
3 | INDEXDB = $SERVICEHOME/fs/idxinfo.lst | 3 | INDEXDB = $GNUNET_DATA_HOME/fs/idxinfo.lst |
4 | RESPECT = $SERVICEHOME/fs/credit/ | 4 | RESPECT = $GNUNET_DATA_HOME/fs/credit/ |
5 | IDENTITY_DIR = $SERVICEHOME/fs/identities/ | 5 | STATE_DIR = $GNUNET_DATA_HOME/fs/persistence/ |
6 | STATE_DIR = $SERVICEHOME/fs/persistence/ | 6 | UPDATE_DIR = $GNUNET_DATA_HOME/fs/updates/ |
7 | UPDATE_DIR = $SERVICEHOME/fs/updates/ | ||
8 | @UNIXONLY@ PORT = 2094 | 7 | @UNIXONLY@ PORT = 2094 |
9 | HOSTNAME = localhost | 8 | HOSTNAME = localhost |
10 | HOME = $SERVICEHOME | ||
11 | BINARY = gnunet-service-fs | 9 | BINARY = gnunet-service-fs |
12 | ACCEPT_FROM = 127.0.0.1; | 10 | ACCEPT_FROM = 127.0.0.1; |
13 | ACCEPT_FROM6 = ::1; | 11 | ACCEPT_FROM6 = ::1; |
@@ -24,7 +22,7 @@ CONTENT_PUSHING = YES | |||
24 | 22 | ||
25 | UNIXPATH = /tmp/gnunet-service-fs.sock | 23 | UNIXPATH = /tmp/gnunet-service-fs.sock |
26 | 24 | ||
27 | # Do we require users that want to access file-sharing to run this process | 25 | # Do we require users that want to access file-sharing to run this process |
28 | # (usually not a good idea) | 26 | # (usually not a good idea) |
29 | UNIX_MATCH_UID = NO | 27 | UNIX_MATCH_UID = NO |
30 | 28 | ||
@@ -40,7 +38,7 @@ MAX_PENDING_REQUESTS = 65536 | |||
40 | DATASTORE_QUEUE_SIZE = 1024 | 38 | DATASTORE_QUEUE_SIZE = 1024 |
41 | 39 | ||
42 | # Maximum frequency we're allowed to poll the datastore | 40 | # Maximum frequency we're allowed to poll the datastore |
43 | # for content for migration (can be used to reduce | 41 | # for content for migration (can be used to reduce |
44 | # GNUnet's disk-IO rate) | 42 | # GNUnet's disk-IO rate) |
45 | MIN_MIGRATION_DELAY = 100 ms | 43 | MIN_MIGRATION_DELAY = 100 ms |
46 | 44 | ||
@@ -65,4 +63,4 @@ BINARY = gnunet-auto-share | |||
65 | 63 | ||
66 | # Note: MUST specify path to auto-share directory and CAN specify other options | 64 | # Note: MUST specify path to auto-share directory and CAN specify other options |
67 | # to gnunet-auto-share here! | 65 | # to gnunet-auto-share here! |
68 | OPTIONS = $SERVICEHOME/fs/share/ | 66 | OPTIONS = $GNUNET_DATA_HOME/fs/share/ |
diff --git a/src/fs/test_pseudonym_data.conf b/src/fs/test_pseudonym_data.conf index 837908e51..5827721b8 100644 --- a/src/fs/test_pseudonym_data.conf +++ b/src/fs/test_pseudonym_data.conf | |||
@@ -1,6 +1,5 @@ | |||
1 | # General settings | 1 | # General settings |
2 | [fs] | 2 | [fs] |
3 | HOME = "/tmp/gnunet-pseudonym-test" | ||
4 | 3 | ||
5 | [TESTING] | 4 | [TESTING] |
6 | WEAKRANDOM = YES | 5 | WEAKRANDOM = YES |
diff --git a/src/gns/gns.conf.in b/src/gns/gns.conf.in index 5529db201..99f7dcc54 100644 --- a/src/gns/gns.conf.in +++ b/src/gns/gns.conf.in | |||
@@ -1,14 +1,11 @@ | |||
1 | [gns] | 1 | [gns] |
2 | AUTOSTART = YES | 2 | AUTOSTART = YES |
3 | HOSTNAME = localhost | 3 | HOSTNAME = localhost |
4 | HOME = $SERVICEHOME | ||
5 | BINARY = gnunet-service-gns | 4 | BINARY = gnunet-service-gns |
6 | UNIXPATH = /tmp/gnunet-service-gns.sock | 5 | UNIXPATH = /tmp/gnunet-service-gns.sock |
7 | @UNIXONLY@PORT = 2102 | 6 | @UNIXONLY@PORT = 2102 |
8 | 7 | ||
9 | ZONE_DIR = $SERVICEHOME/gns/ | 8 | # Do we require users that want to access GNS to run this process |
10 | |||
11 | # Do we require users that want to access GNS to run this process | ||
12 | # (usually not a good idea) | 9 | # (usually not a good idea) |
13 | UNIX_MATCH_UID = NO | 10 | UNIX_MATCH_UID = NO |
14 | 11 | ||
@@ -28,7 +25,7 @@ BINARY = gnunet-gns-proxy | |||
28 | AUTOSTART = NO | 25 | AUTOSTART = NO |
29 | 26 | ||
30 | # Where is the certificate for the GNS proxy stored? | 27 | # Where is the certificate for the GNS proxy stored? |
31 | PROXY_CACERT = $SERVICEHOME/gns/gnsCAcert.pem | 28 | PROXY_CACERT = $GNUNET_DATA_HOME/gns/gns_ca_cert.pem |
32 | PROXY_UNIXPATH = /tmp/gnunet-gns-proxy.sock | 29 | PROXY_UNIXPATH = /tmp/gnunet-gns-proxy.sock |
33 | 30 | ||
34 | 31 | ||
diff --git a/src/gns/test_gns_simple_lookup.conf b/src/gns/test_gns_simple_lookup.conf index 687dff71e..c7f9f7132 100644 --- a/src/gns/test_gns_simple_lookup.conf +++ b/src/gns/test_gns_simple_lookup.conf | |||
@@ -70,7 +70,6 @@ SHORTEN_ZONEKEY = zonefiles/188JSUMKEF25GVU8TTV0PBNNN8JVCPUEDFV1UHJJU884JD25V0T0 | |||
70 | #ZONEKEY = $SERVICEHOME/gns/zonekey.zkey | 70 | #ZONEKEY = $SERVICEHOME/gns/zonekey.zkey |
71 | HIJACK_DNS = NO | 71 | HIJACK_DNS = NO |
72 | UNIXPATH = /tmp/gnunet-service-gns.sock | 72 | UNIXPATH = /tmp/gnunet-service-gns.sock |
73 | HOME = $SERVICEHOME | ||
74 | AUTO_IMPORT_PKEY = YES | 73 | AUTO_IMPORT_PKEY = YES |
75 | MAX_PARALLEL_BACKGROUND_QUERIES = 10 | 74 | MAX_PARALLEL_BACKGROUND_QUERIES = 10 |
76 | DEFAULT_LOOKUP_TIMEOUT = 15 s | 75 | DEFAULT_LOOKUP_TIMEOUT = 15 s |
@@ -89,7 +88,6 @@ UNIXPATH = /tmp/gnunet-service-namestore-default.sock | |||
89 | UNIX_MATCH_UID = YES | 88 | UNIX_MATCH_UID = YES |
90 | UNIX_MATCH_GID = YES | 89 | UNIX_MATCH_GID = YES |
91 | HOSTNAME = localhost | 90 | HOSTNAME = localhost |
92 | HOME = $SERVICEHOME | ||
93 | BINARY = gnunet-service-namestore | 91 | BINARY = gnunet-service-namestore |
94 | ACCEPT_FROM = 127.0.0.1; | 92 | ACCEPT_FROM = 127.0.0.1; |
95 | ACCEPT_FROM6 = ::1; | 93 | ACCEPT_FROM6 = ::1; |
diff --git a/src/hostlist/hostlist.conf b/src/hostlist/hostlist.conf index 278c35f8c..40e7c7f7e 100644 --- a/src/hostlist/hostlist.conf +++ b/src/hostlist/hostlist.conf | |||
@@ -1,7 +1,6 @@ | |||
1 | [hostlist] | 1 | [hostlist] |
2 | # port for hostlist http server | 2 | # port for hostlist http server |
3 | HTTPPORT = 8080 | 3 | HTTPPORT = 8080 |
4 | HOME = $SERVICEHOME | ||
5 | HOSTLISTFILE = $SERVICEHOME/hostlist/learned.data | 4 | HOSTLISTFILE = $SERVICEHOME/hostlist/learned.data |
6 | BINARY = gnunet-daemon-hostlist | 5 | BINARY = gnunet-daemon-hostlist |
7 | # consider having "-e" as default as well once implemented | 6 | # consider having "-e" as default as well once implemented |
diff --git a/src/identity/identity.conf.in b/src/identity/identity.conf.in index 621b601fb..1b68775b9 100644 --- a/src/identity/identity.conf.in +++ b/src/identity/identity.conf.in | |||
@@ -2,7 +2,6 @@ | |||
2 | AUTOSTART = YES | 2 | AUTOSTART = YES |
3 | @JAVAPORT@PORT = 2108 | 3 | @JAVAPORT@PORT = 2108 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | HOME = $SERVICEHOME | ||
6 | BINARY = gnunet-service-identity | 5 | BINARY = gnunet-service-identity |
7 | ACCEPT_FROM = 127.0.0.1; | 6 | ACCEPT_FROM = 127.0.0.1; |
8 | ACCEPT_FROM6 = ::1; | 7 | ACCEPT_FROM6 = ::1; |
@@ -11,7 +10,7 @@ UNIX_MATCH_UID = NO | |||
11 | UNIX_MATCH_GID = YES | 10 | UNIX_MATCH_GID = YES |
12 | 11 | ||
13 | # Directory where we store information about our egos | 12 | # Directory where we store information about our egos |
14 | EGODIR = $SERVICEHOME/egos/ | 13 | EGODIR = $GNUNET_DATA_HOME/identity/egos/ |
15 | 14 | ||
16 | # File where we store default identities for subsystems | 15 | # File where we store default identities for subsystems |
17 | SUBSYSTEM_CFG = $SERVICEHOME/subsystem_defaults.conf | 16 | SUBSYSTEM_CFG = $GNUNET_CONFIG_HOME/identity/subsystem_defaults.conf |
diff --git a/src/include/gnunet_configuration_lib.h b/src/include/gnunet_configuration_lib.h index 08cf1558a..6d0c04dbb 100644 --- a/src/include/gnunet_configuration_lib.h +++ b/src/include/gnunet_configuration_lib.h | |||
@@ -415,8 +415,13 @@ GNUNET_CONFIGURATION_get_value_yesno (const struct GNUNET_CONFIGURATION_Handle | |||
415 | 415 | ||
416 | /** | 416 | /** |
417 | * Expand an expression of the form "$FOO/BAR" to "DIRECTORY/BAR" | 417 | * Expand an expression of the form "$FOO/BAR" to "DIRECTORY/BAR" |
418 | * where either in the "PATHS" section or the environtment | 418 | * where either in the "PATHS" section or the environtment "FOO" is |
419 | * "FOO" is set to "DIRECTORY". | 419 | * set to "DIRECTORY". We also support default expansion, |
420 | * i.e. ${VARIABLE:-default} will expand to $VARIABLE if VARIABLE is | ||
421 | * set in PATHS or the environment, and otherwise to "default". Note | ||
422 | * that "default" itself can also be a $-expression, thus | ||
423 | * "${VAR1:-{$VAR2}}" will expand to VAR1 and if that is not defined | ||
424 | * to VAR2. | ||
420 | * | 425 | * |
421 | * @param cfg configuration to use for path expansion | 426 | * @param cfg configuration to use for path expansion |
422 | * @param orig string to $-expand (will be freed!) | 427 | * @param orig string to $-expand (will be freed!) |
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h index c9cae17a2..bd1a2f3bf 100644 --- a/src/include/gnunet_crypto_lib.h +++ b/src/include/gnunet_crypto_lib.h | |||
@@ -963,7 +963,7 @@ GNUNET_CRYPTO_ecc_key_get_anonymous (void); | |||
963 | * configuration file (!). This function is used so that | 963 | * configuration file (!). This function is used so that |
964 | * at a later point code can be certain that reading a | 964 | * at a later point code can be certain that reading a |
965 | * hostkey is fast (for example in time-dependent testcases). | 965 | * hostkey is fast (for example in time-dependent testcases). |
966 | * | 966 | * |
967 | * @param cfg_name name of the configuration file to use | 967 | * @param cfg_name name of the configuration file to use |
968 | */ | 968 | */ |
969 | void | 969 | void |
diff --git a/src/include/gnunet_disk_lib.h b/src/include/gnunet_disk_lib.h index bf49b71f8..f6aa3d070 100644 --- a/src/include/gnunet_disk_lib.h +++ b/src/include/gnunet_disk_lib.h | |||
@@ -798,25 +798,6 @@ GNUNET_DISK_file_change_owner (const char *filename, const char *user); | |||
798 | 798 | ||
799 | 799 | ||
800 | /** | 800 | /** |
801 | * Construct full path to a file inside of the private | ||
802 | * directory used by GNUnet. Also creates the corresponding | ||
803 | * directory. If the resulting name is supposed to be | ||
804 | * a directory, end the last argument in '/' (or pass | ||
805 | * DIR_SEPARATOR_STR as the last argument before NULL). | ||
806 | * | ||
807 | * @param cfg configuration to use | ||
808 | * @param service_name name of the service asking | ||
809 | * @param ... is NULL-terminated list of | ||
810 | * path components to append to the | ||
811 | * private directory name. | ||
812 | * @return the constructed filename | ||
813 | */ | ||
814 | char * | ||
815 | GNUNET_DISK_get_home_filename (const struct GNUNET_CONFIGURATION_Handle *cfg, | ||
816 | const char *service_name, ...); | ||
817 | |||
818 | |||
819 | /** | ||
820 | * Opaque handle for a memory-mapping operation. | 801 | * Opaque handle for a memory-mapping operation. |
821 | */ | 802 | */ |
822 | struct GNUNET_DISK_MapHandle; | 803 | struct GNUNET_DISK_MapHandle; |
diff --git a/src/mesh/mesh.conf.in b/src/mesh/mesh.conf.in index 504e2ecb1..39ede6750 100644 --- a/src/mesh/mesh.conf.in +++ b/src/mesh/mesh.conf.in | |||
@@ -2,7 +2,6 @@ | |||
2 | AUTOSTART = YES | 2 | AUTOSTART = YES |
3 | @JAVAPORT@PORT = 2096 | 3 | @JAVAPORT@PORT = 2096 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | HOME = $SERVICEHOME | ||
6 | BINARY = gnunet-service-mesh | 5 | BINARY = gnunet-service-mesh |
7 | ACCEPT_FROM = 127.0.0.1; | 6 | ACCEPT_FROM = 127.0.0.1; |
8 | ACCEPT_FROM6 = ::1; | 7 | ACCEPT_FROM6 = ::1; |
diff --git a/src/multicast/multicast.conf.in b/src/multicast/multicast.conf.in index bd37cb474..65299cecf 100644 --- a/src/multicast/multicast.conf.in +++ b/src/multicast/multicast.conf.in | |||
@@ -2,7 +2,6 @@ | |||
2 | AUTOSTART = YES | 2 | AUTOSTART = YES |
3 | PORT = 2109 | 3 | PORT = 2109 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | HOME = $SERVICEHOME | ||
6 | BINARY = gnunet-service-multicast | 5 | BINARY = gnunet-service-multicast |
7 | ACCEPT_FROM = 127.0.0.1; | 6 | ACCEPT_FROM = 127.0.0.1; |
8 | ACCEPT_FROM6 = ::1; | 7 | ACCEPT_FROM6 = ::1; |
diff --git a/src/namestore/namestore.conf.in b/src/namestore/namestore.conf.in index 2d92f2e7b..91dbaabad 100644 --- a/src/namestore/namestore.conf.in +++ b/src/namestore/namestore.conf.in | |||
@@ -5,15 +5,13 @@ UNIX_MATCH_UID = NO | |||
5 | UNIX_MATCH_GID = YES | 5 | UNIX_MATCH_GID = YES |
6 | @UNIXONLY@ PORT = 2099 | 6 | @UNIXONLY@ PORT = 2099 |
7 | HOSTNAME = localhost | 7 | HOSTNAME = localhost |
8 | HOME = $SERVICEHOME | ||
9 | BINARY = gnunet-service-namestore | 8 | BINARY = gnunet-service-namestore |
10 | ACCEPT_FROM = 127.0.0.1; | 9 | ACCEPT_FROM = 127.0.0.1; |
11 | ACCEPT_FROM6 = ::1; | 10 | ACCEPT_FROM6 = ::1; |
12 | DATABASE = sqlite | 11 | DATABASE = sqlite |
13 | ZONEFILE_DIRECTORY = $SERVICEHOME/zones/ | ||
14 | 12 | ||
15 | [namestore-sqlite] | 13 | [namestore-sqlite] |
16 | FILENAME = $SERVICEHOME/namestore/sqlite.db | 14 | FILENAME = $GNUNET_DATA_HOME/namestore/sqlite.db |
17 | 15 | ||
18 | [namestore-postgres] | 16 | [namestore-postgres] |
19 | CONFIG = connect_timeout=10; dbname=gnunet | 17 | CONFIG = connect_timeout=10; dbname=gnunet |
@@ -31,6 +29,4 @@ AUTOSTART = NO | |||
31 | # On what port does the FCFS daemon listen for HTTP clients? | 29 | # On what port does the FCFS daemon listen for HTTP clients? |
32 | HTTPPORT = 18080 | 30 | HTTPPORT = 18080 |
33 | 31 | ||
34 | # Where is the zone key for the FCFS zone stored? | ||
35 | ZONEKEY = $SERVICEHOME/fcfsd/zonekey.zkey | ||
36 | 32 | ||
diff --git a/src/nat/test_nat_data.conf b/src/nat/test_nat_data.conf index 9314e066a..03467d1e6 100644 --- a/src/nat/test_nat_data.conf +++ b/src/nat/test_nat_data.conf | |||
@@ -11,7 +11,6 @@ HOSTKEY = $SERVICEHOME/.hostkey | |||
11 | WEAKRANDOM = NO | 11 | WEAKRANDOM = NO |
12 | 12 | ||
13 | [client] | 13 | [client] |
14 | HOME = $SERVICEHOME | ||
15 | 14 | ||
16 | 15 | ||
17 | [nat] | 16 | [nat] |
@@ -48,7 +47,6 @@ DISABLEV6 = NO | |||
48 | [arm] | 47 | [arm] |
49 | PORT = 2087 | 48 | PORT = 2087 |
50 | HOSTNAME = localhost | 49 | HOSTNAME = localhost |
51 | HOME = $SERVICEHOME | ||
52 | BINARY = gnunet-service-arm | 50 | BINARY = gnunet-service-arm |
53 | ACCEPT_FROM = 127.0.0.1; | 51 | ACCEPT_FROM = 127.0.0.1; |
54 | ACCEPT_FROM6 = ::1; | 52 | ACCEPT_FROM6 = ::1; |
@@ -71,7 +69,6 @@ UNIX_MATCH_GID = YES | |||
71 | AUTOSTART = YES | 69 | AUTOSTART = YES |
72 | PORT = 2088 | 70 | PORT = 2088 |
73 | HOSTNAME = localhost | 71 | HOSTNAME = localhost |
74 | HOME = $SERVICEHOME | ||
75 | BINARY = gnunet-service-statistics | 72 | BINARY = gnunet-service-statistics |
76 | ACCEPT_FROM = 127.0.0.1; | 73 | ACCEPT_FROM = 127.0.0.1; |
77 | ACCEPT_FROM6 = ::1; | 74 | ACCEPT_FROM6 = ::1; |
@@ -92,7 +89,6 @@ UNIX_MATCH_GID = YES | |||
92 | AUTOSTART = YES | 89 | AUTOSTART = YES |
93 | PORT = 2089 | 90 | PORT = 2089 |
94 | HOSTNAME = localhost | 91 | HOSTNAME = localhost |
95 | HOME = $SERVICEHOME | ||
96 | BINARY = gnunet-service-resolver | 92 | BINARY = gnunet-service-resolver |
97 | ACCEPT_FROM = 127.0.0.1; | 93 | ACCEPT_FROM = 127.0.0.1; |
98 | ACCEPT_FROM6 = ::1; | 94 | ACCEPT_FROM6 = ::1; |
diff --git a/src/nse/nse.conf.in b/src/nse/nse.conf.in index c96830c42..fbc272235 100644 --- a/src/nse/nse.conf.in +++ b/src/nse/nse.conf.in | |||
@@ -2,19 +2,18 @@ | |||
2 | AUTOSTART = YES | 2 | AUTOSTART = YES |
3 | @JAVAPORT@PORT = 2097 | 3 | @JAVAPORT@PORT = 2097 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | HOME = $SERVICEHOME | ||
6 | BINARY = gnunet-service-nse | 5 | BINARY = gnunet-service-nse |
7 | ACCEPT_FROM = 127.0.0.1; | 6 | ACCEPT_FROM = 127.0.0.1; |
8 | ACCEPT_FROM6 = ::1; | 7 | ACCEPT_FROM6 = ::1; |
9 | UNIXPATH = /tmp/gnunet-service-nse.unix | 8 | UNIXPATH = /tmp/gnunet-service-nse.unix |
10 | UNIX_MATCH_UID = NO | 9 | UNIX_MATCH_UID = NO |
11 | UNIX_MATCH_GID = YES | 10 | UNIX_MATCH_GID = YES |
12 | PROOFFILE = $SERVICEHOME/.nse-proof | 11 | PROOFFILE = $GNUNET_DATA_HOME/nse/proof.dat |
13 | 12 | ||
14 | # The directory where the NSE services logs timestamps everytime | 13 | # The directory where the NSE services logs timestamps everytime |
15 | # a size estime flooding message is received | 14 | # a size estime flooding message is received |
16 | # This option is only used for benchmarking, not in production. | 15 | # This option is only used for benchmarking, not in production. |
17 | HISTOGRAM_DIR = $SERVICEHOME | 16 | HISTOGRAM_DIR = $GNUNET_CACHE_HOME/nse/histogram/ |
18 | 17 | ||
19 | # How 'slowly' should the proof-of-work be constructed (delay | 18 | # How 'slowly' should the proof-of-work be constructed (delay |
20 | # between rounds); sane values between 0 and ~1000. | 19 | # between rounds); sane values between 0 and ~1000. |
diff --git a/src/peerinfo/peerinfo.conf.in b/src/peerinfo/peerinfo.conf.in index 11302211d..560400498 100644 --- a/src/peerinfo/peerinfo.conf.in +++ b/src/peerinfo/peerinfo.conf.in | |||
@@ -2,7 +2,6 @@ | |||
2 | AUTOSTART = YES | 2 | AUTOSTART = YES |
3 | @JAVAPORT@PORT = 2090 | 3 | @JAVAPORT@PORT = 2090 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | HOME = $SERVICEHOME | ||
6 | BINARY = gnunet-service-peerinfo | 5 | BINARY = gnunet-service-peerinfo |
7 | ACCEPT_FROM = 127.0.0.1; | 6 | ACCEPT_FROM = 127.0.0.1; |
8 | ACCEPT_FROM6 = ::1; | 7 | ACCEPT_FROM6 = ::1; |
@@ -10,15 +9,15 @@ UNIXPATH = /tmp/gnunet-service-peerinfo.sock | |||
10 | UNIX_MATCH_UID = NO | 9 | UNIX_MATCH_UID = NO |
11 | UNIX_MATCH_GID = YES | 10 | UNIX_MATCH_GID = YES |
12 | # DISABLE_SOCKET_FORWARDING = NO | 11 | # DISABLE_SOCKET_FORWARDING = NO |
13 | # USERNAME = | 12 | # USERNAME = |
14 | # MAXBUF = | 13 | # MAXBUF = |
15 | # TIMEOUT = | 14 | # TIMEOUT = |
16 | # DISABLEV6 = | 15 | # DISABLEV6 = |
17 | # BINDTO = | 16 | # BINDTO = |
18 | # REJECT_FROM = | 17 | # REJECT_FROM = |
19 | # REJECT_FROM6 = | 18 | # REJECT_FROM6 = |
20 | # PREFIX = | 19 | # PREFIX = |
21 | HOSTS = $SERVICEHOME/peerinfo/ | 20 | HOSTS = $GNUNET_DATA_HOME/peerinfo/hosts/ |
22 | 21 | ||
23 | # Option to disable all disk IO; only useful for testbed runs | 22 | # Option to disable all disk IO; only useful for testbed runs |
24 | # (large-scale experiments); disables persistence of HELLOs! | 23 | # (large-scale experiments); disables persistence of HELLOs! |
diff --git a/src/psyc/psyc.conf.in b/src/psyc/psyc.conf.in index 5a1eebf61..7dfeb0d97 100644 --- a/src/psyc/psyc.conf.in +++ b/src/psyc/psyc.conf.in | |||
@@ -1,6 +1,5 @@ | |||
1 | [psyc] | 1 | [psyc] |
2 | AUTOSTART = YES | 2 | AUTOSTART = YES |
3 | HOME = $SERVICEHOME | ||
4 | BINARY = gnunet-service-psyc | 3 | BINARY = gnunet-service-psyc |
5 | UNIXPATH = /tmp/gnunet-service-psyc.sock | 4 | UNIXPATH = /tmp/gnunet-service-psyc.sock |
6 | UNIX_MATCH_UID = NO | 5 | UNIX_MATCH_UID = NO |
diff --git a/src/psyc/test_psyc.conf b/src/psyc/test_psyc.conf index b5d3fd3fc..da2dde680 100644 --- a/src/psyc/test_psyc.conf +++ b/src/psyc/test_psyc.conf | |||
@@ -4,7 +4,6 @@ DEFAULTSERVICES = psyc | |||
4 | 4 | ||
5 | [psyc] | 5 | [psyc] |
6 | AUTOSTART = YES | 6 | AUTOSTART = YES |
7 | HOME = $SERVICEHOME | ||
8 | BINARY = gnunet-service-psyc | 7 | BINARY = gnunet-service-psyc |
9 | UNIXPATH = /tmp/test-gnunet-service-psyc.sock | 8 | UNIXPATH = /tmp/test-gnunet-service-psyc.sock |
10 | UNIX_MATCH_UID = NO | 9 | UNIX_MATCH_UID = NO |
diff --git a/src/psycstore/psycstore.conf.in b/src/psycstore/psycstore.conf.in index c43c5158e..98c6aeda8 100644 --- a/src/psycstore/psycstore.conf.in +++ b/src/psycstore/psycstore.conf.in | |||
@@ -1,6 +1,5 @@ | |||
1 | [psycstore] | 1 | [psycstore] |
2 | AUTOSTART = YES | 2 | AUTOSTART = YES |
3 | HOME = $SERVICEHOME | ||
4 | BINARY = gnunet-service-psycstore | 3 | BINARY = gnunet-service-psycstore |
5 | UNIXPATH = /tmp/gnunet-service-psycstore.sock | 4 | UNIXPATH = /tmp/gnunet-service-psycstore.sock |
6 | @UNIXONLY@PORT = 2111 | 5 | @UNIXONLY@PORT = 2111 |
@@ -9,4 +8,4 @@ UNIX_MATCH_GID = YES | |||
9 | DATABASE = sqlite | 8 | DATABASE = sqlite |
10 | 9 | ||
11 | [psycstore-sqlite] | 10 | [psycstore-sqlite] |
12 | FILENAME = $SERVICEHOME/psycstore/sqlite.db | 11 | FILENAME = $GNUNET_DATA_HOME/psycstore/sqlite.db |
diff --git a/src/psycstore/test_psycstore.conf b/src/psycstore/test_psycstore.conf index a7d334617..c524f2ae6 100644 --- a/src/psycstore/test_psycstore.conf +++ b/src/psycstore/test_psycstore.conf | |||
@@ -4,7 +4,6 @@ DEFAULTSERVICES = psycstore | |||
4 | 4 | ||
5 | [psycstore] | 5 | [psycstore] |
6 | AUTOSTART = YES | 6 | AUTOSTART = YES |
7 | HOME = $SERVICEHOME | ||
8 | BINARY = gnunet-service-psycstore | 7 | BINARY = gnunet-service-psycstore |
9 | UNIXPATH = /tmp/test-gnunet-service-psycstore.sock | 8 | UNIXPATH = /tmp/test-gnunet-service-psycstore.sock |
10 | UNIX_MATCH_UID = NO | 9 | UNIX_MATCH_UID = NO |
diff --git a/src/regex/regex.conf.in b/src/regex/regex.conf.in index 2ff48c5ae..59376a61e 100644 --- a/src/regex/regex.conf.in +++ b/src/regex/regex.conf.in | |||
@@ -3,7 +3,6 @@ AUTOSTART = YES | |||
3 | @UNIXONLY@ PORT = 2107 | 3 | @UNIXONLY@ PORT = 2107 |
4 | UNIXPATH = /tmp/gnunet-service-regex.sock | 4 | UNIXPATH = /tmp/gnunet-service-regex.sock |
5 | HOSTNAME = localhost | 5 | HOSTNAME = localhost |
6 | HOME = $SERVICEHOME | ||
7 | BINARY = gnunet-service-regex | 6 | BINARY = gnunet-service-regex |
8 | ACCEPT_FROM = 127.0.0.1; | 7 | ACCEPT_FROM = 127.0.0.1; |
9 | ACCEPT_FROM6 = ::1; | 8 | ACCEPT_FROM6 = ::1; |
diff --git a/src/revocation/revocation.conf.in b/src/revocation/revocation.conf.in index d179c1629..6e84b84d6 100644 --- a/src/revocation/revocation.conf.in +++ b/src/revocation/revocation.conf.in | |||
@@ -2,7 +2,6 @@ | |||
2 | AUTOSTART = YES | 2 | AUTOSTART = YES |
3 | @JAVAPORT@PORT = 2112 | 3 | @JAVAPORT@PORT = 2112 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | HOME = $SERVICEHOME | ||
6 | BINARY = gnunet-service-revocation | 5 | BINARY = gnunet-service-revocation |
7 | ACCEPT_FROM = 127.0.0.1; | 6 | ACCEPT_FROM = 127.0.0.1; |
8 | ACCEPT_FROM6 = ::1; | 7 | ACCEPT_FROM6 = ::1; |
@@ -15,4 +14,4 @@ UNIX_MATCH_GID = YES | |||
15 | # DO NOT CHANGE THIS VALUE, doing so will break the protocol! | 14 | # DO NOT CHANGE THIS VALUE, doing so will break the protocol! |
16 | WORKBITS = 25 | 15 | WORKBITS = 25 |
17 | 16 | ||
18 | DATABASE = $SERVICEHOME/revocation.db | 17 | DATABASE = $GNUNET_DATA_HOME/revocation.dat |
diff --git a/src/scalarproduct/scalarproduct.conf.in b/src/scalarproduct/scalarproduct.conf.in index e47af6f6a..064b7fd8c 100644 --- a/src/scalarproduct/scalarproduct.conf.in +++ b/src/scalarproduct/scalarproduct.conf.in | |||
@@ -1,7 +1,6 @@ | |||
1 | [vectorproduct] | 1 | [vectorproduct] |
2 | BINARY = gnunet-service-vectorproduct | 2 | BINARY = gnunet-service-vectorproduct |
3 | UNIXPATH = /tmp/gnunet-service-vectorproduct.sock | 3 | UNIXPATH = /tmp/gnunet-service-vectorproduct.sock |
4 | HOME = $SERVICEHOME | ||
5 | # PORT = 2106 | 4 | # PORT = 2106 |
6 | @UNIXONLY@ PORT = 2087 | 5 | @UNIXONLY@ PORT = 2087 |
7 | 6 | ||
diff --git a/src/set/set.conf.in b/src/set/set.conf.in index 2dc1c21d2..81e11cff0 100644 --- a/src/set/set.conf.in +++ b/src/set/set.conf.in | |||
@@ -2,7 +2,6 @@ | |||
2 | AUTOSTART = NO | 2 | AUTOSTART = NO |
3 | @UNIXONLY@PORT = 2106 | 3 | @UNIXONLY@PORT = 2106 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | HOME = $SERVICEHOME | ||
6 | BINARY = gnunet-service-set | 5 | BINARY = gnunet-service-set |
7 | ACCEPT_FROM = 127.0.0.1; | 6 | ACCEPT_FROM = 127.0.0.1; |
8 | ACCEPT_FROM6 = ::1; | 7 | ACCEPT_FROM6 = ::1; |
diff --git a/src/set/test_set.conf b/src/set/test_set.conf index 6bac3a55e..0eeb1cb72 100644 --- a/src/set/test_set.conf +++ b/src/set/test_set.conf | |||
@@ -6,7 +6,6 @@ SERVICEHOME = /tmp/test-gnunet-set/ | |||
6 | AUTOSTART = YES | 6 | AUTOSTART = YES |
7 | PORT = 2106 | 7 | PORT = 2106 |
8 | HOSTNAME = localhost | 8 | HOSTNAME = localhost |
9 | HOME = $SERVICEHOME | ||
10 | BINARY = gnunet-service-set | 9 | BINARY = gnunet-service-set |
11 | #PREFIX = valgrind | 10 | #PREFIX = valgrind |
12 | #PREFIX = gdbserver :1234 | 11 | #PREFIX = gdbserver :1234 |
diff --git a/src/statistics/gnunet-service-statistics.c b/src/statistics/gnunet-service-statistics.c index acf2a965f..6c3d173c4 100644 --- a/src/statistics/gnunet-service-statistics.c +++ b/src/statistics/gnunet-service-statistics.c | |||
@@ -241,11 +241,20 @@ load (struct GNUNET_SERVER_Handle *server) | |||
241 | struct GNUNET_SERVER_MessageStreamTokenizer *mst; | 241 | struct GNUNET_SERVER_MessageStreamTokenizer *mst; |
242 | char *emsg; | 242 | char *emsg; |
243 | 243 | ||
244 | fn = GNUNET_DISK_get_home_filename (cfg, "statistics", "statistics.data", | 244 | if (GNUNET_OK != |
245 | NULL); | 245 | GNUNET_CONFIGURATION_get_value_filename (cfg, |
246 | if (fn == NULL) | 246 | "STATISTICS", |
247 | "DATABASE", | ||
248 | &fn)) | ||
249 | { | ||
250 | GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, | ||
251 | "STATISTICS", | ||
252 | "DATABASE"); | ||
247 | return; | 253 | return; |
248 | if ((GNUNET_OK != GNUNET_DISK_file_size (fn, &fsize, GNUNET_NO, GNUNET_YES)) || (fsize == 0)) | 254 | } |
255 | if ( (GNUNET_OK != | ||
256 | GNUNET_DISK_file_size (fn, &fsize, GNUNET_NO, GNUNET_YES)) || | ||
257 | (0 == fsize) ) | ||
249 | { | 258 | { |
250 | GNUNET_free (fn); | 259 | GNUNET_free (fn); |
251 | return; | 260 | return; |
@@ -291,15 +300,22 @@ save () | |||
291 | struct StatsEntry *pos; | 300 | struct StatsEntry *pos; |
292 | char *fn; | 301 | char *fn; |
293 | struct GNUNET_BIO_WriteHandle *wh; | 302 | struct GNUNET_BIO_WriteHandle *wh; |
294 | |||
295 | uint16_t size; | 303 | uint16_t size; |
296 | unsigned long long total; | 304 | unsigned long long total; |
297 | 305 | ||
298 | wh = NULL; | 306 | if (GNUNET_OK != |
299 | fn = GNUNET_DISK_get_home_filename (cfg, "statistics", "statistics.data", | 307 | GNUNET_CONFIGURATION_get_value_filename (cfg, |
300 | NULL); | 308 | "STATISTICS", |
301 | if (fn != NULL) | 309 | "DATABASE", |
302 | wh = GNUNET_BIO_write_open (fn); | 310 | &fn)) |
311 | { | ||
312 | GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, | ||
313 | "STATISTICS", | ||
314 | "DATABASE"); | ||
315 | return; | ||
316 | } | ||
317 | (void) GNUNET_DISK_directory_create_for_file (fn); | ||
318 | wh = GNUNET_BIO_write_open (fn); | ||
303 | total = 0; | 319 | total = 0; |
304 | while (NULL != (pos = start)) | 320 | while (NULL != (pos = start)) |
305 | { | 321 | { |
diff --git a/src/statistics/statistics.conf.in b/src/statistics/statistics.conf.in index 669e89bd7..b08c737f2 100644 --- a/src/statistics/statistics.conf.in +++ b/src/statistics/statistics.conf.in | |||
@@ -2,7 +2,6 @@ | |||
2 | AUTOSTART = YES | 2 | AUTOSTART = YES |
3 | @JAVAPORT@PORT = 2088 | 3 | @JAVAPORT@PORT = 2088 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | HOME = $SERVICEHOME | ||
6 | BINARY = gnunet-service-statistics | 5 | BINARY = gnunet-service-statistics |
7 | ACCEPT_FROM = 127.0.0.1; | 6 | ACCEPT_FROM = 127.0.0.1; |
8 | ACCEPT_FROM6 = ::1; | 7 | ACCEPT_FROM6 = ::1; |
diff --git a/src/template/template.conf b/src/template/template.conf index 439bbd2e6..ac1479b48 100644 --- a/src/template/template.conf +++ b/src/template/template.conf | |||
@@ -2,7 +2,6 @@ | |||
2 | AUTOSTART = NO | 2 | AUTOSTART = NO |
3 | PORT = 9999 | 3 | PORT = 9999 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | HOME = $SERVICEHOME | ||
6 | BINARY = gnunet-service-template | 5 | BINARY = gnunet-service-template |
7 | ACCEPT_FROM = 127.0.0.1; | 6 | ACCEPT_FROM = 127.0.0.1; |
8 | ACCEPT_FROM6 = ::1; | 7 | ACCEPT_FROM6 = ::1; |
diff --git a/src/testbed/gnunet-daemon-testbed-blacklist.c b/src/testbed/gnunet-daemon-testbed-blacklist.c index 6be43999c..55cd35e10 100644 --- a/src/testbed/gnunet-daemon-testbed-blacklist.c +++ b/src/testbed/gnunet-daemon-testbed-blacklist.c | |||
@@ -215,7 +215,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
215 | char fname[PATH_MAX]; | 215 | char fname[PATH_MAX]; |
216 | 216 | ||
217 | if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (c, "PATHS", | 217 | if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (c, "PATHS", |
218 | "SERVICEHOME", | 218 | "GNUNET_HOME", |
219 | &shome)) | 219 | &shome)) |
220 | { | 220 | { |
221 | GNUNET_break (0); | 221 | GNUNET_break (0); |
diff --git a/src/testbed/test_testbed_api_barriers.conf.in b/src/testbed/test_testbed_api_barriers.conf.in index 5dd0dadcd..8255ba152 100644 --- a/src/testbed/test_testbed_api_barriers.conf.in +++ b/src/testbed/test_testbed_api_barriers.conf.in | |||
@@ -52,9 +52,6 @@ USE_EPHEMERAL_KEYS = NO | |||
52 | TIMEOUT = 300 s | 52 | TIMEOUT = 300 s |
53 | PORT = 12368 | 53 | PORT = 12368 |
54 | 54 | ||
55 | [gnunetd] | ||
56 | HOSTKEY = $SERVICEHOME/.hostkey | ||
57 | |||
58 | [PATHS] | 55 | [PATHS] |
59 | SERVICEHOME = /tmp/test-testbed/ | 56 | SERVICEHOME = /tmp/test-testbed/ |
60 | 57 | ||
diff --git a/src/testbed/testbed.conf.in b/src/testbed/testbed.conf.in index 40bdae16d..108142d5e 100644 --- a/src/testbed/testbed.conf.in +++ b/src/testbed/testbed.conf.in | |||
@@ -2,7 +2,6 @@ | |||
2 | AUTOSTART = NO | 2 | AUTOSTART = NO |
3 | @JAVAPORT@ PORT = 2101 | 3 | @JAVAPORT@ PORT = 2101 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | HOME = $SERVICEHOME | ||
6 | BINARY = gnunet-service-testbed | 5 | BINARY = gnunet-service-testbed |
7 | 6 | ||
8 | # How long should operations wait? | 7 | # How long should operations wait? |
diff --git a/src/testing/testing.c b/src/testing/testing.c index c2033935d..a0d8e261b 100644 --- a/src/testing/testing.c +++ b/src/testing/testing.c | |||
@@ -103,7 +103,8 @@ struct GNUNET_TESTING_System | |||
103 | { | 103 | { |
104 | /** | 104 | /** |
105 | * Prefix (i.e. "/tmp/gnunet-testing/") we prepend to each | 105 | * Prefix (i.e. "/tmp/gnunet-testing/") we prepend to each |
106 | * SERVICEHOME. */ | 106 | * GNUNET_HOME. |
107 | */ | ||
107 | char *tmppath; | 108 | char *tmppath; |
108 | 109 | ||
109 | /** | 110 | /** |
@@ -747,7 +748,7 @@ struct UpdateContext | |||
747 | /** | 748 | /** |
748 | * The customized service home path for this peer | 749 | * The customized service home path for this peer |
749 | */ | 750 | */ |
750 | char *service_home; | 751 | char *gnunet_home; |
751 | 752 | ||
752 | /** | 753 | /** |
753 | * Array of ports currently allocated to this peer. These ports will be | 754 | * Array of ports currently allocated to this peer. These ports will be |
@@ -839,7 +840,7 @@ update_config (void *cls, const char *section, const char *option, | |||
839 | single_variable)) | 840 | single_variable)) |
840 | { | 841 | { |
841 | GNUNET_snprintf (uval, sizeof (uval), "%s/%s.sock", | 842 | GNUNET_snprintf (uval, sizeof (uval), "%s/%s.sock", |
842 | uc->service_home, section); | 843 | uc->gnunet_home, section); |
843 | value = uval; | 844 | value = uval; |
844 | } | 845 | } |
845 | else if ((GNUNET_YES == | 846 | else if ((GNUNET_YES == |
@@ -970,7 +971,7 @@ associate_shared_service (struct GNUNET_TESTING_System *system, | |||
970 | { | 971 | { |
971 | struct SharedServiceInstance *i; | 972 | struct SharedServiceInstance *i; |
972 | struct GNUNET_CONFIGURATION_Handle *temp; | 973 | struct GNUNET_CONFIGURATION_Handle *temp; |
973 | char *service_home; | 974 | char *gnunet_home; |
974 | uint32_t port; | 975 | uint32_t port; |
975 | 976 | ||
976 | ss->n_peers++; | 977 | ss->n_peers++; |
@@ -979,25 +980,25 @@ associate_shared_service (struct GNUNET_TESTING_System *system, | |||
979 | ( (0 != ss->share) | 980 | ( (0 != ss->share) |
980 | && (ss->n_instances < ((ss->n_peers + ss->share - 1) / ss->share)) ) ) | 981 | && (ss->n_instances < ((ss->n_peers + ss->share - 1) / ss->share)) ) ) |
981 | { | 982 | { |
982 | i = GNUNET_malloc (sizeof (struct SharedServiceInstance)); | 983 | i = GNUNET_new (struct SharedServiceInstance); |
983 | i->ss = ss; | 984 | i->ss = ss; |
984 | (void) GNUNET_asprintf (&service_home, "%s/shared/%s/%u", | 985 | (void) GNUNET_asprintf (&gnunet_home, "%s/shared/%s/%u", |
985 | system->tmppath, ss->sname, ss->n_instances); | 986 | system->tmppath, ss->sname, ss->n_instances); |
986 | (void) GNUNET_asprintf (&i->unix_sock, "%s/sock", service_home); | 987 | (void) GNUNET_asprintf (&i->unix_sock, "%s/sock", gnunet_home); |
987 | port = GNUNET_TESTING_reserve_port (system); | 988 | port = GNUNET_TESTING_reserve_port (system); |
988 | if (0 == port) | 989 | if (0 == port) |
989 | { | 990 | { |
990 | GNUNET_free (service_home); | 991 | GNUNET_free (gnunet_home); |
991 | cleanup_shared_service_instance (i); | 992 | cleanup_shared_service_instance (i); |
992 | return NULL; | 993 | return NULL; |
993 | } | 994 | } |
994 | GNUNET_array_append (ss->instances, ss->n_instances, i); | 995 | GNUNET_array_append (ss->instances, ss->n_instances, i); |
995 | temp = GNUNET_CONFIGURATION_dup (ss->cfg); | 996 | temp = GNUNET_CONFIGURATION_dup (ss->cfg); |
996 | (void) GNUNET_asprintf (&i->port_str, "%u", port); | 997 | (void) GNUNET_asprintf (&i->port_str, "%u", port); |
997 | (void) GNUNET_asprintf (&i->cfg_fn, "%s/config", service_home); | 998 | (void) GNUNET_asprintf (&i->cfg_fn, "%s/config", gnunet_home); |
998 | GNUNET_CONFIGURATION_set_value_string (temp, "PATHS", "SERVICEHOME", | 999 | GNUNET_CONFIGURATION_set_value_string (temp, "PATHS", "GNUNET_HOME", |
999 | service_home); | 1000 | gnunet_home); |
1000 | GNUNET_free (service_home); | 1001 | GNUNET_free (gnunet_home); |
1001 | GNUNET_CONFIGURATION_set_value_string (temp, ss->sname, "UNIXPATH", | 1002 | GNUNET_CONFIGURATION_set_value_string (temp, ss->sname, "UNIXPATH", |
1002 | i->unix_sock); | 1003 | i->unix_sock); |
1003 | GNUNET_CONFIGURATION_set_value_string (temp, ss->sname, "PORT", | 1004 | GNUNET_CONFIGURATION_set_value_string (temp, ss->sname, "PORT", |
@@ -1029,9 +1030,9 @@ associate_shared_service (struct GNUNET_TESTING_System *system, | |||
1029 | * Create a new configuration using the given configuration as a template; | 1030 | * Create a new configuration using the given configuration as a template; |
1030 | * ports and paths will be modified to select available ports on the local | 1031 | * ports and paths will be modified to select available ports on the local |
1031 | * system. The default configuration will be available in PATHS section under | 1032 | * system. The default configuration will be available in PATHS section under |
1032 | * the option DEFAULTCONFIG after the call. SERVICE_HOME is also set in PATHS | 1033 | * the option DEFAULTCONFIG after the call. GNUNET_HOME is also set in PATHS |
1033 | * section to the temporary directory specific to this configuration. If we run | 1034 | * section to the temporary directory specific to this configuration. If we run |
1034 | * out of "*port" numbers, return SYSERR. | 1035 | * out of "*port" numbers, return #GNUNET_SYSERR. |
1035 | * | 1036 | * |
1036 | * This is primarily a helper function used internally | 1037 | * This is primarily a helper function used internally |
1037 | * by 'GNUNET_TESTING_peer_configure'. | 1038 | * by 'GNUNET_TESTING_peer_configure'. |
@@ -1041,7 +1042,7 @@ associate_shared_service (struct GNUNET_TESTING_System *system, | |||
1041 | * @param ports array with port numbers used in the created configuration. | 1042 | * @param ports array with port numbers used in the created configuration. |
1042 | * Will be updated upon successful return. Can be NULL | 1043 | * Will be updated upon successful return. Can be NULL |
1043 | * @param nports the size of the `ports' array. Will be updated. | 1044 | * @param nports the size of the `ports' array. Will be updated. |
1044 | * @return GNUNET_OK on success, GNUNET_SYSERR on error - the configuration will | 1045 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error - the configuration will |
1045 | * be incomplete and should not be used there upon | 1046 | * be incomplete and should not be used there upon |
1046 | */ | 1047 | */ |
1047 | static int | 1048 | static int |
@@ -1058,16 +1059,16 @@ GNUNET_TESTING_configuration_create_ (struct GNUNET_TESTING_System *system, | |||
1058 | uc.status = GNUNET_OK; | 1059 | uc.status = GNUNET_OK; |
1059 | uc.ports = NULL; | 1060 | uc.ports = NULL; |
1060 | uc.nports = 0; | 1061 | uc.nports = 0; |
1061 | GNUNET_asprintf (&uc.service_home, "%s/%u", system->tmppath, | 1062 | GNUNET_asprintf (&uc.gnunet_home, "%s/%u", system->tmppath, |
1062 | system->path_counter++); | 1063 | system->path_counter++); |
1063 | GNUNET_asprintf (&default_config, "%s/config", uc.service_home); | 1064 | GNUNET_asprintf (&default_config, "%s/config", uc.gnunet_home); |
1064 | GNUNET_CONFIGURATION_set_value_string (cfg, "PATHS", "DEFAULTCONFIG", | 1065 | GNUNET_CONFIGURATION_set_value_string (cfg, "PATHS", "DEFAULTCONFIG", |
1065 | default_config); | 1066 | default_config); |
1066 | GNUNET_CONFIGURATION_set_value_string (cfg, "arm", "CONFIG", | 1067 | GNUNET_CONFIGURATION_set_value_string (cfg, "arm", "CONFIG", |
1067 | default_config); | 1068 | default_config); |
1068 | GNUNET_free (default_config); | 1069 | GNUNET_free (default_config); |
1069 | GNUNET_CONFIGURATION_set_value_string (cfg, "PATHS", "SERVICEHOME", | 1070 | GNUNET_CONFIGURATION_set_value_string (cfg, "PATHS", "GNUNET_HOME", |
1070 | uc.service_home); | 1071 | uc.gnunet_home); |
1071 | /* make PORTs and UNIXPATHs unique */ | 1072 | /* make PORTs and UNIXPATHs unique */ |
1072 | GNUNET_CONFIGURATION_iterate (cfg, &update_config, &uc); | 1073 | GNUNET_CONFIGURATION_iterate (cfg, &update_config, &uc); |
1073 | /* allow connections to services from system trusted_ip host */ | 1074 | /* allow connections to services from system trusted_ip host */ |
@@ -1076,7 +1077,7 @@ GNUNET_TESTING_configuration_create_ (struct GNUNET_TESTING_System *system, | |||
1076 | GNUNET_CONFIGURATION_set_value_string (cfg, | 1077 | GNUNET_CONFIGURATION_set_value_string (cfg, |
1077 | "nat", | 1078 | "nat", |
1078 | "USE_LOCALADDR", "YES"); | 1079 | "USE_LOCALADDR", "YES"); |
1079 | GNUNET_free (uc.service_home); | 1080 | GNUNET_free (uc.gnunet_home); |
1080 | if ((NULL != ports) && (NULL != nports)) | 1081 | if ((NULL != ports) && (NULL != nports)) |
1081 | { | 1082 | { |
1082 | *ports = uc.ports; | 1083 | *ports = uc.ports; |
@@ -1092,7 +1093,7 @@ GNUNET_TESTING_configuration_create_ (struct GNUNET_TESTING_System *system, | |||
1092 | * Create a new configuration using the given configuration as a template; | 1093 | * Create a new configuration using the given configuration as a template; |
1093 | * ports and paths will be modified to select available ports on the local | 1094 | * ports and paths will be modified to select available ports on the local |
1094 | * system. The default configuration will be available in PATHS section under | 1095 | * system. The default configuration will be available in PATHS section under |
1095 | * the option DEFAULTCONFIG after the call. SERVICE_HOME is also set in PATHS | 1096 | * the option DEFAULTCONFIG after the call. GNUNET_HOME is also set in PATHS |
1096 | * section to the temporary directory specific to this configuration. If we run | 1097 | * section to the temporary directory specific to this configuration. If we run |
1097 | * out of "*port" numbers, return SYSERR. | 1098 | * out of "*port" numbers, return SYSERR. |
1098 | * | 1099 | * |
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c index 323379d3e..8e6eff072 100644 --- a/src/transport/plugin_transport_http_server.c +++ b/src/transport/plugin_transport_http_server.c | |||
@@ -1868,61 +1868,47 @@ server_load_file (const char *file) | |||
1868 | * Load ssl certificate | 1868 | * Load ssl certificate |
1869 | * | 1869 | * |
1870 | * @param plugin the plugin | 1870 | * @param plugin the plugin |
1871 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | 1871 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure |
1872 | */ | 1872 | */ |
1873 | static int | 1873 | static int |
1874 | server_load_certificate (struct HTTP_Server_Plugin *plugin) | 1874 | server_load_certificate (struct HTTP_Server_Plugin *plugin) |
1875 | { | 1875 | { |
1876 | int res = GNUNET_OK; | 1876 | int res = GNUNET_OK; |
1877 | |||
1878 | char *sh; | ||
1879 | char *key_file; | 1877 | char *key_file; |
1880 | char *cert_file; | 1878 | char *cert_file; |
1881 | 1879 | ||
1882 | /* Get crypto init string from config | ||
1883 | * If not present just use default values */ | ||
1884 | |||
1885 | if (GNUNET_OK != | ||
1886 | GNUNET_CONFIGURATION_get_value_string (plugin->env->cfg, | ||
1887 | "PATHS", | ||
1888 | "SERVICEHOME", | ||
1889 | &sh)) | ||
1890 | { | ||
1891 | GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, plugin->name, | ||
1892 | "Failed to get servicehome!\n"); | ||
1893 | return GNUNET_SYSERR; | ||
1894 | } | ||
1895 | |||
1896 | |||
1897 | if (GNUNET_OK == | ||
1898 | GNUNET_CONFIGURATION_get_value_string (plugin->env->cfg, | ||
1899 | plugin->name, | ||
1900 | "CRYPTO_INIT", | ||
1901 | &plugin->crypto_init)) | ||
1902 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, | ||
1903 | "Using crypto init string `%s'\n", | ||
1904 | plugin->crypto_init); | ||
1905 | else | ||
1906 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, | ||
1907 | "Using default crypto init string \n"); | ||
1908 | 1880 | ||
1909 | if (GNUNET_OK != | 1881 | if (GNUNET_OK != |
1910 | GNUNET_CONFIGURATION_get_value_filename (plugin->env->cfg, plugin->name, | 1882 | GNUNET_CONFIGURATION_get_value_filename (plugin->env->cfg, plugin->name, |
1911 | "KEY_FILE", &key_file)) | 1883 | "KEY_FILE", &key_file)) |
1912 | { | 1884 | { |
1913 | GNUNET_break (0); | 1885 | GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, |
1914 | GNUNET_asprintf (&key_file, "%s/%s", sh, "https_key.key"); | 1886 | plugin->name, "CERT_FILE"); |
1887 | return GNUNET_SYSERR; | ||
1915 | } | 1888 | } |
1916 | |||
1917 | |||
1918 | if (GNUNET_OK != | 1889 | if (GNUNET_OK != |
1919 | GNUNET_CONFIGURATION_get_value_filename (plugin->env->cfg, plugin->name, | 1890 | GNUNET_CONFIGURATION_get_value_filename (plugin->env->cfg, plugin->name, |
1920 | "CERT_FILE", &cert_file)) | 1891 | "CERT_FILE", &cert_file)) |
1921 | { | 1892 | { |
1922 | GNUNET_break (0); | 1893 | GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, |
1923 | GNUNET_asprintf (&cert_file, "%s/%s", sh, "https_cert.crt"); | 1894 | plugin->name, "CERT_FILE"); |
1895 | GNUNET_free (key_file); | ||
1896 | return GNUNET_SYSERR; | ||
1924 | } | 1897 | } |
1925 | GNUNET_free (sh); | 1898 | /* Get crypto init string from config. If not present, use |
1899 | * default values */ | ||
1900 | if (GNUNET_OK == | ||
1901 | GNUNET_CONFIGURATION_get_value_string (plugin->env->cfg, | ||
1902 | plugin->name, | ||
1903 | "CRYPTO_INIT", | ||
1904 | &plugin->crypto_init)) | ||
1905 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, | ||
1906 | "Using crypto init string `%s'\n", | ||
1907 | plugin->crypto_init); | ||
1908 | else | ||
1909 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, | ||
1910 | "Using default crypto init string \n"); | ||
1911 | |||
1926 | /* read key & certificates from file */ | 1912 | /* read key & certificates from file */ |
1927 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1913 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1928 | "Trying to loading TLS certificate from key-file `%s' cert-file`%s'\n", | 1914 | "Trying to loading TLS certificate from key-file `%s' cert-file`%s'\n", |
diff --git a/src/transport/transport.conf.in b/src/transport/transport.conf.in index fd8b5dbbb..d9abdbf11 100644 --- a/src/transport/transport.conf.in +++ b/src/transport/transport.conf.in | |||
@@ -2,7 +2,6 @@ | |||
2 | AUTOSTART = YES | 2 | AUTOSTART = YES |
3 | @UNIXONLY@ PORT = 2091 | 3 | @UNIXONLY@ PORT = 2091 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | HOME = $SERVICEHOME | ||
6 | BINARY = gnunet-service-transport | 5 | BINARY = gnunet-service-transport |
7 | #PREFIX = valgrind | 6 | #PREFIX = valgrind |
8 | NEIGHBOUR_LIMIT = 50 | 7 | NEIGHBOUR_LIMIT = 50 |
@@ -10,11 +9,11 @@ ACCEPT_FROM = 127.0.0.1; | |||
10 | ACCEPT_FROM6 = ::1; | 9 | ACCEPT_FROM6 = ::1; |
11 | PLUGINS = tcp udp | 10 | PLUGINS = tcp udp |
12 | UNIXPATH = /tmp/gnunet-service-transport.sock | 11 | UNIXPATH = /tmp/gnunet-service-transport.sock |
13 | BLACKLIST_FILE = $SERVICEHOME/blacklist | 12 | BLACKLIST_FILE = $GNUNET_CONFIG_HOME/transport/blacklist |
14 | UNIX_MATCH_UID = NO | 13 | UNIX_MATCH_UID = NO |
15 | UNIX_MATCH_GID = YES | 14 | UNIX_MATCH_GID = YES |
16 | # DISABLE_SOCKET_FORWARDING = NO | 15 | # DISABLE_SOCKET_FORWARDING = NO |
17 | # USERNAME = | 16 | # USERNAME = |
18 | # MAXBUF = | 17 | # MAXBUF = |
19 | # TIMEOUT = | 18 | # TIMEOUT = |
20 | # DISABLEV6 = | 19 | # DISABLEV6 = |
@@ -26,11 +25,11 @@ UNIX_MATCH_GID = YES | |||
26 | # Configuration settings related to traffic manipulation for testing purposes | 25 | # Configuration settings related to traffic manipulation for testing purposes |
27 | # Distance | 26 | # Distance |
28 | # MANIPULATE_DISTANCE_IN = 1 | 27 | # MANIPULATE_DISTANCE_IN = 1 |
29 | # MANIPULATE_DISTANCE_OUT = 1 | 28 | # MANIPULATE_DISTANCE_OUT = 1 |
30 | # Delay; WARNING: to large values may lead to peers not connecting! | 29 | # Delay; WARNING: to large values may lead to peers not connecting! |
31 | # MANIPULATE_DELAY_IN = 1 ms | 30 | # MANIPULATE_DELAY_IN = 1 ms |
32 | # MANIPULATE_DELAY_OUT = 1 ms | 31 | # MANIPULATE_DELAY_OUT = 1 ms |
33 | 32 | ||
34 | 33 | ||
35 | [transport-unix] | 34 | [transport-unix] |
36 | PORT = 22086 | 35 | PORT = 22086 |
@@ -79,16 +78,16 @@ TESTING_IGNORE_KEYS = ACCEPT_FROM; | |||
79 | [transport-https_server] | 78 | [transport-https_server] |
80 | # EXTERNAL_HOSTNAME = <your hostname/path> | 79 | # EXTERNAL_HOSTNAME = <your hostname/path> |
81 | # EXTERNAL_HOSTNAME_ONLY = YES | 80 | # EXTERNAL_HOSTNAME_ONLY = YES |
82 | # If you have a valid SSL certificate for your external hostname tell, | 81 | # If you have a valid SSL certificate for your external hostname tell, |
83 | # clients to verify it | 82 | # clients to verify it |
84 | # VERIFY_EXTERNAL_HOSTNAME = YES | 83 | # VERIFY_EXTERNAL_HOSTNAME = YES |
85 | # Does the external hostname use the same port? | 84 | # Does the external hostname use the same port? |
86 | # EXTERNAL_HOSTNAME_USE_PORT = YES | 85 | # EXTERNAL_HOSTNAME_USE_PORT = YES |
87 | PORT = 4433 | 86 | PORT = 4433 |
88 | ADVERTISED_PORT = 4433 | 87 | ADVERTISED_PORT = 4433 |
89 | CRYPTO_INIT = NORMAL | 88 | CRYPTO_INIT = NORMAL |
90 | KEY_FILE = $SERVICEHOME/https.key | 89 | KEY_FILE = $GNUNET_DATA_HOME/transport/https.key |
91 | CERT_FILE = $SERVICEHOME/https.cert | 90 | CERT_FILE = $GNUNET_DATA_HOME/transport/https.cert |
92 | MAX_CONNECTIONS = 128 | 91 | MAX_CONNECTIONS = 128 |
93 | TESTING_IGNORE_KEYS = ACCEPT_FROM; | 92 | TESTING_IGNORE_KEYS = ACCEPT_FROM; |
94 | 93 | ||
diff --git a/src/util/configuration.c b/src/util/configuration.c index 1b600b4c8..d7076fac1 100644 --- a/src/util/configuration.c +++ b/src/util/configuration.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | (C) 2006, 2007, 2008, 2009 Christian Grothoff (and other contributing authors) | 3 | (C) 2006, 2007, 2008, 2009, 2013 Christian Grothoff (and other contributing authors) |
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 |
@@ -414,7 +414,7 @@ GNUNET_CONFIGURATION_serialize (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
414 | } | 414 | } |
415 | /* For each key = value pair we need to add 4 characters (2 | 415 | /* For each key = value pair we need to add 4 characters (2 |
416 | spaces and 1 equal-to character and 1 new line) */ | 416 | spaces and 1 equal-to character and 1 new line) */ |
417 | m_size += strlen (ent->key) + strlen (ent->val) + 4; | 417 | m_size += strlen (ent->key) + strlen (ent->val) + 4; |
418 | } | 418 | } |
419 | } | 419 | } |
420 | /* A new line after section end */ | 420 | /* A new line after section end */ |
@@ -449,7 +449,7 @@ GNUNET_CONFIGURATION_serialize (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
449 | GNUNET_free (val); | 449 | GNUNET_free (val); |
450 | memcpy (mem + c_size, cbuf, len); | 450 | memcpy (mem + c_size, cbuf, len); |
451 | c_size += len; | 451 | c_size += len; |
452 | GNUNET_free (cbuf); | 452 | GNUNET_free (cbuf); |
453 | } | 453 | } |
454 | } | 454 | } |
455 | memcpy (mem + c_size, "\n", 1); | 455 | memcpy (mem + c_size, "\n", 1); |
@@ -993,7 +993,7 @@ GNUNET_CONFIGURATION_get_value_choice (const struct GNUNET_CONFIGURATION_Handle | |||
993 | * @param cfg configuration to inspect | 993 | * @param cfg configuration to inspect |
994 | * @param section section of interest | 994 | * @param section section of interest |
995 | * @param option option of interest | 995 | * @param option option of interest |
996 | * @return GNUNET_YES if so, GNUNET_NO if not. | 996 | * @return #GNUNET_YES if so, #GNUNET_NO if not. |
997 | */ | 997 | */ |
998 | int | 998 | int |
999 | GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle *cfg, | 999 | GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle *cfg, |
@@ -1009,71 +1009,183 @@ GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
1009 | 1009 | ||
1010 | /** | 1010 | /** |
1011 | * Expand an expression of the form "$FOO/BAR" to "DIRECTORY/BAR" | 1011 | * Expand an expression of the form "$FOO/BAR" to "DIRECTORY/BAR" |
1012 | * where either in the "PATHS" section or the environtment | 1012 | * where either in the "PATHS" section or the environtment "FOO" is |
1013 | * "FOO" is set to "DIRECTORY". | 1013 | * set to "DIRECTORY". We also support default expansion, |
1014 | * i.e. ${VARIABLE:-default} will expand to $VARIABLE if VARIABLE is | ||
1015 | * set in PATHS or the environment, and otherwise to "default". Note | ||
1016 | * that "default" itself can also be a $-expression, thus | ||
1017 | * "${VAR1:-{$VAR2}}" will expand to VAR1 and if that is not defined | ||
1018 | * to VAR2. | ||
1014 | * | 1019 | * |
1015 | * @param cfg configuration to use for path expansion | 1020 | * @param cfg configuration to use for path expansion |
1016 | * @param orig string to $-expand (will be freed!) | 1021 | * @param orig string to $-expand (will be freed!) |
1022 | * @param depth recursion depth, used to detect recursive expansions | ||
1017 | * @return $-expanded string | 1023 | * @return $-expanded string |
1018 | */ | 1024 | */ |
1019 | char * | 1025 | static char * |
1020 | GNUNET_CONFIGURATION_expand_dollar (const struct GNUNET_CONFIGURATION_Handle | 1026 | expand_dollar (const struct GNUNET_CONFIGURATION_Handle *cfg, |
1021 | *cfg, char *orig) | 1027 | char *orig, |
1028 | unsigned int depth) | ||
1022 | { | 1029 | { |
1023 | int i; | 1030 | int i; |
1024 | char *prefix; | 1031 | char *prefix; |
1025 | char *result; | 1032 | char *result; |
1033 | char *start; | ||
1026 | const char *post; | 1034 | const char *post; |
1027 | const char *env; | 1035 | const char *env; |
1036 | char *def; | ||
1037 | char *end; | ||
1038 | unsigned int lopen; | ||
1028 | 1039 | ||
1029 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Asked to $-expand %s\n", orig); | 1040 | if (depth > 128) |
1030 | 1041 | { | |
1031 | if (orig[0] != '$') | 1042 | LOG (GNUNET_ERROR_TYPE_WARNING, |
1043 | _("Recursive expansion suspected, aborting $-expansion for term `%s'\n"), | ||
1044 | orig); | ||
1045 | return orig; | ||
1046 | } | ||
1047 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
1048 | "Asked to $-expand %s\n", orig); | ||
1049 | if ('$' != orig[0]) | ||
1032 | { | 1050 | { |
1033 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Doesn't start with $ - not expanding\n"); | 1051 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1052 | "Doesn't start with $ - not expanding\n"); | ||
1034 | return orig; | 1053 | return orig; |
1035 | } | 1054 | } |
1036 | i = 0; | 1055 | if ('{' == orig[1]) |
1037 | while ((orig[i] != '/') && (orig[i] != '\\') && (orig[i] != '\0')) | ||
1038 | i++; | ||
1039 | if (orig[i] == '\0') | ||
1040 | { | 1056 | { |
1041 | post = ""; | 1057 | start = &orig[2]; |
1058 | lopen = 1; | ||
1059 | end = &orig[1]; | ||
1060 | while (lopen > 0) | ||
1061 | { | ||
1062 | end++; | ||
1063 | switch (*end) | ||
1064 | { | ||
1065 | case '}': | ||
1066 | lopen--; | ||
1067 | break; | ||
1068 | case '{': | ||
1069 | lopen++; | ||
1070 | break; | ||
1071 | case '\0': | ||
1072 | LOG (GNUNET_ERROR_TYPE_WARNING, | ||
1073 | _("Missing closing `%s' in option `%s'\n"), | ||
1074 | "}", | ||
1075 | orig); | ||
1076 | return orig; | ||
1077 | default: | ||
1078 | break; | ||
1079 | } | ||
1080 | } | ||
1081 | *end = '\0'; | ||
1082 | post = end + 1; | ||
1083 | def = strchr (orig, ':'); | ||
1084 | if (NULL != def) | ||
1085 | { | ||
1086 | *def = '\0'; | ||
1087 | def++; | ||
1088 | if ( ('-' == *def) || | ||
1089 | ('=' == *def) ) | ||
1090 | def++; | ||
1091 | def = GNUNET_strdup (def); | ||
1092 | } | ||
1042 | } | 1093 | } |
1043 | else | 1094 | else |
1044 | { | 1095 | { |
1045 | orig[i] = '\0'; | 1096 | start = &orig[1]; |
1046 | post = &orig[i + 1]; | 1097 | def = NULL; |
1098 | i = 0; | ||
1099 | while ( (orig[i] != '/') && | ||
1100 | (orig[i] != '\\') && | ||
1101 | (orig[i] != '\0') ) | ||
1102 | i++; | ||
1103 | if (orig[i] == '\0') | ||
1104 | { | ||
1105 | post = ""; | ||
1106 | } | ||
1107 | else | ||
1108 | { | ||
1109 | orig[i] = '\0'; | ||
1110 | post = &orig[i + 1]; | ||
1111 | } | ||
1047 | } | 1112 | } |
1048 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Split into `%s' and `%s'\n", orig, post); | 1113 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1114 | "Split into `%s' and `%s' with default %s\n", | ||
1115 | start, | ||
1116 | post, | ||
1117 | def); | ||
1049 | if (GNUNET_OK != | 1118 | if (GNUNET_OK != |
1050 | GNUNET_CONFIGURATION_get_value_filename (cfg, "PATHS", &orig[1], &prefix)) | 1119 | GNUNET_CONFIGURATION_get_value_filename (cfg, |
1120 | "PATHS", | ||
1121 | start, | ||
1122 | &prefix)) | ||
1051 | { | 1123 | { |
1052 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Filename for `%s' is not in PATHS config section\n", &orig[1]); | 1124 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1053 | if (NULL == (env = getenv (&orig[1]))) | 1125 | "Filename for `%s' is not in PATHS config section\n", |
1126 | start); | ||
1127 | if (NULL == (env = getenv (start))) | ||
1128 | { | ||
1129 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
1130 | "`%s' is not an environment variable\n", | ||
1131 | start); | ||
1132 | /* try default */ | ||
1133 | def = expand_dollar (cfg, def, depth + 1); | ||
1134 | env = def; | ||
1135 | } | ||
1136 | if (NULL == env) | ||
1054 | { | 1137 | { |
1055 | LOG (GNUNET_ERROR_TYPE_DEBUG, "`%s' is not an environment variable\n", &orig[1]); | 1138 | orig[strlen (orig)] = DIR_SEPARATOR; |
1056 | orig[i] = DIR_SEPARATOR; | 1139 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1057 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Expanded to `%s' (returning orig)\n", orig); | 1140 | "Expanded to `%s' (returning orig)\n", |
1141 | orig); | ||
1058 | return orig; | 1142 | return orig; |
1059 | } | 1143 | } |
1060 | prefix = GNUNET_strdup (env); | 1144 | prefix = GNUNET_strdup (env); |
1061 | } | 1145 | } |
1062 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Prefix is `%s'\n", prefix); | 1146 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1147 | "Prefix is `%s'\n", | ||
1148 | prefix); | ||
1063 | result = GNUNET_malloc (strlen (prefix) + strlen (post) + 2); | 1149 | result = GNUNET_malloc (strlen (prefix) + strlen (post) + 2); |
1064 | strcpy (result, prefix); | 1150 | strcpy (result, prefix); |
1065 | if ((strlen (prefix) == 0) || | 1151 | if ( (0 == strlen (prefix)) || |
1066 | ((prefix[strlen (prefix) - 1] != DIR_SEPARATOR) && (strlen (post) > 0))) | 1152 | ( (prefix[strlen (prefix) - 1] != DIR_SEPARATOR) && |
1153 | (strlen (post) > 0) ) ) | ||
1067 | strcat (result, DIR_SEPARATOR_STR); | 1154 | strcat (result, DIR_SEPARATOR_STR); |
1068 | strcat (result, post); | 1155 | strcat (result, post); |
1156 | GNUNET_free_non_null (def); | ||
1069 | GNUNET_free (prefix); | 1157 | GNUNET_free (prefix); |
1070 | GNUNET_free (orig); | 1158 | GNUNET_free (orig); |
1071 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Expanded to `%s'\n", result); | 1159 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1160 | "Expanded to `%s'\n", | ||
1161 | result); | ||
1072 | return result; | 1162 | return result; |
1073 | } | 1163 | } |
1074 | 1164 | ||
1075 | 1165 | ||
1076 | /** | 1166 | /** |
1167 | * Expand an expression of the form "$FOO/BAR" to "DIRECTORY/BAR" | ||
1168 | * where either in the "PATHS" section or the environtment "FOO" is | ||
1169 | * set to "DIRECTORY". We also support default expansion, | ||
1170 | * i.e. ${VARIABLE:-default} will expand to $VARIABLE if VARIABLE is | ||
1171 | * set in PATHS or the environment, and otherwise to "default". Note | ||
1172 | * that "default" itself can also be a $-expression, thus | ||
1173 | * "${VAR1:-{$VAR2}}" will expand to VAR1 and if that is not defined | ||
1174 | * to VAR2. | ||
1175 | * | ||
1176 | * @param cfg configuration to use for path expansion | ||
1177 | * @param orig string to $-expand (will be freed!) | ||
1178 | * @return $-expanded string | ||
1179 | */ | ||
1180 | char * | ||
1181 | GNUNET_CONFIGURATION_expand_dollar (const struct GNUNET_CONFIGURATION_Handle *cfg, | ||
1182 | char *orig) | ||
1183 | { | ||
1184 | return expand_dollar (cfg, orig, 0); | ||
1185 | } | ||
1186 | |||
1187 | |||
1188 | /** | ||
1077 | * Get a configuration value that should be a string. | 1189 | * Get a configuration value that should be a string. |
1078 | * | 1190 | * |
1079 | * @param cfg configuration to inspect | 1191 | * @param cfg configuration to inspect |
diff --git a/src/util/disk.c b/src/util/disk.c index 8dc1e35bf..0d24d5a09 100644 --- a/src/util/disk.c +++ b/src/util/disk.c | |||
@@ -1928,78 +1928,6 @@ GNUNET_DISK_get_handle_from_native (FILE *fd) | |||
1928 | 1928 | ||
1929 | 1929 | ||
1930 | /** | 1930 | /** |
1931 | * Construct full path to a file inside of the private | ||
1932 | * directory used by GNUnet. Also creates the corresponding | ||
1933 | * directory. If the resulting name is supposed to be | ||
1934 | * a directory, end the last argument in '/' (or pass | ||
1935 | * DIR_SEPARATOR_STR as the last argument before NULL). | ||
1936 | * | ||
1937 | * @param cfg configuration to use (determines HOME) | ||
1938 | * @param service_name name of the service | ||
1939 | * @param ... is NULL-terminated list of | ||
1940 | * path components to append to the | ||
1941 | * private directory name. | ||
1942 | * @return the constructed filename | ||
1943 | */ | ||
1944 | char * | ||
1945 | GNUNET_DISK_get_home_filename (const struct GNUNET_CONFIGURATION_Handle *cfg, | ||
1946 | const char *service_name, ...) | ||
1947 | { | ||
1948 | const char *c; | ||
1949 | char *pfx; | ||
1950 | char *ret; | ||
1951 | va_list ap; | ||
1952 | unsigned int needed; | ||
1953 | |||
1954 | if (GNUNET_OK != | ||
1955 | GNUNET_CONFIGURATION_get_value_filename (cfg, service_name, "HOME", &pfx)) | ||
1956 | return NULL; | ||
1957 | if (pfx == NULL) | ||
1958 | { | ||
1959 | LOG (GNUNET_ERROR_TYPE_WARNING, | ||
1960 | _("No `%s' specified for service `%s' in configuration.\n"), "HOME", | ||
1961 | service_name); | ||
1962 | return NULL; | ||
1963 | } | ||
1964 | needed = strlen (pfx) + 2; | ||
1965 | if ((pfx[strlen (pfx) - 1] != '/') && (pfx[strlen (pfx) - 1] != '\\')) | ||
1966 | needed++; | ||
1967 | va_start (ap, service_name); | ||
1968 | while (1) | ||
1969 | { | ||
1970 | c = va_arg (ap, const char *); | ||
1971 | |||
1972 | if (c == NULL) | ||
1973 | break; | ||
1974 | needed += strlen (c); | ||
1975 | if ((c[strlen (c) - 1] != '/') && (c[strlen (c) - 1] != '\\')) | ||
1976 | needed++; | ||
1977 | } | ||
1978 | va_end (ap); | ||
1979 | ret = GNUNET_malloc (needed); | ||
1980 | strcpy (ret, pfx); | ||
1981 | GNUNET_free (pfx); | ||
1982 | va_start (ap, service_name); | ||
1983 | while (1) | ||
1984 | { | ||
1985 | c = va_arg (ap, const char *); | ||
1986 | |||
1987 | if (c == NULL) | ||
1988 | break; | ||
1989 | if ((c[strlen (c) - 1] != '/') && (c[strlen (c) - 1] != '\\')) | ||
1990 | strcat (ret, DIR_SEPARATOR_STR); | ||
1991 | strcat (ret, c); | ||
1992 | } | ||
1993 | va_end (ap); | ||
1994 | if ((ret[strlen (ret) - 1] != '/') && (ret[strlen (ret) - 1] != '\\')) | ||
1995 | (void) GNUNET_DISK_directory_create_for_file (ret); | ||
1996 | else | ||
1997 | (void) GNUNET_DISK_directory_create (ret); | ||
1998 | return ret; | ||
1999 | } | ||
2000 | |||
2001 | |||
2002 | /** | ||
2003 | * Handle for a memory-mapping operation. | 1931 | * Handle for a memory-mapping operation. |
2004 | */ | 1932 | */ |
2005 | struct GNUNET_DISK_MapHandle | 1933 | struct GNUNET_DISK_MapHandle |
diff --git a/src/util/os_installation.c b/src/util/os_installation.c index 98ac7b989..8649fac6f 100644 --- a/src/util/os_installation.c +++ b/src/util/os_installation.c | |||
@@ -43,6 +43,7 @@ | |||
43 | 43 | ||
44 | #define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file (kind, "util", syscall, filename) | 44 | #define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file (kind, "util", syscall, filename) |
45 | 45 | ||
46 | |||
46 | #if LINUX | 47 | #if LINUX |
47 | /** | 48 | /** |
48 | * Try to determine path by reading /proc/PID/exe | 49 | * Try to determine path by reading /proc/PID/exe |
@@ -115,12 +116,13 @@ get_path_from_proc_exe () | |||
115 | } | 116 | } |
116 | #endif | 117 | #endif |
117 | 118 | ||
118 | #if WINDOWS | ||
119 | 119 | ||
120 | #if WINDOWS | ||
120 | static HINSTANCE dll_instance; | 121 | static HINSTANCE dll_instance; |
121 | 122 | ||
122 | 123 | ||
123 | /* GNUNET_util_cl_init() in common_logging.c is preferred. | 124 | /** |
125 | * GNUNET_util_cl_init() in common_logging.c is preferred. | ||
124 | * This function is only for thread-local storage (not used in GNUnet) | 126 | * This function is only for thread-local storage (not used in GNUnet) |
125 | * and hInstance saving. | 127 | * and hInstance saving. |
126 | */ | 128 | */ |
@@ -226,6 +228,7 @@ get_path_from_module_filename () | |||
226 | } | 228 | } |
227 | #endif | 229 | #endif |
228 | 230 | ||
231 | |||
229 | #if DARWIN | 232 | #if DARWIN |
230 | /** | 233 | /** |
231 | * Signature of the '_NSGetExecutablePath" function. | 234 | * Signature of the '_NSGetExecutablePath" function. |
@@ -415,8 +418,7 @@ os_get_gnunet_path () | |||
415 | return ret; | 418 | return ret; |
416 | /* other attempts here */ | 419 | /* other attempts here */ |
417 | LOG (GNUNET_ERROR_TYPE_ERROR, | 420 | LOG (GNUNET_ERROR_TYPE_ERROR, |
418 | _ | 421 | _("Could not determine installation path for %s. Set `%s' environment variable.\n"), |
419 | ("Could not determine installation path for %s. Set `%s' environment variable.\n"), | ||
420 | "GNUnet", "GNUNET_PREFIX"); | 422 | "GNUnet", "GNUNET_PREFIX"); |
421 | return NULL; | 423 | return NULL; |
422 | } | 424 | } |
@@ -452,7 +454,7 @@ os_get_exec_path () | |||
452 | 454 | ||
453 | /** | 455 | /** |
454 | * @brief get the path to a specific GNUnet installation directory or, | 456 | * @brief get the path to a specific GNUnet installation directory or, |
455 | * with GNUNET_IPK_SELF_PREFIX, the current running apps installation directory | 457 | * with #GNUNET_IPK_SELF_PREFIX, the current running apps installation directory |
456 | * @author Milan | 458 | * @author Milan |
457 | * @return a pointer to the dir path (to be freed by the caller) | 459 | * @return a pointer to the dir path (to be freed by the caller) |
458 | */ | 460 | */ |
@@ -657,9 +659,9 @@ GNUNET_OS_get_libexec_binary_path (const char *progname) | |||
657 | * binary with the -d flag. -d omits a programs main loop and only | 659 | * binary with the -d flag. -d omits a programs main loop and only |
658 | * executes all privileged operations in an binary. | 660 | * executes all privileged operations in an binary. |
659 | * @param params parameters used for w32 privilege checking (can be NULL for != w32 ) | 661 | * @param params parameters used for w32 privilege checking (can be NULL for != w32 ) |
660 | * @return GNUNET_YES if the file is SUID (*nix) or can be executed with current privileges (W32), | 662 | * @return #GNUNET_YES if the file is SUID (*nix) or can be executed with current privileges (W32), |
661 | * GNUNET_NO if not SUID (but binary exists), | 663 | * #GNUNET_NO if not SUID (but binary exists), |
662 | * GNUNET_SYSERR on error (no such binary or not executable) | 664 | * #GNUNET_SYSERR on error (no such binary or not executable) |
663 | */ | 665 | */ |
664 | int | 666 | int |
665 | GNUNET_OS_check_helper_binary (const char *binary, int check_suid, const char *params) | 667 | GNUNET_OS_check_helper_binary (const char *binary, int check_suid, const char *params) |
@@ -704,7 +706,8 @@ GNUNET_OS_check_helper_binary (const char *binary, int check_suid, const char *p | |||
704 | #endif | 706 | #endif |
705 | if (NULL == p) | 707 | if (NULL == p) |
706 | { | 708 | { |
707 | LOG (GNUNET_ERROR_TYPE_INFO, _("Could not find binary `%s' in PATH!\n"), | 709 | LOG (GNUNET_ERROR_TYPE_INFO, |
710 | _("Could not find binary `%s' in PATH!\n"), | ||
708 | binary); | 711 | binary); |
709 | return GNUNET_SYSERR; | 712 | return GNUNET_SYSERR; |
710 | } | 713 | } |
diff --git a/src/util/resolver.conf.in b/src/util/resolver.conf.in index cccb60c2f..42cc5855f 100644 --- a/src/util/resolver.conf.in +++ b/src/util/resolver.conf.in | |||
@@ -2,7 +2,6 @@ | |||
2 | AUTOSTART = YES | 2 | AUTOSTART = YES |
3 | @JAVAPORT@PORT = 2089 | 3 | @JAVAPORT@PORT = 2089 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | HOME = $SERVICEHOME | ||
6 | BINARY = gnunet-service-resolver | 5 | BINARY = gnunet-service-resolver |
7 | ACCEPT_FROM = 127.0.0.1; | 6 | ACCEPT_FROM = 127.0.0.1; |
8 | ACCEPT_FROM6 = ::1; | 7 | ACCEPT_FROM6 = ::1; |
diff --git a/src/util/test_disk.c b/src/util/test_disk.c index 7579ac7dc..40e6b079c 100644 --- a/src/util/test_disk.c +++ b/src/util/test_disk.c | |||
@@ -169,27 +169,6 @@ testDirIter () | |||
169 | 169 | ||
170 | 170 | ||
171 | static int | 171 | static int |
172 | testGetHome () | ||
173 | { | ||
174 | struct GNUNET_CONFIGURATION_Handle *cfg; | ||
175 | char *fn; | ||
176 | int ret; | ||
177 | |||
178 | cfg = GNUNET_CONFIGURATION_create (); | ||
179 | GNUNET_assert (cfg != NULL); | ||
180 | GNUNET_CONFIGURATION_set_value_string (cfg, "service", "HOME", | ||
181 | "/tmp/test-gnunet-disk-a/b/c"); | ||
182 | fn = GNUNET_DISK_get_home_filename (cfg, "service", "d", "e", NULL); | ||
183 | GNUNET_assert (fn != NULL); | ||
184 | GNUNET_CONFIGURATION_destroy (cfg); | ||
185 | ret = strcmp ("/tmp/test-gnunet-disk-a/b/c/d/e", fn); | ||
186 | GNUNET_free (fn); | ||
187 | GNUNET_break (GNUNET_OK == | ||
188 | GNUNET_DISK_directory_remove ("/tmp/test-gnunet-disk-a")); | ||
189 | return ret; | ||
190 | } | ||
191 | |||
192 | static int | ||
193 | testCanonicalize () | 172 | testCanonicalize () |
194 | { | 173 | { |
195 | char *fn = GNUNET_strdup ("ab?><|cd*ef:/g\""); | 174 | char *fn = GNUNET_strdup ("ab?><|cd*ef:/g\""); |
@@ -246,7 +225,6 @@ main (int argc, char *argv[]) | |||
246 | failureCount += testOpenClose (); | 225 | failureCount += testOpenClose (); |
247 | failureCount += testDirScan (); | 226 | failureCount += testDirScan (); |
248 | failureCount += testDirIter (); | 227 | failureCount += testDirIter (); |
249 | failureCount += testGetHome (); | ||
250 | failureCount += testCanonicalize (); | 228 | failureCount += testCanonicalize (); |
251 | failureCount += testChangeOwner (); | 229 | failureCount += testChangeOwner (); |
252 | failureCount += testDirMani (); | 230 | failureCount += testDirMani (); |
diff --git a/src/util/util.conf b/src/util/util.conf index ade7786ad..b7f9deb04 100644 --- a/src/util/util.conf +++ b/src/util/util.conf | |||
@@ -1,20 +1,41 @@ | |||
1 | [PATHS] | 1 | [PATHS] |
2 | # The PATHS section is special, as filenames including $-expression are | ||
3 | # expanded using the values from PATHS or the system environment (PATHS | ||
4 | # is checked first). GNUnet also supports expanding $-expressions using | ||
5 | # defaults with the syntax "${VAR:-default}". Here, "default" can again | ||
6 | # be a $-expression. | ||
7 | # | ||
2 | GNUNET_HOME = $HOME | 8 | GNUNET_HOME = $HOME |
3 | GNUNET_DATA_HOME = $GNUNET_HOME/.local/share/gnunet/ | ||
4 | GNUNET_CONFIG_HOME = $GNUNET_HOME/.config/gnunet/ | ||
5 | GNUNET_CACHE_HOME = $GNUNET_HOME/.cache/gnunet/ | ||
6 | GNUNET_RUNTIME_DIR = $GNUNET_HOME/.runtime/gnunet/ | ||
7 | 9 | ||
10 | # see XDG Base Directory Specification at | ||
11 | # http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html | ||
12 | # for how these should be used. | ||
8 | 13 | ||
14 | # Persistant data storage | ||
15 | GNUNET_DATA_HOME = ${XDG_DATA_HOME:-$GNUNET_HOME/.local/share}/gnunet/ | ||
16 | |||
17 | # Configuration files | ||
18 | GNUNET_CONFIG_HOME = ${XDG_CONFIG_HOME:-GNUNET_HOME/.config/}gnunet/ | ||
19 | |||
20 | # Cached data, no big deal if lost | ||
21 | GNUNET_CACHE_HOME = ${XDG_CACHE_HOME:-$GNUNET_HOME/.cache/}gnunet/ | ||
22 | |||
23 | # Runtime data (i.e UNIX domain sockets, locks, always lost on system boot) | ||
24 | GNUNET_RUNTIME_DIR = ${XDG_RUNTIME_DIR:-${TMPDIR:-${TMP:-/tmp}}}gnunet/ | ||
25 | |||
26 | # Legacy option... | ||
9 | SERVICEHOME = ~/.gnunet/ | 27 | SERVICEHOME = ~/.gnunet/ |
10 | # SERVICEHOME = /var/lib/gnunet/ | 28 | # SERVICEHOME = /var/lib/gnunet/ |
29 | |||
11 | # DEFAULTCONFIG = /etc/gnunet.conf | 30 | # DEFAULTCONFIG = /etc/gnunet.conf |
12 | # If 'DEFAULTCONFIG' is not defined, the current | 31 | # If 'DEFAULTCONFIG' is not defined, the current |
13 | # configuration file is assumed to be the default, | 32 | # configuration file is assumed to be the default, |
14 | # which is what we want by default... | 33 | # which is what we want by default... |
15 | 34 | ||
35 | |||
16 | [PEER] | 36 | [PEER] |
17 | PRIVATE_KEY = $SERVICEHOME/private_key.ecc | 37 | PRIVATE_KEY = $GNUNET_DATA_HOME/private_key.ecc |
38 | |||
18 | 39 | ||
19 | [TESTING] | 40 | [TESTING] |
20 | SPEEDUP_INTERVAL = 0 ms | 41 | SPEEDUP_INTERVAL = 0 ms |
diff --git a/src/vpn/vpn.conf.in b/src/vpn/vpn.conf.in index 57657b94f..91610eb2a 100644 --- a/src/vpn/vpn.conf.in +++ b/src/vpn/vpn.conf.in | |||
@@ -2,7 +2,6 @@ | |||
2 | AUTOSTART = YES | 2 | AUTOSTART = YES |
3 | @UNIXONLY@ PORT = 2105 | 3 | @UNIXONLY@ PORT = 2105 |
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | HOME = $SERVICEHOME | ||
6 | BINARY = gnunet-service-vpn | 5 | BINARY = gnunet-service-vpn |
7 | ACCEPT_FROM = 127.0.0.1; | 6 | ACCEPT_FROM = 127.0.0.1; |
8 | ACCEPT_FROM6 = ::1; | 7 | ACCEPT_FROM6 = ::1; |