• last updated 14 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
added support for "ns_trim -prefix".

The command is predefined in NaviServer; if not available, a comatibility version is added.

This change also mitigates a potential memory-leak problem in nsv_dict with certain

versions of NaviServer which might lead on busy sites to problems.

  1. … 3 more files in changeset.
Stronger password hashes for OpenACS

This change introduces the possibility to use either the classical

OpenACS password hash algorithm "salted-sha1" or the SCRAM passord

function "scram-sha-256". The latter can be used by (a) using the

most recent version of NaviServer (from Sept 28, 2021 or newer) and

(b) by configuring the password hash preferences via Kernel package

parameter "PasswordHashAlgorithm". The package parameter can contain a

list of multiple hash algorithms in preference order. The most

preferred available algorithm is chosen.

By default, the "PasswordHashAlgorithm" is "salted-sha1", and the

behavior is as before. After upgrading to the new version of acs-tcl

and acs-kernel, the preference list can be configured. When a user

logs in and the preferred available algorithm is different from the

previously used algorithm, the upgrade is performed for the user

automatically.

The usage of SHA1 in OpenACS is easily target of security audits (see

[1]). The biggest danger is that if somebody gets full access to the

"users" table (e.g. when decommissioning a hard disk). In this case

the hashes can be attacked with dictionaries by using some crypto

hardware (when someone gets raw access to the DB, one has usually some

other big problems). However, by using the "scram-sha-256" hash

function this danger is substantially reduced. This function computes

a password hash using PBKDF2 (Password-Based Key Derivation Function

2). This function is used to reduce vulnerabilities of brute-force

attacks against password hashes. The hash function of SCRAM is PBKDF2

[RFC2898] with HMAC as the pseudorandom function (PRF) and with dkLen

== output length of HMAC == output length of the digest function. So,

it uses a better hash algorithm (sha-256 vs. sha1) and applies this a

high number of times (15K times for a password hash computation).

NaviServer supports as well the even better SCRYPT algorithm, but this

is only available when NaviServer is compiled with OpenSSL 3.0 or

newer. On the contrary, scram-sha-256 (actually PKCS5_PBKDF2_HMAC) is

available since OpenSSL 1.0.0 (2015).

All the improved hash functions require NaviServer with its tight

integration to the crypto functions of OpenSSL.

[1] https://openacs.org/forums/message-view?message_id=5522562

  1. … 6 more files in changeset.
provide a compatibility function for ns_parsehostport for earlier versions of NaviServer

added "ns_parseurl -strict" to icanuse definitions

improved spelling

  1. … 5 more files in changeset.
remove dependency of general-comments on acs-mail-lite

  1. … 3 more files in changeset.
make use of built-in reverse proxy mode of newer versions of NaviServer

  1. … 1 more file in changeset.
Revert to previous strategy of determining available subcommands.

Running the provided subcommand is dangerous, since the command might

have side effects, might require connections, etc.

The feature test for "ns_http run" was incorrect, since it was not

introduced with 4.99.15 (as the comment suggested), but already with

4.99.4 (2017)... but at this time, the command did not return a dict,

which is assumed in the http-client procs. One can use "ns_http stats"

as an indicator for this feature, which was introduced at the time

when "ns_http run" was starting to return dicts as results.

Provide a more precise name for the feature test of ns_http returning

dicts (naming the feature simply "ns_http" is not a good idea, since

the command could of course be used already before the feature change).

  1. … 2 more files in changeset.
Do not improperly rely on apm_version_names_compare to check for NaviServer version number, use a more reliable capability check instead

  1. … 1 more file in changeset.
Change the regexp so that we catch multiple kinds of error pattern indicating the subcommand does not exist: NaviServer and Tcl return sligthly different error messages

Use a different idiom to detect if a command supports a subcommand, fixing acs-tcl.acs__command_has_subcommand automated test

Bring existing doc in the api-doc, so that documentation__check_proc_doc test case does not complain

added backward compatibility proc for AOLserver "ns_trim"

  1. … 1 more file in changeset.
add i-can-use rule for "ns_urlencode -part oauth1"

Prefer 'namespace which' over 'info commands', as it is faster (on local tests, around 2x) and returns a single value. Many thanks to Nathan Coulter.

  1. … 58 more files in changeset.
added "ad_conn bot_p" to check, whether request was initiated by a bot

This feature is based on a simple heuristic based on the user-agent

(which can be certainly extended). It is useful to avoid e.g. Google

bot to run into "notifications subscribe" + login attempts, which

are useful for not-logged-in user, but not for bots. These attemps

lead to failures in google statistics that might reduce the google

ranking of a web site.

  1. … 2 more files in changeset.
use common "icanuse" idioms

  1. … 1 more file in changeset.
improve spelling

  1. … 6 more files in changeset.
provide a hint to make potential upgrade problems more clear

provdide "icanuse" support for "ns_ictl trace idle"

Provide doc for ns_dbquotelist when is tcl implemented as fallback (fixes documentation__check_proc_doc automated test)

- icanuse: added nsv_dict

- bumped version number to 5.10.0d37

  1. … 1 more file in changeset.
more more fix for issue #3441

As Keith reported, there is was one more issue concerning missing column_names and empty query results. This is now as well fixed in oacs-5-10. Also, the regression test was extended to handle these cases as well.

  1. … 2 more files in changeset.
fix ugly typo

move code pieces around to centralize concerns

  1. … 2 more files in changeset.
fix for issue #3440: problem with SQL queries in db_transactions after some db_multirows

the was a problem with with db_handle management in complex setups,

where a db_multirow iterating over more than one tuple causes

some other queries in the transaction to fail. See as well

the new test case added to the regression test.

Many thanks to Keith Paskett for reporting and the good test case!

https://openacs.org/bugtracker/openacs/bug?format=table&bug_number=3440

  1. … 2 more files in changeset.
improve documentation

extend icanuse cases

Added HashKeyPartitionedCache:

This is type of cache is like a "KeyPartitionedCache" but works as

well with strings as keys while the "KeyPartitionedCache" requires numeric

keys.

  1. … 2 more files in changeset.
file 00-icanuse-procs.tcl was initially added on branch oacs-5-10.