mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 17:24:07 +02:00
Don't pass the password in the shell argument
this should prevent some issues with escaping
This commit is contained in:
parent
6c4587eb10
commit
7353a25b99
2 changed files with 16 additions and 1 deletions
|
|
@ -45,6 +45,20 @@ class Server {
|
||||||
return $this->user . '%' . $this->password;
|
return $this->user . '%' . $this->password;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getUser() {
|
||||||
|
return $this->user;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getPassword(){
|
||||||
|
return $this->password;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return string
|
* return string
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -32,9 +32,10 @@ class Share {
|
||||||
$this->server = $server;
|
$this->server = $server;
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
|
|
||||||
$command = Server::CLIENT . ' -N -U ' . $this->server->getAuthString() .
|
$command = Server::CLIENT . ' -U ' . escapeshellarg($this->server->getUser()) .
|
||||||
' //' . $this->server->getHost() . '/' . $this->name;
|
' //' . $this->server->getHost() . '/' . $this->name;
|
||||||
$this->connection = new Connection($command);
|
$this->connection = new Connection($command);
|
||||||
|
$this->connection->write($this->server->getPassword());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getName() {
|
public function getName() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue