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

Sam Ottenhoff ottenhoff at longsight.com
Fri Mar 18 12:02:50 PDT 2011


I can't think of any good reason for a 0kb resource.  A kernel mod seems 
like the correct route.

The only place I know of where 0kb resources are uploaded (and ignored) 
is the Assignments tool -> Upload All (empty comments files).

--Sam

On 3/18/2011 2:56 PM, York, Adam wrote:
> 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
>
>
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20110318/7f7ff95c/attachment.html 


More information about the sakai-dev mailing list