|
Lines 1583-1598
Link Here
|
| 1583 |
|
1583 |
|
| 1584 |
# make sure that the user and group are setup and working |
1584 |
# make sure that the user and group are setup and working |
| 1585 |
# |
1585 |
# |
| 1586 |
# using 'id' means that we can only accept usernames and |
1586 |
|
| 1587 |
# group names. UIDs and GIDs aren't supported by id(1) |
1587 |
# dispatch on type ;) but you can't mix names and numbers |
| 1588 |
|
1588 |
if [[ "$G_CONFIG_UID" = *[^0-9]* ]];then |
| 1589 |
libsh_everbose libsh_einfo "Checking that the username:group '$G_CONFIG_UID:$G_CONFIG_GID' is valid" |
1589 |
FNUM=1; |
| 1590 |
|
1590 |
libsh_everbose libsh_einfo "Checking that the username:group '$G_CONFIG_UID:$G_CONFIG_GID' are valid" |
| 1591 |
if ! $(getent passwd | grep -q "$G_CONFIG_UID" > /dev/null 2>&1) ; then |
1591 |
else |
| 1592 |
libsh_edie "'$G_CONFIG_UID' is not a valid username" |
1592 |
FNUM=3; |
| 1593 |
fi |
1593 |
libsh_everbose libsh_einfo "Checking that the uid:gid numbers '$G_CONFIG_UID:$G_CONFIG_GID' are valid" |
| 1594 |
if ! $(getent group | grep -q "$G_CONFIG_GID" > /dev/null 2>&1) ; then |
1594 |
fi |
| 1595 |
libsh_edie "'$G_CONFIG_GID' is not a valid group name" |
1595 |
#echo $FNUM |
|
|
1596 |
if [ -z "$(getent passwd | cut -d':' -f $FNUM | grep -w "$G_CONFIG_UID")" ]; then |
| 1597 |
libsh_edie "'$G_CONFIG_UID' is not a valid username/user id" |
| 1598 |
fi |
| 1599 |
if [ -z "$(getent group | cut -d':' -f $FNUM | grep -w "$G_CONFIG_GID")" ]; then |
| 1600 |
libsh_edie "'$G_CONFIG_GID' is not a valid group name/ group id" |
| 1596 |
fi |
1601 |
fi |
| 1597 |
|
1602 |
|
| 1598 |
if [ "$( basename \"$G_INSTALLDIR\" )" = "htdocs" ] ; then |
1603 |
if [ "$( basename \"$G_INSTALLDIR\" )" = "htdocs" ] ; then |