security/wazuh-manager: Improve port to run inside jail
- Reimplement getPackages() using SQLite getPackages() is a function used to get a set of information about the packages installed on the system where the manager and agent are installed. To obtain this information, pkg-query(8) was used; however, prior to this commit, it was assumed that pkg(8) was installed on the system, which could be wrong, especially on systems such as jails, where pkg(8) is normally used from the host. With this change, we leverage SQLite to read the pkg(8) database and obtain information about the packages, which is also much more efficient than executing a command. This also fixes the segmentation fault inside jail in wazuh-modulesd when this condition occurs.
- Fix wazuh-apid when security.bsd.see_other_{u,g}ids=0 wazuh-apid checks the status of some daemons (or services) before starting completely, and if it cannot detect the status, it may mark the service as failed or stopped. When security.bsd.see_other_{u,g}ids is enabled, apid cannot correctly detect the status of some daemons running as root, such as wazuh-execd and wazuh-modulesd, so the API will always return that it is DOWN. To work around this issue, a small C program with the SUID bit set is used to check as root if a process exists in /proc. This C program is used in the wazuh.core.cluster.utils.get_manager_status() function for this task.
- Fix package on 14-aarch64 and 16-aarch64
- Bump PORTREVISION