Browse Source

Fix symlink security flaw when sudoing chgrp

Miraty 3 years ago
parent
commit
2401da72c5
1 changed files with 1 additions and 1 deletions
  1. 1 1
      public/auth/register.php

+ 1 - 1
public/auth/register.php

@@ -18,7 +18,7 @@ if (isset($_POST['username']) AND isset($_POST['password'])) {
 		umask(0002);
 		if (mkdir(CONF['ht']['ht_path'] . "/" . $_POST['username'], 0775) !== true)
 			serverError("Can't create user directory.");
-		exec(CONF['ht']['sudo_path'] . " " . CONF['ht']['chgrp_path'] . " " . CONF['ht']['sftpgo_group'] . " " . CONF['ht']['ht_path'] . "/" . $_POST['username'], $stdout, $code);
+		exec(CONF['ht']['sudo_path'] . " " . CONF['ht']['chgrp_path'] . " " . CONF['ht']['sftpgo_group'] . " " . CONF['ht']['ht_path'] . "/" . $_POST['username'] . " --no-dereference", $stdout, $code);
 		if ($code !== 0)
 			serverError("Can't change user directory group.");