]> mj.ucw.cz Git - moe.git/commitdiff
Support for explicit user list.
authorMartin Mares <mj@ucw.cz>
Thu, 3 Jul 2003 09:03:09 +0000 (09:03 +0000)
committerMartin Mares <mj@ucw.cz>
Thu, 3 Jul 2003 09:03:09 +0000 (09:03 +0000)
bin/mo-get-users
config

index f2ed30fc0fb02751dc595267f4e7e49db51974e1..9e9b2c278182d7d03ce5b2edcd3e24ee8bfcf00c 100755 (executable)
@@ -7,9 +7,17 @@ fi
 set -e
 . config
 
-if [ "$1" = --full ] ; then
-       FORM='$1,$5'
+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; }"
 else
-       FORM='$1'
+       if [ "$1" = --full ] ; then
+               cat $CT_USER_LIST
+       else
+               cut -d '        ' -f 1 <$CT_USER_LIST
+       fi
 fi
-awk -F: </etc/passwd "{ gsub(\",.*\",\"\",\$5); OFS=\"\t\"; if (\$3 >= $CT_UID_MIN && \$3 <= $CT_UID_MAX) print $FORM; }"
diff --git a/config b/config
index 9c20211948148257475eec0a3756f8c24720eab4..eea4db1cc577240accddcca210a40c10c2157376 100644 (file)
--- a/config
+++ b/config
@@ -11,6 +11,10 @@ TEST_USERS="mo-test1 mo-test2"
 CT_UID_MIN=65100
 CT_UID_MAX=65199
 
+# If the contestants are not present in /etc/passwd on the evaluating machine,
+# we need a list of them (username<tab>fullname).
+#CT_USER_LIST=userlist
+
 # Test user for sandboxing
 TEST_USER=${TEST_USER:mo-test1}