summaryrefslogtreecommitdiffstats
path: root/etc/inc/ipsec.auth-user.php
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:34:41 -0200
commite6867c81d14a682eea0a1ff19580f94b678b7fe2 (patch)
tree2f6d7240cc9ad3142e119825d1d5fcb7c29604e0 /etc/inc/ipsec.auth-user.php
parent3f4bd83b5aa2f830f247f51cdc8fc45adc5a99f1 (diff)
downloadpfsense-e6867c81d14a682eea0a1ff19580f94b678b7fe2.zip
pfsense-e6867c81d14a682eea0a1ff19580f94b678b7fe2.tar.gz
Use php function to get hostname instead of exec()
Diffstat (limited to 'etc/inc/ipsec.auth-user.php')
-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 48bbe81..3865501 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