Ticket #243 (closed defect: fixed)

Opened 5 months ago

Last modified 5 weeks ago

SimpleFile Silo activation breaks site if /user/files does not exist and cannot be made

Reported by: skippy Owned by:
Priority: minor Milestone: 0.5
Component: Habari Core Software Version: SVN
Keywords: Cc:

Description

If the directory /user/files does not exists when activating the SimpleFile media silo, and if the permissions on /user prevent the webserver from creating the /files directory, one sees the following error:

Error: mkdir() [function.mkdir]: Permission denied
/home/skippy/code/habari/system/plugins/simplefilesilo/simplefilesilo.plugin.php : Line 44

#0 in [core]:0:
  Error::error_handler(
    2,    
    'mkdir() [<a href=\'function.mkdir\'>function.mkdir</a>]: Permission denied',    
    '/home/skippy/code/habari/system/plugins/simplefilesilo/simplefilesilo.plugin.php',    
    44,    
    array (
    )
  )
#1 in system/plugins/simplefilesilo/simplefilesilo.plugin.php:44:
  mkdir(
    '/home/skippy/code/habari/user/files',    
    502
  )
#2 in [core]:0:
  SimpleFileSilo->action_init()
#3 in system/classes/plugins.php:67:
  call_user_func_array(
    array (
      0 => 
      SimpleFileSilo::__set_state(array(
         'root' => '/home/skippy/code/habari/user/files',
         'url' => 'http://localhost/habari/user/files',
         '_added_templates' => 
        array (
        ),
         '_class_name' => '/home/skippy/code/habari/system/plugins/simplefilesilo/simplefilesilo.plugin.php',
         'info' => 
        InfoObject::__set_state(array(
           '__inforecord_array' => 
          array (
            'name' => 
            array (
              'changed' => true,
              'value' => 'Simple File Media Silo',
            ),
            'version' => 
            array (
              'changed' => true,
              'value' => '1.0',
            ),
            'url' => 
            array (
              'changed' => true,
              'value' => 'http://habariproject.org/',
            ),
            'author' => 
            array (
              'changed' => true,
              '...)
#4 in index.php:192:
  Plugins::act(
    'init'
  )

Habari needs to check the permissions on /user prior to trying to invoke mkdir(), and needs to send a reasonable notification to the user.

Change History

Changed 5 months ago by skippy

It's trivial enough to test whether the system can create /user/files automatically. If it cannot be created, should the plugin permit itself to be activated?

Changed 4 months ago by dmondark

  • priority changed from blocker to minor

This issue is fixed as far as the reported error. This is resolved in r1507. The plugin now shows a message when the server user does not have permission to create the directory. changing priority to a lower level.

As far as not activating the plugin if there is no appropriate permission, should this be a different enhancement ticket?

Changed 4 months ago by michaeltwofish

I think this ticket is still the appropriate place, a new ticket is not necessary. I also believe the plugin should not activate if it's directory does not exist and cannot be created, as long as the user is suitably informed what they have to fix the problem.

Changed 3 months ago by dmondark

The way it is now, the plugin can't prevent itself from activating. I am not sure how that would be accomplished.

Changed 5 weeks ago by michaeltwofish

In r2185. (Also duplicate of #425).

Changed 5 weeks ago by michaeltwofish

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.