From 0e3c7545cc2d082c2f7a1b381058c46e0d064fe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Gr=C3=A9goire?= Date: Sun, 27 Aug 2017 08:56:34 -0400 Subject: [PATCH] __user_groups: Support OpenBSD OpenBSD's usermod(8) interface is similary to NetBSD's. This commit makes __user_groups support it explicitly. https://man.openbsd.org/usermod.8 http://netbsd.gw.com/cgi-bin/man-cgi?usermod++NetBSD-current --- cdist/conf/type/__user_groups/gencode-remote | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cdist/conf/type/__user_groups/gencode-remote b/cdist/conf/type/__user_groups/gencode-remote index a69d6997..8120761a 100755 --- a/cdist/conf/type/__user_groups/gencode-remote +++ b/cdist/conf/type/__user_groups/gencode-remote @@ -42,10 +42,10 @@ if [ -z "$changed_groups" ]; then fi for group in $changed_groups; do - if [ "$os" = "netbsd" ]; then + if [ "$os" = "netbsd" ] || [ "$os" = "openbsd" ]; then case "$state_should" in present) echo "usermod -G \"$group\" \"$user\"" ;; - absent) echo 'NetBSD does not have a command to remove a user from a group' >&2 ; exit 1 ;; + absent) echo 'NetBSD and OpenBSD do not have a command to remove a user from a group' >&2 ; exit 1 ;; esac elif [ "$os" = "freebsd" ]; then case "$state_should" in