summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2014-02-03 11:23:28 -0200
committerRenato Botelho <garga@FreeBSD.org>2014-02-04 12:35:30 -0200
commit7ea30d60503a5511f8b9f04171e74a0e8dd4cf8f (patch)
tree6902076e5360ee74dbaf01bf9fa26a2240dbcf4d /etc
parenteda4179204d21204be067fc4024330ad63cb8c3d (diff)
downloadpfsense-7ea30d60503a5511f8b9f04171e74a0e8dd4cf8f.zip
pfsense-7ea30d60503a5511f8b9f04171e74a0e8dd4cf8f.tar.gz
Use php function to get hostname instead of exec()
Diffstat (limited to 'etc')
-rwxr-xr-xetc/inc/ipsec.auth-user.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/etc/inc/ipsec.auth-user.php b/etc/inc/ipsec.auth-user.php
index 97ec0e3..1f93e09 100755
--- a/etc/inc/ipsec.auth-user.php
+++ b/etc/inc/ipsec.auth-user.php
@@ -56,11 +56,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