Ticket #883 (closed Bugs: fixed)

Opened 3 years ago

Last modified 3 years ago

bug in install_amp: mkdir ... "0750" - quote mark illegal at this

Reported by: Mike_A Assigned to: p_lindheimer
Priority: crash Milestone:
Component: Installation Version: 2.1
Keywords: mkdir Cc:
Confirmation: SVN Revision (if applicable):
Backend Engine: All Backend Engine Version:

Description

Linux Madriva 2006, php-5.0.4 freepbx-2.1.0: install_amp:

function amp_mkdir
... $mode= "0755"...
...
function recursive_copy
... amp_mkdir(... ,"0750", ...
...

This construction set incorrect rights to new directories.

Small test:

#!/usr/bin/php
<?php
mkdir("dir1", "0750");
mkdir("dir2", 0750);
?>

Exec this and I see:

dir1 d-wxr-xr-T (41354)
dir2 drwxr-x--- (40750)

(Digital rights I see via mc)

Conclusion: NO QUOTATION MARKS IN MODE PARAMETER IN PHP MKDIR! Please, fix this bug.

Change History

05/26/06 05:57:54 changed by _xo_

  • priority changed from 7 to 2.

This issue seems important, so I change the Priority. Thanks for the report.

05/26/06 10:12:41 changed by p_lindheimer

  • owner set to p_lindheimer.

I fixed this on trunk. Can you go pull the install_amp off of trunk and confirm that the fix works and doesn't break anything. Once I hear back here we will merge this change into 2.1 branch as well but waiting until tested.

note the fix was to do the following:

// convert $mode to a number and use that in php mkdir() calls. 
// I left this way because the alternative some code paths use an exec 
// which I think needs $mode as a string
// 
$ntmp = sscanf($mode,"%o",$modenum); //assumes all inputs are octal

05/26/06 11:08:40 changed by p_lindheimer

btw: r1959 is the fix on svn HEAD

05/27/06 10:50:02 changed by Mike_A

Yes, it is work. Close this bug.

05/27/06 15:48:44 changed by p_lindheimer

  • status changed from new to closed.
  • resolution set to fixed.

fixed in 2.1 branch, r1967