First draft of check_everything.py -- checks directory owner/group/permissions#1030
First draft of check_everything.py -- checks directory owner/group/permissions#1030
Conversation
bin/check_everything.py
Outdated
| try: | ||
| pwd.getpwnam(my_owner) | ||
| except KeyError: | ||
| sys.stderr.write("ERROR! user "+my_owner+" does not exist\n") |
There was a problem hiding this comment.
print("ERROR! user "+my_owner+" does not exist\n", file=sys.stderr) is probably the more "pythonic" way to do this.
|
|
||
| global_success &= CheckItemBits(course_path+"/reports",True,c_instructor,c_group,0o770) | ||
| global_success &= CheckItemBits(course_path+"/reports/summary_html",True,c_instructor,c_group,0o770) | ||
| global_success &= CheckItemBits(course_path+"/reports/all_grades",True,"hwphp",c_group,0o770) |
There was a problem hiding this comment.
I'd almost want this to be a list of tuples that look like:
checks = [
("build", c_instructor, 0o770),
...
("submissions", "hwphp", 0o750),
...
]
for folder, user, mode in checks:
global_success &= CheckItemBits(os.path.join(course_path, folder), True, user, c_group, mode)
which would make it a bit easier to add new checks/modify one, etc.
There was a problem hiding this comment.
Not going to do this suggestion now. Some of the checks are directories, some are files (true/false). And we may throw some loops in there to check the contents and subdirectories too. I expect this code will be restructured as it is expanded.
bin/check_everything.py
Outdated
| except KeyError: | ||
| sys.stderr.write("ERROR! group "+my_group+" does not exist\n") | ||
| ret_val = False | ||
| c_g = grp.getgrnam(my_group) |
There was a problem hiding this comment.
This will throw a KeyError if my_group does not eixst.
I think it'd make sense to do:
cb_g = grp.getgrnam(COURSE_BUILDERS_GROUP)
try:
c_g = grp.getgrname(my_group)
try:
pwd.getpwnam(my_instructor)
if not my_instructor in c_g.gr_mem:
...
if not my_instructor in cb_g.gr_mem:
...
except KeyError:
...
if not HWPHP_USER in c_g.gr_mem:
...
if not HWCRON_USER in c_g.gr_mem:
...
except KeyError:
...
as no point doing the c_g checks if the group doesn't exist and same with the checks for instructor if it doesn't exist.
|
For travis, I think adding it to the |
bin/check_everything.py
Outdated
| ret_val = False | ||
| if not os.path.exists(my_path): | ||
| print("ERROR! "+my_path+" does not exist\n", file=sys.stderr) | ||
| ret_val = False |
There was a problem hiding this comment.
Don't like the ordering of these checks and that they're all if statements (as if we enter one of them, can't see us entering any of the other ones.
if not os.path.exists(my_path):
...
elif is_dir and not os.path.isdir(my_path):
...
elif not is_dir and not os.path.isfile(my_path):
...
…rmissions (#1030) * just starting * progress * a bit more * edits to check_everything script * more checks * change requests * rearrange logic * add to travis after_script
* Added directories to path in execute.cpp. Added gfx installs and cmake permissions in install_system.sh * added php zip file fix * Added very rough version of window_utils * Added support for screenshotting. Separated window code into window_utils Author: Evan Maicus <emaicus@outlook.com> * Added support for delays and typed commands * Added detection of window name based on child pid * Added click and drag support. Added mouse support. * Added error checking and documentation * Large overhaul of click and drag. * Added comments, added alt button support in click and drag, tested in prep for pull request. * Added support for decimal delays. * add sorting options for labs, default viewing options for labs (#992) * add sorting options for labs, default viewing options for labs * sorting for registration and rotation grading * sort by more than just id * Progress on revising navigation page with submission status (#962) progress on issue #674 * Allow user to specify whether they should stay logged in (past browser closure), defaults to true (#1014) * Ambersands no longer get truncated (#1022) * Gradeable layout with only numerics (#1023) * Looks better when there are zero numeric fields * Looks better when there are zero numeric fields * Electronic grader, changes names of functions and default for if instructor has grading (#1026) * add sorting options for labs, default viewing options for labs * sorting for registration and rotation grading * sort by more than just id * changed function names * now user id not left aligned * remove unneeded code * Creating a new Numeric Gradeable has a total points row (#1025) * Added a row for total points. * total row is functional * is updated when you make a gradeable from a template * made suggested changes and fixed a typo. * all updates made * corrected some unnecessary changes * First draft of check_everything.py -- checks directory owner/group/permissions (#1030) * just starting * progress * a bit more * edits to check_everything script * more checks * change requests * rearrange logic * add to travis after_script * Extra credit colors (#1024) * Penalty, extra, and normal credit look diffirent now * Extra credit and penalty have colors and icons * The icons are now on the left * Create Gradeable: check for invalid dates and gradeable_ids (#1021) * Added checks for the form for the user * updated with requested changes * updated with requested changes * check for hwcron user at the top of grade_students.sh (#1044) * Update sample apache configuration for Ubuntu 16.04 configuration (#1020) * Improved checking of autograding execution of local and system programs (#1050) replace 'assignment' with 'gradeable' in grade_students.sh (improves consistency) better error message for attempted use of system programs that are not on the whitelist now scrapes the config.json for names of compiled_executables to improve the check for local programs if the config.json uses an unacceptable local, now it complains at BUILD time (not delaying to submission debugging as before) fix autograding test failures disabled seccomp because it's broken :( will make a new issue & fix that next, in a new PR #1051. * remove PHP 5.5 (#1054) * Added very rough version of window_utils * Added support for screenshotting. Separated window code into window_utils Author: Evan Maicus <emaicus@outlook.com> * Added support for delays and typed commands * Added detection of window name based on child pid * Added click and drag support. Added mouse support. * Added error checking and documentation * Large overhaul of click and drag. * Added comments, added alt button support in click and drag, tested in prep for pull request. * Added support for decimal delays. * Refactored comments, fixed spelling issues. * Fixed formatting, hacked seccomp * Fixed mislabeled allowed system programs
… in Electronic Gradeable Uploads (#1209) * Added directories to path in execute.cpp. Added gfx installs and cmake permissions in install_system.sh * added php zip file fix * Added very rough version of window_utils * Added support for screenshotting. Separated window code into window_utils Author: Evan Maicus <emaicus@outlook.com> * Added support for delays and typed commands * Added detection of window name based on child pid * Added click and drag support. Added mouse support. * Added error checking and documentation * Large overhaul of click and drag. * Added comments, added alt button support in click and drag, tested in prep for pull request. * Added support for decimal delays. * add sorting options for labs, default viewing options for labs (#992) * add sorting options for labs, default viewing options for labs * sorting for registration and rotation grading * sort by more than just id * Progress on revising navigation page with submission status (#962) progress on issue #674 * Allow user to specify whether they should stay logged in (past browser closure), defaults to true (#1014) * Ambersands no longer get truncated (#1022) * Gradeable layout with only numerics (#1023) * Looks better when there are zero numeric fields * Looks better when there are zero numeric fields * Electronic grader, changes names of functions and default for if instructor has grading (#1026) * add sorting options for labs, default viewing options for labs * sorting for registration and rotation grading * sort by more than just id * changed function names * now user id not left aligned * remove unneeded code * Creating a new Numeric Gradeable has a total points row (#1025) * Added a row for total points. * total row is functional * is updated when you make a gradeable from a template * made suggested changes and fixed a typo. * all updates made * corrected some unnecessary changes * First draft of check_everything.py -- checks directory owner/group/permissions (#1030) * just starting * progress * a bit more * edits to check_everything script * more checks * change requests * rearrange logic * add to travis after_script * Extra credit colors (#1024) * Penalty, extra, and normal credit look diffirent now * Extra credit and penalty have colors and icons * The icons are now on the left * Create Gradeable: check for invalid dates and gradeable_ids (#1021) * Added checks for the form for the user * updated with requested changes * updated with requested changes * check for hwcron user at the top of grade_students.sh (#1044) * Update sample apache configuration for Ubuntu 16.04 configuration (#1020) * Improved checking of autograding execution of local and system programs (#1050) replace 'assignment' with 'gradeable' in grade_students.sh (improves consistency) better error message for attempted use of system programs that are not on the whitelist now scrapes the config.json for names of compiled_executables to improve the check for local programs if the config.json uses an unacceptable local, now it complains at BUILD time (not delaying to submission debugging as before) fix autograding test failures disabled seccomp because it's broken :( will make a new issue & fix that next, in a new PR #1051. * remove PHP 5.5 (#1054) * Added very rough version of window_utils * Added support for screenshotting. Separated window code into window_utils Author: Evan Maicus <emaicus@outlook.com> * Added support for delays and typed commands * Added detection of window name based on child pid * Added click and drag support. Added mouse support. * Added error checking and documentation * Large overhaul of click and drag. * Added comments, added alt button support in click and drag, tested in prep for pull request. * Added support for decimal delays. * Refactored comments, fixed spelling issues. * Fixed formatting, hacked seccomp * Fixed mislabeled allowed system programs * Added support for image diff. * added support to view expected image file. * fixed a regex bug in windowutils, finalized image diff functionality. * fixed a regex bug in windowutils, finalized image diff functionality. * checkpoint * Got text box images working * finished textbox images. finished image diff. fixed ta grading page image issues. fixed ta grading page error display issues. * added borders around images. * Added support for image resizing for textboxes. Resolved local test errors. * formatted. * added blue info messages and per image resizing. * Added new autograding examples for image diffing and textbox images. * updated travis test. * Quick fix. * hotfix
Will eventually be added to travis and expanded with more complete Submitty system checking
Closes #991