Skip to content

Commit aa6a219

Browse files
committed
[type/__group] Fix SC3037
Just like for __user in previous commit.
1 parent 0315ec5 commit aa6a219

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

type/__group/gencode-remote/groupmod.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,20 @@ shorten_groupmod_property() {
3535
properties_to_groupmod_argv() {
3636
for __group_prop in "$@"
3737
do
38-
__groupmod_opt=$(shorten_groupmod_property "${__group_prop%%=*}")
38+
# we need to shorten options for both groupmod and groupadd since on
39+
# some systems (such as *BSD, Darwin) those commands do not handle
40+
# GNU-style long options.
41+
case ${__group_prop%%=*}
42+
in
43+
(gid)
44+
__groupmod_opt='-g' ;;
45+
(password)
46+
__groupmod_opt='-p' ;;
47+
(system)
48+
__groupmod_opt='-r' ;;
49+
(*)
50+
return 1 ;;
51+
esac
3952

4053
case ${__groupmod_opt-},${__group_prop-}
4154
in

0 commit comments

Comments
 (0)