summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--setup-user.in4
-rwxr-xr-xtests/setup_user_test9
2 files changed, 13 insertions, 0 deletions
diff --git a/setup-user.in b/setup-user.in
index 82c2f38..a61749c 100644
--- a/setup-user.in
+++ b/setup-user.in
@@ -38,6 +38,10 @@ while getopts "af:g:hk:u" opt; do
done
shift $(($OPTIND - 1))
+if [ -z "$admin$fullnameopt$groups$keysopt$forceunlock" ] && [ "$1" = "none" ]; then
+ exit 0
+fi
+
if [ $# -gt 1 ]; then
usage "1" >&2
elif [ $# -eq 1 ]; then
diff --git a/tests/setup_user_test b/tests/setup_user_test
index 2211f67..6b17d94 100755
--- a/tests/setup_user_test
+++ b/tests/setup_user_test
@@ -3,6 +3,7 @@
. $(atf_get_srcdir)/test_env.sh
init_tests \
setup_user_usage \
+ setup_user_none \
setup_user_fullname \
setup_user_interactive_no \
setup_user_interactive \
@@ -28,6 +29,14 @@ setup_user_body() {
setup-user testuser
}
+setup_user_none_body () {
+ init_env
+ atf_check -s exit:0 \
+ -o empty \
+ -e empty \
+ setup-user none
+}
+
setup_user_fullname_body() {
init_env
atf_check -s exit:0 \