Since upgrading to 1.2 uploads are given 600 permissions

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
cnymike
Power Poster
Power Poster
Posts: 446
Joined: Sun Jan 22, 2006 3:24 am

Since upgrading to 1.2 uploads are given 600 permissions

Post by cnymike »

I have three installations of CMSMS that were upgraded to 1.2. All three are now giving permissions to uploads of 600.

umask is set to 022 and tests as read write, read, read

config.php has upload permissions set to 644.

When I ftp files in, they are given 644 permissions.

What could explain CMSMS all of a sudden giving permissions to uploads of 600? And more importantly how might I fix this?
Last edited by cnymike on Mon Nov 05, 2007 10:44 pm, edited 1 time in total.
klaus
New Member
New Member
Posts: 6
Joined: Tue Oct 31, 2006 12:01 pm

Re: Since upgrading to 1.2 uploads are given 600 permissions

Post by klaus »

I have the same problem!

But after a new installation and only with the new filemanager.
The uploads are given 600 permissions.

With the imagemanager everything works fine!


Any clue??
Thanks!!

Greetings
Klaus
JQ
New Member
New Member
Posts: 6
Joined: Wed Aug 31, 2005 3:57 pm

Re: Since upgrading to 1.2 uploads are given 600 permissions

Post by JQ »

I am having this issue as well. Can't seem to find a fix yet.
cyberman

Re: Since upgrading to 1.2 uploads are given 600 permissions

Post by cyberman »

Warning - I'm not a coder for real ;), but you can try this:

Add

Code: Select all

		chmod($thispath, octdec('0'.$config['default_upload_permission']));
AFTER line 104 in action.upload.php
scotch33
Dev Team Member
Dev Team Member
Posts: 284
Joined: Tue Feb 14, 2006 9:56 pm

Re: Since upgrading to 1.2 uploads are given 600 permissions

Post by scotch33 »

have just tried this as mentioned here - it has not been successful - permissions are still 600 on uploaded files - so code after the add looks like as follows (from 102 to 112) - is this what we were supposed to do cyberman, or am I putting it in the wrong place?

Code: Select all

} else {
		if (trim($_FILES[$id."file_".$i]["name"])=="") continue;
		$thispath=$this->Slash($fullpath,$_FILES[$id."file_".$i]["name"]);
		chmod($thispath, octdec('0'.$config['default_upload_permission']));
		if (move_uploaded_file($_FILES[$id."file_".$i]["tmp_name"],$thispath)) {
			$messages.=$_FILES[$id."file_".$i]["name"]." ".$this->Lang("uploadsuccess")."<br/>";
		} else {
			$errors.=$_FILES[$id."file_".$i]["name"]." ".$this->Lang("uploadfail")."<br/>";
		}
	}
}
Thanks!
cnymike
Power Poster
Power Poster
Posts: 446
Joined: Sun Jan 22, 2006 3:24 am

Re: Since upgrading to 1.2 uploads are given 600 permissions

Post by cnymike »

I wonder if more people are experiencing this and don't realize that permissions have changed?

Dev team...is this a bug?
dmgd
Forum Members
Forum Members
Posts: 115
Joined: Tue Jun 06, 2006 1:10 pm
Location: TX

Re: Since upgrading to 1.2 uploads are given 600 permissions

Post by dmgd »

cnymike wrote: I wonder if more people are experiencing this and don't realize that permissions have changed?

Dev team...is this a bug?
Yes I have the same problem.  Everything OK until upgrade to 1.2.  Also new install has the same problem. This is 1 of 3rd threads on the issue.
Mark
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Since upgrading to 1.2 uploads are given 600 permissions

Post by calguy1000 »

Okay, I briefly looked at this issue and there is a problem (but it's not as severe as you think).

a) File Manager isn't giving out the truth about permissions (checking the files with your ftp client
    will tell you the real story).  I'll fix this one soon

b) There seems to be some inconsistencies with permissions on uploaded files between the various modules, etc. 
    I'll check into this soon.

[correction]
You are correct, they are getting 600 permission.
i'm looking into it.
Last edited by calguy1000 on Wed Nov 14, 2007 4:05 pm, edited 1 time in total.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
cnymike
Power Poster
Power Poster
Posts: 446
Joined: Sun Jan 22, 2006 3:24 am

Re: Since upgrading to 1.2 uploads are given 600 permissions

Post by cnymike »

Thank you for your attention to this matter.

May not be "severe" but it's put a screeching halt to user uploads being viewable by visitors to the sties since permissions must now be manually changed to 644 from 600
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Since upgrading to 1.2 uploads are given 600 permissions

Post by calguy1000 »

Okay, this issue is not unique to CMS Made simple, searching through google found hundreds of references to this issue.

The problem is the 'umask' of the parent process to apache (or one of those processes anyways) is 077 which causes files to be created as 600.  The move_uploaded_file php function preserves that permission.  We use that function everywhere.

Interestingly, the ImageManager does not use this function, it uses copy() which sets the file permission properly.

To solve this problem once and for all we will have to change ALL of the modules that allow uploading files (currently there are alot of them).

dammit dammit dammit!!!
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
cnymike
Power Poster
Power Poster
Posts: 446
Joined: Sun Jan 22, 2006 3:24 am

Re: Since upgrading to 1.2 uploads are given 600 permissions

Post by cnymike »

Is this sudden "thing" due to an Apace upgrade or what exactly is the culprit?
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Since upgrading to 1.2 uploads are given 600 permissions

Post by calguy1000 »

Well, it's sudden because the file manager has been replaced.

The old file manager used copy() I think..... which took the umask into cosideration.  Uploads module and FrontEndUsers do similar things. 

The Album module uses the move_uploaded_file function, as does CompanyDirectory, and (as of 2.6) News, and the New file manager.  so that would explain some of the difficulty with uploads people have been having with the album module.

I've written and committed a 'cms_move_uploaded_file' function which will call move_upload_files and then chmod the file to the permission specified in the config file.  I've converted the FileManager module, News, CompanyDirectory to use this new function now, and there'll be a CMS Made Simple 1.2.1 coming out soon.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
cnymike
Power Poster
Power Poster
Posts: 446
Joined: Sun Jan 22, 2006 3:24 am

Re: Since upgrading to 1.2 uploads are given 600 permissions

Post by cnymike »

I've also reported as a "bug" the fact the FileManager has a confusing mix of upper and lower case usage as concerns the dropdown menu and the actual directory names. eg: "File" in dropdown menu versus "file" directory name and similarly with images, flash, media.
This caused me to have to move hundreds of files from "File" directory to "file" directory to keep up with the change that, at some point, the changed FileManager imposed upon CMSMS.
zebulon
Forum Members
Forum Members
Posts: 37
Joined: Sun Aug 27, 2006 8:21 pm

Re: Since upgrading to 1.2 uploads are given 600 permissions

Post by zebulon »

Hi everyone,

kindly asking: is there anything new to this issue?
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Since upgrading to 1.2 uploads are given 600 permissions

Post by calguy1000 »

Interestingly, my research tells me that this is not a CMS issue.  it's common to many packages.  it's caused by certain web server configurations.  Anyways, in 1.2.1 we've made some changes to 'work around' this issue.

I'm just trying to get a bit more testing done before we release it.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Locked

Return to “[locked] Installation, Setup and Upgrade”