Automod and chmod 644

Archive of support for the automated MOD installation tool codenamed "Blinky". For support questions regarding AutoMOD please visit here.
Ideas Centre
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTICE: IF YOU NEED SUPPORT FOR AUTOMOD PLEASE VISIT THE APPROPRIATE LOCATION HERE.
Locked
User avatar
stimart
Registered User
Posts: 78
Joined: Sun Apr 04, 2004 9:43 am

Automod and chmod 644

Post by stimart » Thu Jan 01, 2009 9:21 pm

Hi :) I've a little question.
Automod install the mod's files copying them in the directories with chmod 644 rather than 755.
How can I correct this problem? ;)
Last edited by DavidIQ on Sat Jan 03, 2009 2:07 am, edited 1 time in total.
Reason: Marked as resolved

User avatar
A_Jelly_Doughnut
Former Team Member
Posts: 34457
Joined: Sat Jan 18, 2003 1:26 am
Location: Where the Rivers Run
Contact:

Re: Automod and chmod 644

Post by A_Jelly_Doughnut » Thu Jan 01, 2009 9:29 pm

I don't think this is an autoMOD problem. The CHMOD is not altered by AutoMOD when copying a file or directory -- I assume the system default is used.

What incorrect behavior does this cause for you?
A Donut's Blog
"Bach's Prelude (Cello Suite No. 1) is driving Indiana country roads in Autumn" - Ann Kish

User avatar
stimart
Registered User
Posts: 78
Joined: Sun Apr 04, 2004 9:43 am

Re: Automod and chmod 644

Post by stimart » Thu Jan 01, 2009 9:34 pm

A_Jelly_Doughnut wrote:I don't think this is an autoMOD problem. The CHMOD is not altered by AutoMOD when copying a file or directory -- I assume the system default is used.

What incorrect behavior does this cause for you?
Hi Jelly,
the problem is that the mods installed with Automod on my server don't works correctly with chmod 644, in fact if I change them manually to 755 (from FileZilla for example) they work good.
I use "Direct" write metod... this cuold be the problem?

User avatar
stimart
Registered User
Posts: 78
Joined: Sun Apr 04, 2004 9:43 am

Re: Automod and chmod 644

Post by stimart » Thu Jan 01, 2009 10:18 pm

Add: If the problem is on my server, please can you help me please to add a function on Automod to chamodding copied files to 755?
Thank you. :)

User avatar
stimart
Registered User
Posts: 78
Joined: Sun Apr 04, 2004 9:43 am

Re: Automod and chmod 644

Post by stimart » Thu Jan 01, 2009 11:25 pm

I've tried to modify the code and now it works for me... now the files are copied with the correct chmod 755.

Modification is:

Open includes/editor.php
found this code:

Code: Select all

				if (!@copy($file, $dest))
				{
					return sprintf($user->lang['MODS_COPY_FAILURE'], $dest);
				}
after add:

Code: Select all

@chmod($dest, 0755);
also found:

Code: Select all

			// skip FTP, use local file functions
			$fr = @fopen($phpbb_root_path . $new_filename, 'wb');
			@fwrite($fr, $file_contents);
after add:

Code: Select all

@chmod($fr, 0755);
:) I think this is correct modification, but I ask you: is there an error? is there a more correct way to do that?
Or is it ok?

User avatar
A_Jelly_Doughnut
Former Team Member
Posts: 34457
Joined: Sat Jan 18, 2003 1:26 am
Location: Where the Rivers Run
Contact:

Re: Automod and chmod 644

Post by A_Jelly_Doughnut » Fri Jan 02, 2009 12:05 am

Hi,

Your changes look correct. Did the 644 CHMOD cause an Internal Server Error? I'm still not sure what the problem was.
A Donut's Blog
"Bach's Prelude (Cello Suite No. 1) is driving Indiana country roads in Autumn" - Ann Kish

User avatar
stimart
Registered User
Posts: 78
Joined: Sun Apr 04, 2004 9:43 am

Re: Automod and chmod 644

Post by stimart » Fri Jan 02, 2009 10:25 am

A_Jelly_Doughnut wrote:Hi,

Your changes look correct. Did the 644 CHMOD cause an Internal Server Error? I'm still not sure what the problem was.
Hi :)
chmod 644 cause, for me, a read/write error of the files on the server.

Other modification that I assume is very important is:

Open includes/editor.php
found this code:

Code: Select all

			if ($this->recursive_mkdir($phpbb_root_path . dirname($new_filename), 0777) === false)
replace with:

Code: Select all

			if ($this->recursive_mkdir($phpbb_root_path . dirname($new_filename), 0755) === false)
found:

Code: Select all

	function recursive_mkdir($path, $mode = 0777)
replace with:

Code: Select all

	function recursive_mkdir($path, $mode = 0755)
in this way also the chmod of directories are set to 755 rather than 777 (I think ii's better)... :)

User avatar
A_Jelly_Doughnut
Former Team Member
Posts: 34457
Joined: Sat Jan 18, 2003 1:26 am
Location: Where the Rivers Run
Contact:

Re: Automod and chmod 644

Post by A_Jelly_Doughnut » Fri Jan 02, 2009 2:58 pm

For the next version, I will be adding configurable CHMODs for both directories and files, per this topic and bug 38075.
A Donut's Blog
"Bach's Prelude (Cello Suite No. 1) is driving Indiana country roads in Autumn" - Ann Kish

User avatar
stimart
Registered User
Posts: 78
Joined: Sun Apr 04, 2004 9:43 am

Re: Automod and chmod 644

Post by stimart » Sat Jan 03, 2009 1:07 am

;) great

Locked

Return to “[3.0.x] AutoMOD”