SiT! Bugs

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000655SiT!setup/configpublic2009-04-20 15:072009-08-16 14:39
Reporterpasamio 
Assigned Toivan 
PrioritynormalSeverityblockReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version3.45 
Target Version3.50Fixed in Version3.50 
Summary0000655: Wrong permissions on attachments directory (previously 605)
DescriptionThis was previously:
http://bugs.sitracker.org/view.php?id=605 [^]

The information there remains relevant the conclusion is invalid. PHP with the appropriate permissions in the web server is more than capable of changing the permissions. The issue in this case is the mode string used to create the file is invalid.

In the setup.php file there is the following code:
    case 'createattdir':
        // Note this creates a directory with 777 permissions!
        $dir = @mkdir($CONFIG['attachment_fspath'], '0777');

This doesn't actually do what it says because of the quotes around it. If you look at the doc page from php.net (http://au2.php.net/mkdir [^]) you can see that it wants to be given a number. I can't remember the exact reason but I think it converts it to a number which drops the preceding zero and then uses this which isn't what you want.

Making it a straight integral value will fix the problem, e.g.:
$dir = @mkdir($CONFIG['attachment_fspath'], 0777);

For me this caused weird issues when installing in addition to the schema problems and the fact I didn't get a user created out of all of this (fun). What I don't get is why this installer creates a new attachments directory instead of using the existing one that is already writeable to it but thats another issue.
TagsNo tags attached.
Attached Files

- Relationships
related to 0000605closed Wrong permissions on attachments directory 

-  Notes
User avatar (0000951)
ivan (administrator)
2009-04-21 11:30

Thanks for the report and for your helpful comments. I had no idea about that peculiarity with the conversion from a string... I need to have a look at this again obviously.

When I get chance I'll set this up and do some testing.
User avatar (0001357)
ivan (administrator)
2009-07-20 22:02

This was fixed somewhere in the 3.50 dev cycle, not sure which commit without looking. Thanks again for the report.
User avatar (0001359)
ivan (administrator)
2009-07-21 10:38

Sorry, I missed your question about why the attachment folder is recreated instead of using an existing folder.

It's simply that setup.php isn't clever enough to find an the existing folder if it's not already mentioned in the config file.
User avatar (0001644)
ivan (administrator)
2009-08-16 14:39

Released in 3.50rc1

- Issue History
Date Modified Username Field Change
2009-04-20 15:07 pasamio New Issue
2009-04-21 11:30 ivan Note Added: 0000951
2009-04-21 11:30 ivan Status new => acknowledged
2009-04-21 11:31 ivan Relationship added related to 0000605
2009-07-20 22:02 ivan Note Added: 0001357
2009-07-20 22:02 ivan Assigned To => ivan
2009-07-20 22:02 ivan Status acknowledged => resolved
2009-07-20 22:02 ivan Resolution open => fixed
2009-07-20 22:02 ivan Fixed in Version => Current SVN
2009-07-20 22:02 ivan Target Version => 3.50
2009-07-21 10:38 ivan Note Added: 0001359
2009-08-16 13:16 ivan Fixed in Version Current SVN => 3.50
2009-08-16 14:39 ivan Note Added: 0001644
2009-08-16 14:39 ivan Status resolved => closed


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker