From 645018b2efa61f0f93abccc33f4e236992977fcd Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Mon, 3 Feb 2014 11:27:13 -0200 Subject: [PATCH] Use php function to get hostname instead of exec() --- etc/inc/openvpn.auth-user.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/etc/inc/openvpn.auth-user.php b/etc/inc/openvpn.auth-user.php index 2ddadca5fe..326f788727 100755 --- a/etc/inc/openvpn.auth-user.php +++ b/etc/inc/openvpn.auth-user.php @@ -57,11 +57,10 @@ function getNasID() { global $g; - $nasId = ""; - exec("/bin/hostname", $nasId); - if(!$nasId[0]) - $nasId[0] = "{$g['product_name']}"; - return $nasId[0]; + $nasId = gethostname(); + if(empty($nasId)) + $nasId = $g['product_name']; + return $nasId; } }