Opened 16 years ago

Closed 16 years ago

#1132 closed defect (fixed)

Plug-ins fail to create sub-directory when "auto-share" functionality is enabled

Reported by: Nicklas Nordborg Owned by: everyone
Priority: major Milestone: BASE 2.8.3
Component: core Version:
Keywords: Cc:


Here is an example stacktrace from the ZipFileUnpacker plug-in.

net.sf.basedb.core.PermissionDeniedException: Permission denied: Not allowed to read Project key[id=63]
at net.sf.basedb.core.BasicItem.checkPermission(
at net.sf.basedb.core.DbControl.getItem(
at net.sf.basedb.core.SharedItem.getProjectKey(
at net.sf.basedb.core.ShareableUtil.copyPermissions(
at net.sf.basedb.core.Directory.getNew(
at net.sf.basedb.plugins.ZipFileUnpacker.unpack(
at net.sf.basedb.core.PluginExecutionRequest.invoke(
at net.sf.basedb.core.InternalJobQueue$

It can be a bit hard to reproduce this error, but the following steps hopefully helps:

  1. As admin or root, Create one user (U) and one project (P). Add U as a member to P.
  2. Create a directory (D). Enable the "Share new files and sub-directories automatically" option.
  3. Share D to P with at least USE permission.
  4. Log in as U and upload a zip file (Z). Do not unpack the zip file at this step.
  5. Select Z in the file manager and click on the "Run plugin" button.
  6. For the "Save in" parameter, select the the directory D.
  7. The plug-in fails when unpacking the zip file with a stack trace similar to the one above.

There are currently two possible workarounds:

  1. Disable the "Share new files and sub-directories automatically" option.
  2. Disable "Use permissions" for the plug-in

NOTE! The underlying problem is an incorrect implementation of the permission checks for ProjectKey:s and ItemKey:s. This affects all plug-ins that are accessing those items directly or in-directly. The second workaround should work for any plug-in which has this problem unless the plug-in needs elevated permissions. The first workaround only works for plug-ins that have problems when creating subdirectories.

NOTE! This ticket is the same problem as comment:ticket:1131:3

Change History (1)

comment:1 by Nicklas Nordborg, 16 years ago

Resolution: fixed
Status: newclosed

(In [4553]) Fixes #1132: Plug-ins fail to create sub-directory when "auto-share" functionality is enabled

Note: See TracTickets for help on using tickets.