[lxc-devel] [lxc/master] cmd/lxc-update-config: check for empty arguments
brauner on Github
lxc-bot at linuxcontainers.org
Sat Feb 17 12:37:22 UTC 2018
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 364 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180217/5da44b02/attachment.bin>
-------------- next part --------------
From a514f2d9432145afd50791e7cb27673956e7a64e Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Sat, 17 Feb 2018 13:36:31 +0100
Subject: [PATCH] cmd/lxc-update-config: check for empty arguments
Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
src/lxc/cmd/lxc-update-config.in | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/lxc/cmd/lxc-update-config.in b/src/lxc/cmd/lxc-update-config.in
index 785322c38..fd9110345 100644
--- a/src/lxc/cmd/lxc-update-config.in
+++ b/src/lxc/cmd/lxc-update-config.in
@@ -14,6 +14,12 @@ EOF
return 0
}
+# Check whether any arguments are provided.
+if [ $# -eq 0 ]; then
+ usage "${0}"
+ exit 0
+fi
+
OPTIONS=$(getopt -o c:h --long config:,help -- "${@}")
eval set -- "${OPTIONS}"
More information about the lxc-devel
mailing list