[Building Sakai] Proposed Kernel Mod: disallow empty attachments from being added

York, Adam yorkadam at umich.edu
Fri Mar 18 11:56:07 PDT 2011


While investigating the JIRA SAK-7335 ( https://jira.sakaiproject.org/browse/SAK-7334 )  I came across an issue which spanned 'Assignments' and 'File Picker Helper Tool'.  The problem appears to be best solved with a modification of the kernel.

The issue encountered is that the user is allowed to attach 0kb files.  This is problematic when submitting assignments, and in general is not something the user should be allowed to do for various reasons.  Perhaps the best case is when a user submits a 0kb file and isn't aware of it or does it for malicious reasons (unofficial extension).  I discussed it with fellow team members Zhen Qian and Dave Haines.  The general consensus was that the problem was best corrected at the kernel level when adding an attachment (BaseContentService.java:addAttachmentResource*).  At that level we could implement a check for file size.  If the file is 0kb we would throw an exception.

I was wondering if anyone had any better suggestions on where the problem should be tackled? Or maybe more importantly would a fix such as this at kernel level have any negative impact elsewhere?  Also are there any scenarios in which the user SHOULD be able to attach a 0kb file?  We would like to propose the most general fix possible as opposed to just adding another 'addAttachmentResource' function.

We considered suggesting changes at the Resource level but suspect this could cause problems with other interfaces / feeds of files which may happen contain an empty file.  This will be a much further reaching change and is likely an unnecessary one.


Thank You,

Adam York
Teaching & Learning
University of Michigan
Information and Technology Services
(734)615-2549

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20110318/0fa1c1d6/attachment.html 


More information about the sakai-dev mailing list