summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2014-02-03 11:27:13 -0200
committerRenato Botelho <garga@FreeBSD.org>2014-02-04 12:35:46 -0200
commit645018b2efa61f0f93abccc33f4e236992977fcd (patch)
treefb0515b777985bc0cacde5817117c2bf65951041 /etc
parent4744c6e44e971b2a0828f15c5991d82faf6bb0b3 (diff)
downloadpfsense-645018b2efa61f0f93abccc33f4e236992977fcd.zip
pfsense-645018b2efa61f0f93abccc33f4e236992977fcd.tar.gz
Use php function to get hostname instead of exec()
Diffstat (limited to 'etc')
-rwxr-xr-xetc/inc/openvpn.auth-user.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/etc/inc/openvpn.auth-user.php b/etc/inc/openvpn.auth-user.php
index 2ddadca..326f788 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;
}
}
OpenPOWER on IntegriCloud