File tree Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -1443,6 +1443,13 @@ _allowed_groups()
14431443 fi
14441444}
14451445
1446+ _comp_selinux_users ()
1447+ {
1448+ COMPREPLY+=($( compgen -W ' $(
1449+ semanage user -nl 2>/dev/null | awk "{ print \$1 }"
1450+ )' -- " $cur " ) )
1451+ }
1452+
14461453# This function completes on valid shells
14471454#
14481455# @param $1 chroot to search from
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ _useradd()
1919
2020 case $prev in
2121 --comment | --help | --expiredate | --inactive | --key | --password | \
22- --uid | --selinux-user | - ! (-* )[chefKpuZ ])
22+ --uid | -! (-* )[chefKpu ])
2323 return
2424 ;;
2525 --base-dir | --home-dir | --skel | --root | -! (-* )[bdkR])
@@ -35,6 +35,10 @@ _useradd()
3535 _comp_delimited , -g
3636 return
3737 ;;
38+ --selinux-user | -! (-* )Z)
39+ _comp_selinux_users
40+ return
41+ ;;
3842 --shell | -! (-* )s)
3943 _shells " ${chroot-} "
4044 return
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ _usermod()
1919
2020 case $prev in
2121 --comment | --home | --expiredate | --inactive | --help | --login | \
22- --password | --uid | --selinux-user | - ! (-* )[cdefhlpuZ ])
22+ --password | --uid | -! (-* )[cdefhlpu ])
2323 return
2424 ;;
2525 --gid | -! (-* )g)
@@ -35,6 +35,10 @@ _usermod()
3535 _filedir -d
3636 return
3737 ;;
38+ --selinux-user | -! (-* )Z)
39+ _comp_selinux_users
40+ return
41+ ;;
3842 --shell | -! (-* )s)
3943 _shells " ${chroot-} "
4044 return
You can’t perform that action at this time.
0 commit comments