use umask to confirm upload directory could be writed in mkdir
This commit is contained in:
parent
3061660318
commit
1fe581f808
|
@ -488,6 +488,10 @@ class SubmitController extends Zend_Controller_Action
|
|||
$sth = $this->db->prepare($sql);
|
||||
$sth->execute();
|
||||
$row = $sth->fetch();
|
||||
$homedir = "/home/wlx/qhhdata/upload/".$uuid."/";
|
||||
$old=umask(0);
|
||||
@mkdir($homedir,0777);
|
||||
umask($old);
|
||||
|
||||
if(!empty($row['pkid']))
|
||||
{
|
||||
|
@ -505,13 +509,11 @@ class SubmitController extends Zend_Controller_Action
|
|||
}else{
|
||||
$uid = 1001;
|
||||
$gid = 1001;
|
||||
$homedir = "/home/wlx/qhhdata/upload/".$uuid."/";
|
||||
$passwd = $this->genRandomString(16);
|
||||
|
||||
$passwd = $this->genRandomString(16);
|
||||
$sql = "UPDATE pureftp SET passwd=?,uid=?,gid=?,homedir=? WHERE userid=?";
|
||||
$sth = $this->db->prepare($sql);
|
||||
$rs = $sth->execute(array($passwd,$uid,$gid,$homedir,$uname));
|
||||
@mkdir($homedir,0644);
|
||||
if($rs)
|
||||
{
|
||||
$data = array(
|
||||
|
@ -532,7 +534,6 @@ class SubmitController extends Zend_Controller_Action
|
|||
}else{
|
||||
$uid = 1001;
|
||||
$gid = 1001;
|
||||
$homedir = "/home/wlx/qhhdata/upload/".$uuid."/";
|
||||
$passwd = $this->genRandomString(16);
|
||||
|
||||
$sql = "INSERT INTO pureftp (userid,passwd,uid,gid,homedir) VALUES (?,?,?,?,?)";
|
||||
|
|
Loading…
Reference in New Issue