pam/squid: work around to skip passing additional auth properties. https://forum.opnsense.org/index.php?topic=16126

This commit is contained in:
Ad Schellevis 2020-03-04 11:44:47 +01:00
parent 665e3db1f6
commit 41cf191205

View File

@ -63,7 +63,8 @@ if (!empty($auth_data['user']) && isset($auth_data['password'])) {
$is_authenticated = $authFactory->authenticate($auth_data['service'], $auth_data['user'], $auth_data['password']);
if ($is_authenticated) {
$authProps = $authFactory->getLastAuthProperties();
if (!empty($authProps)) {
//XXX: basic_pam_auth passes additional output, we probably need a smarter way to detect if a service would like to receive additional properties.
if (!empty($authProps) && $auth_data['service'] != "squid") {
/* dump authentication response data to stdout */
echo json_encode($authProps, JSON_INVALID_UTF8_IGNORE) ."\n";
}