ソースを参照

rm --recursive > rm -r for BusyBox compatibility

Miraty 2 年 前
コミット
b5b2f95bf5
2 ファイル変更3 行追加5 行削除
  1. 1 3
      fn/ht.php
  2. 2 2
      pg-act/auth/unregister.php

+ 1 - 3
fn/ht.php

@@ -22,8 +22,6 @@ function htSetupUserFs($id) {
 		output(500, 'Can\'t create Tor keys directory.');
 }
 
-
-
 function checkDomainFormat($domain) {
 	// If the domain must end without a dot
 	if (!filter_var($domain, FILTER_VALIDATE_DOMAIN) OR !preg_match('/^(?=^.{1,254}$)([a-z0-9_-]{1,63}\.){1,126}[a-z0-9]{1,63}$/D', $domain))
@@ -95,7 +93,7 @@ function htDeleteSite($address, $type) {
 			output(500, 'Failed to reload Tor.');
 
 		// Delete Tor keys
-		exec(CONF['ht']['sudo_path'] . ' -u ' . CONF['ht']['tor_user'] . ' ' . CONF['ht']['rm_path'] . ' --recursive ' . CONF['ht']['tor_keys_path'] . '/' . $_SESSION['id'] . '/' . $dir, $output, $code);
+		exec(CONF['ht']['sudo_path'] . ' -u ' . CONF['ht']['tor_user'] . ' ' . CONF['ht']['rm_path'] . ' -r ' . CONF['ht']['tor_keys_path'] . '/' . $_SESSION['id'] . '/' . $dir, $output, $code);
 		if ($code !== 0)
 			output(500, 'Failed to delete Tor keys.');
 	}

+ 2 - 2
pg-act/auth/unregister.php

@@ -24,13 +24,13 @@ if (in_array('ht', $user_services, true)) {
 	foreach (query('select', 'sites', ['username' => $_SESSION['id']]) as $site)
 		htDeleteSite($site['address'], $site['type']);
 
-	exec(CONF['ht']['sudo_path'] . ' -u ' . CONF['ht']['tor_user'] . ' ' . CONF['ht']['rm_path'] . ' --recursive ' . CONF['ht']['tor_keys_path'] . '/' . $_SESSION['id'], result_code: $code);
+	exec(CONF['ht']['sudo_path'] . ' -u ' . CONF['ht']['tor_user'] . ' ' . CONF['ht']['rm_path'] . ' -r ' . CONF['ht']['tor_keys_path'] . '/' . $_SESSION['id'], result_code: $code);
 	if ($code !== 0)
 		output(500, 'Can\'t remove Tor keys directory.');
 
 	removeDirectory(CONF['ht']['tor_config_path'] . '/' . $_SESSION['id']);
 
-	exec(CONF['ht']['sudo_path'] . ' -u ' . CONF['ht']['sftpgo_user'] .  ' ' . CONF['ht']['rm_path'] . ' --recursive ' . CONF['ht']['ht_path'] . '/fs/' . $_SESSION['id'], result_code: $code);
+	exec(CONF['ht']['sudo_path'] . ' -u ' . CONF['ht']['sftpgo_user'] .  ' ' . CONF['ht']['rm_path'] . ' -r ' . CONF['ht']['ht_path'] . '/fs/' . $_SESSION['id'], result_code: $code);
 	if ($code !== 0)
 		output(500, 'Can\'t remove user\'s directory.');
 }