index f888d84448df0e784076bc619191821e800e62b2..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");
exec($cmd, $ret,$code);
$res = implode($ret,"\n");
- print_a(array($res,$cmd, $ret,$code));
return($res);
}
return($res);
}