From fb9fa554b76ad373dfa3b42d7c9606df2cb557f4 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Wed, 5 Aug 2015 16:21:20 +0545 Subject: sudo package code style Not much here - the code is really small. --- config/sudo/sudo.inc | 12 ++++++------ config/sudo/sudo.xml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'config/sudo') diff --git a/config/sudo/sudo.inc b/config/sudo/sudo.inc index ed0feb9c..ccbda309 100644 --- a/config/sudo/sudo.inc +++ b/config/sudo/sudo.inc @@ -30,7 +30,7 @@ require_once("config.inc"); global $pfs_version; -$pfs_version = substr(trim(file_get_contents("/etc/version")),0,3); +$pfs_version = substr(trim(file_get_contents("/etc/version")), 0, 3); switch ($pfs_version) { case "2.1": /* Hackish way to detect if someone manually did pkg_add rather than use pbi. */ @@ -38,7 +38,7 @@ switch ($pfs_version) { define('SUDO_BASE', '/usr/pbi/sudo-' . php_uname("m")); define('SUDO_LIBEXEC_DIR', '/usr/local/libexec/'); } else { - define('SUDO_BASE','/usr/local'); + define('SUDO_BASE', '/usr/local'); define('SUDO_LIBEXEC_DIR', '/usr/local/libexec/sudo'); } break; @@ -66,17 +66,17 @@ function sudo_install() { if (!is_array($config['installedpackages']['sudo']['config'][0]['row'])) { $config['installedpackages']['sudo']['config'][0]['row'] = array( 0 => array( - "username" => "user:root", + "username" => "user:root", "runas" => "user:root", "cmdlist" => "ALL" ), 1 => array( - "username" => "user:admin", + "username" => "user:admin", "runas" => "user:root", "cmdlist" => "ALL" ), 2 => array( - "username" => "group:admins", + "username" => "group:admins", "runas" => "user:root", "cmdlist" => "ALL" ) @@ -196,7 +196,7 @@ This also forces the user to give full paths to executables, which they should b */ function sudo_validate_commands(&$input_errors) { $idx = 0; - while(isset($_POST["cmdlist{$idx}"])) { + while (isset($_POST["cmdlist{$idx}"])) { $commands = $_POST["cmdlist" . $idx++]; if (strtoupper($commands) == "ALL") { continue; diff --git a/config/sudo/sudo.xml b/config/sudo/sudo.xml index e9b4dcbb..6124a641 100644 --- a/config/sudo/sudo.xml +++ b/config/sudo/sudo.xml @@ -42,7 +42,7 @@ Sudo Command Control None sudo - 0.2.6 + 0.2.7 Sudo - Shell Command Privilege Delegation Utility /usr/local/pkg/sudo.inc -- cgit v1.2.3