From ac0aea9c83b5b18ee427770df49e4442bec4e5ee Mon Sep 17 00:00:00 2001 From: alexhudson Date: Wed, 27 Jun 2007 12:23:05 +0000 Subject: [PATCH] Fix bug where the store couldn't bind to port 689 on setup --- src/apps/config/config.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/apps/config/config.c b/src/apps/config/config.c index beac201..2653105 100644 --- a/src/apps/config/config.c +++ b/src/apps/config/config.c @@ -438,8 +438,6 @@ main(int argc, char *argv[]) { return 1; } - RunAsBongoUser(); - // parse options while (++next_arg < argc && argv[next_arg][0] == '-') { char *arg = argv[next_arg]; @@ -476,11 +474,13 @@ main(int argc, char *argv[]) { usage(); } + // unusual libgcrypt options must occur before XplInit() if (command == 2) { gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0); } XplInit(); + // we don't want to setup libraries unless we need to (e.g., to run an agent) if (command == 1) { startup = BA_STARTUP_CONNIO; if (-1 == BongoAgentInit(&configtool, "bongoconfig", "", DEFAULT_CONNECTION_TIMEOUT, startup)) { @@ -489,6 +489,11 @@ main(int argc, char *argv[]) { } } + // don't give away privileges if we're going to need them later. + if (command != 1) { + RunAsBongoUser(); + } + switch(command) { case 1: InitialStoreConfiguration();