From 878ddb135d4fe45be7612af42a00d7c483c2cc6a Mon Sep 17 00:00:00 2001 From: Andrew Bettison Date: Tue, 15 Oct 2013 11:15:31 +1030 Subject: [PATCH 1/4] Fix sprintf(3) formats - change some %d to %u --- rhizome_database.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rhizome_database.c b/rhizome_database.c index 3407aae4..cef548ab 100644 --- a/rhizome_database.c +++ b/rhizome_database.c @@ -661,7 +661,7 @@ int _sqlite_vbind(struct __sourceloc __whence, int log_level, sqlite_retry_state BIND_NULL(SID_T); } else { const char *sid_hex = alloca_tohex_sid_t(*sidp); - BIND_DEBUG(SID_T, sqlite3_bind_text, "%s,%d,SQLITE_TRANSIENT", sid_hex, SID_STRLEN); + BIND_DEBUG(SID_T, sqlite3_bind_text, "%s,%u,SQLITE_TRANSIENT", sid_hex, SID_STRLEN); BIND_RETRY(sqlite3_bind_text, sid_hex, SID_STRLEN, SQLITE_TRANSIENT); } } @@ -673,7 +673,7 @@ int _sqlite_vbind(struct __sourceloc __whence, int log_level, sqlite_retry_state BIND_NULL(RHIZOME_BID_T); } else { const char *bid_hex = alloca_tohex_rhizome_bid_t(*bidp); - BIND_DEBUG(RHIZOME_BID_T, sqlite3_bind_text, "%s,%d,SQLITE_TRANSIENT", bid_hex, RHIZOME_MANIFEST_ID_STRLEN); + BIND_DEBUG(RHIZOME_BID_T, sqlite3_bind_text, "%s,%u,SQLITE_TRANSIENT", bid_hex, RHIZOME_MANIFEST_ID_STRLEN); BIND_RETRY(sqlite3_bind_text, bid_hex, RHIZOME_MANIFEST_ID_STRLEN, SQLITE_TRANSIENT); } } @@ -686,7 +686,7 @@ int _sqlite_vbind(struct __sourceloc __whence, int log_level, sqlite_retry_state } else { char hash_hex[RHIZOME_FILEHASH_STRLEN]; tohex(hash_hex, sizeof hash_hex, hashp->binary); - BIND_DEBUG(RHIZOME_FILEHASH_T, sqlite3_bind_text, "%s,%zd,SQLITE_TRANSIENT", hash_hex, sizeof hash_hex); + BIND_DEBUG(RHIZOME_FILEHASH_T, sqlite3_bind_text, "%s,%zu,SQLITE_TRANSIENT", hash_hex, sizeof hash_hex); BIND_RETRY(sqlite3_bind_text, hash_hex, sizeof hash_hex, SQLITE_TRANSIENT); } } @@ -699,7 +699,7 @@ int _sqlite_vbind(struct __sourceloc __whence, int log_level, sqlite_retry_state BIND_NULL(TOHEX); } else { const char *hex = alloca_tohex(binary, bytes); - BIND_DEBUG(TOHEX, sqlite3_bind_text, "%s,%d,SQLITE_TRANSIENT", hex, bytes * 2); + BIND_DEBUG(TOHEX, sqlite3_bind_text, "%s,%u,SQLITE_TRANSIENT", hex, bytes * 2); BIND_RETRY(sqlite3_bind_text, hex, bytes * 2, SQLITE_TRANSIENT); } } @@ -713,7 +713,7 @@ int _sqlite_vbind(struct __sourceloc __whence, int log_level, sqlite_retry_state unsigned bytes = strlen(text); char upper[bytes + 1]; str_toupper_inplace(strcpy(upper, text)); - BIND_DEBUG(TEXT_TOUPPER, sqlite3_bind_text, "%s,%d,SQLITE_TRANSIENT", alloca_toprint(-1, upper, bytes), bytes); + BIND_DEBUG(TEXT_TOUPPER, sqlite3_bind_text, "%s,%u,SQLITE_TRANSIENT", alloca_toprint(-1, upper, bytes), bytes); BIND_RETRY(sqlite3_bind_text, upper, bytes, SQLITE_TRANSIENT); } } @@ -729,7 +729,7 @@ int _sqlite_vbind(struct __sourceloc __whence, int log_level, sqlite_retry_state unsigned i; for (i = 0; i != bytes; ++i) upper[i] = toupper(text[i]); - BIND_DEBUG(TEXT_LEN_TOUPPER, sqlite3_bind_text, "%s,%d,SQLITE_TRANSIENT", alloca_toprint(-1, upper, bytes), bytes); + BIND_DEBUG(TEXT_LEN_TOUPPER, sqlite3_bind_text, "%s,%u,SQLITE_TRANSIENT", alloca_toprint(-1, upper, bytes), bytes); BIND_RETRY(sqlite3_bind_text, upper, bytes, SQLITE_TRANSIENT); } } From d5d5737f1cc74c639782a4111dc158d8b0307b02 Mon Sep 17 00:00:00 2001 From: Jeremy Lakeman Date: Mon, 14 Oct 2013 15:40:42 +1030 Subject: [PATCH 2/4] Rename 'id revoke' to 'id relinquish' to match documentation --- commandline.c | 4 ++-- tests/keyring | 4 ++-- tests/routing | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/commandline.c b/commandline.c index 74ed1da3..b8e1e469 100644 --- a/commandline.c +++ b/commandline.c @@ -2614,9 +2614,9 @@ struct cli_schema command_line_options[]={ "Return identity(s) as URIs of own node, or of known routable peers, or all known peers"}, {app_id_pin, {"id", "enter", "pin", "", NULL}, 0, "Unlock any pin protected identities and enable routing packets to them"}, - {app_revoke_pin, {"id", "revoke", "pin", "", NULL}, 0, + {app_revoke_pin, {"id", "relinquish", "pin", "", NULL}, 0, "Unload any identities protected by this pin and drop all routes to them"}, - {app_revoke_pin, {"id", "revoke", "sid", "", NULL}, 0, + {app_revoke_pin, {"id", "relinquish", "sid", "", NULL}, 0, "Unload a specific identity and drop all routes to it"}, {app_route_print, {"route","print",NULL}, 0, "Print the routing table"}, diff --git a/tests/keyring b/tests/keyring index 4c93ff67..dc4ff125 100755 --- a/tests/keyring +++ b/tests/keyring @@ -235,13 +235,13 @@ test_KeyringEntryPinServer() { assertStdoutGrep --fixed-strings "$ONE" assertStdoutGrep --fixed-strings "$TWOA" assertStdoutGrep --fixed-strings "$TWOB" - executeOk_servald id revoke pin 'one' + executeOk_servald id relinquish pin 'one' executeOk_servald id self assertStdoutLineCount == 3 assertStdoutGrep --fixed-strings "$SIDA" assertStdoutGrep --fixed-strings "$TWOA" assertStdoutGrep --fixed-strings "$TWOB" - executeOk_servald id revoke sid "$TWOB" + executeOk_servald id relinquish sid "$TWOB" tfw_cat --stderr executeOk_servald id self assertStdoutLineCount == 2 diff --git a/tests/routing b/tests/routing index 0ecd82b1..8b15cbbd 100755 --- a/tests/routing +++ b/tests/routing @@ -164,7 +164,7 @@ test_unlock_ids() { executeOk_servald id enter pin 'entry-pin' wait_until has_link +B +A +A $SIDA $SIDX set_instance +A - executeOk_servald id revoke pin 'entry-pin' + executeOk_servald id relinquish pin 'entry-pin' set_instance +B wait_until --timeout=30 sid_offline $SIDX } From 6ee774f10b4be1cee9cb576a345c50e24a7a4677 Mon Sep 17 00:00:00 2001 From: gardners Date: Sun, 20 Oct 2013 14:59:00 -0700 Subject: [PATCH 3/4] build when not in git repostory. --- version_string.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/version_string.sh b/version_string.sh index 066a2816..0a7cd3df 100755 --- a/version_string.sh +++ b/version_string.sh @@ -17,6 +17,11 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +if [ ! -e .git ]; then + echo "UNKNOWN-VERSION" + exit +fi + usage() { echo "Usage: ${0##*/} [options]"' From 37316abe0f6ae38b915d67a13b878e59e7288bcd Mon Sep 17 00:00:00 2001 From: Jeremy Lakeman Date: Mon, 21 Oct 2013 13:23:02 +1030 Subject: [PATCH 4/4] Fix empty if test typo --- route_link.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/route_link.c b/route_link.c index 8ac806b5..5fa4edec 100644 --- a/route_link.c +++ b/route_link.c @@ -1195,7 +1195,7 @@ int link_received_packet(struct decode_context *context, int sender_seq, char un // force an update when we start hearing a new neighbour link if (link->link_timeout < now){ - if (neighbour->next_neighbour_update > now + 10); + if (neighbour->next_neighbour_update > now + 10) neighbour->next_neighbour_update = now + 10; } link->link_timeout = now + (context->interface->destination->tick_ms *5);