summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorho <ho@openbsd.org>2003-04-27 11:16:24 +0000
committerho <ho@openbsd.org>2003-04-27 11:16:24 +0000
commitdffb8b340a6225f17f54c86bc5e6724a6af6e3f7 (patch)
treed47003eadb5a237ff228357b21f88468459e0544
parentstring cleaning; from tdeval and tedu (diff)
downloadwireguard-openbsd-dffb8b340a6225f17f54c86bc5e6724a6af6e3f7.tar.xz
wireguard-openbsd-dffb8b340a6225f17f54c86bc5e6724a6af6e3f7.zip
Make the 'C set' FIFO command work as expected. PR#3148.
-rw-r--r--sbin/isakmpd/ui.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sbin/isakmpd/ui.c b/sbin/isakmpd/ui.c
index 13b9d5564be..ef5a557337c 100644
--- a/sbin/isakmpd/ui.c
+++ b/sbin/isakmpd/ui.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ui.c,v 1.30 2002/06/09 08:13:07 todd Exp $ */
+/* $OpenBSD: ui.c,v 1.31 2003/04/27 11:16:24 ho Exp $ */
/* $EOM: ui.c,v 1.43 2000/10/05 09:25:12 niklas Exp $ */
/*
@@ -152,8 +152,8 @@ ui_teardown_all (char *cmd)
static void
ui_config (char *cmd)
{
- char subcmd[81], section[81], tag[81], value[81];
- int override, trans = 0;
+ char subcmd[81], section[81], tag[81], value[81], tmp[81];
+ int trans = 0, items;
if (sscanf (cmd, "C %80s", subcmd) != 1)
goto fail;
@@ -161,10 +161,11 @@ ui_config (char *cmd)
trans = conf_begin ();
if (strcasecmp (subcmd, "set") == 0)
{
- if (sscanf (cmd, "C %*s [%80[^]]]:%80[^=]=%80s %d", section, tag, value,
- &override) != 4)
+ items = sscanf (cmd, "C %*s [%80[^]]]:%80[^=]=%80s %80s", section, tag,
+ value, tmp);
+ if (!(items == 3 || items == 4))
goto fail;
- conf_set (trans, section, tag, value, override, 0);
+ conf_set (trans, section, tag, value, items == 4 ? 1 : 0, 0);
}
else if (strcasecmp (subcmd, "rm") == 0)
{