The old method of listing users by matching UID's is no longer supported.
include mop/public/Makefile
include mop/score/Makefile
-CONFIGS+=mop
+CONFIGS+=mop userlist
run/cf/mop: $(o)/mop/mop.cf
+run/cf/userlist: $(o)/mop/userlist.cf
if [ "$1" = --help ] ; then
echo "Usage: mo-get-users [--full]"
fi
-[ -f config ] || { echo "Missing config file, check cwd." ; exit 1 ; }
+[ -f cf/mop ] || { echo "Missing config file, check cwd." ; exit 1 ; }
set -e
-. config
+. cf/mop
-if [ -z "$CT_USER_LIST" ] ; then
- if [ "$1" = --full ] ; then
- FORM='$1,$5'
- else
- FORM='$1'
- fi
- awk -F: </etc/passwd "{ gsub(\",.*\",\"\",\$5); OFS=\"\t\"; if (\$3 >= $CT_UID_MIN && \$3 <= $CT_UID_MAX) print $FORM; }"
+if [ "$1" = --full ] ; then
+ cut -d ' ' -f 1,2 <$CT_USER_LIST
else
- if [ "$1" = --full ] ; then
- cut -d ' ' -f 1,2 <$CT_USER_LIST
- else
- cut -d ' ' -f 1 <$CT_USER_LIST
- fi
+ cut -d ' ' -f 1 <$CT_USER_LIST
fi
# Configuration file for the MO-P environment
# (c) 2001--2008 Martin Mares <mj@ucw.cz>
+# The root of the whole contest directory hierarchy
+MO_ROOT=/mo
+
# These values are used when creating logins for eval and contestants
# (group id's are from the same range)
EVAL_UID_MIN=65000
CT_UID_MIN=65100
CT_UID_MAX=65199
-# Sometimes we need to get a list of all contestants (not in the evaluator
-# itself, but in various auxiliary scripts). In such cases we call mo-get-users,
-# which either uses an explicit list of contestants CT_USER_LIST (username<tab>fullname),
-# or (if undefined) scans /etc/passwd for users with UID between CT_UID_MIN and CT_UID_MAX.
-CT_USER_LIST=userlist
+# A file with the list of all contestants. Consists of tab-separated fields:
+# <login> <full name> [<machine>]
+CT_USER_LIST=cf/userlist
# (optional) Use remote submitting
REMOTE_SUBMIT=1
REMOTE_SUBMIT_USER=mo-submit
REMOTE_SUBMIT_GROUP=mo-submit
+
+# Include configuration of the evaluator
+. cf/eval