You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
497 B

#!/bin/bash
# Author: Iain Douglas <centos@1n6.org.uk>
# Check that the user can change their primary group. This relies on the
# observation that the current primary group is printed first
#
t_Log "Running $0 - Basic newgrp test"
groups testshadow | grep -q "testshadow testgroup" || { t_Log "FAIL: Default testshadow user group information incorrect"; exit $FAIL; }
echo OK
echo $( su - testshadow <<EOF
newgrp testgroup
groups
exit
EOF
) | grep -q "testgroup testshadow"
t_CheckExitStatus $?