index 1a991f1b6e122ba7466593abe2bd1ec1336cda9a..5d815810e9134838bb49e6f4e8d0f5f98b6e8b89 100644 (file)
$attrs = (count($attributes))?implode($attributes,' '):'';
$scope = (!empty($scope))?' -s '.$scope: '';
$limit = (!$limit)?'':' -z '.$limit;
$attrs = (count($attributes))?implode($attributes,' '):'';
$scope = (!empty($scope))?' -s '.$scope: '';
$limit = (!$limit)?'':' -z '.$limit;
- $cmd = "ldapsearch -x -LLLL '{$filter}' {$limit} {$scope} -H '{$host}' -b '{$dn}' $attrs";
+ $dn = escapeshellarg($dn);
+ $cmd = "ldapsearch -x -LLLL '{$filter}' {$limit} {$scope} -H '{$host}' -b {$dn} $attrs";
exec($cmd, $ret,$code);
$res = implode($ret,"\n");
return($res);
exec($cmd, $ret,$code);
$res = implode($ret,"\n");
return($res);