-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
process title is too much short #215
Comments
Note, that this is a PITA area to deal with - see the numerous updates to the function in question. Make sure that you verify any patches on a harden OS like RHEL 8 or Rocky8 - as they are likely to give you a different result; especially if the string is larger than |
I'm not expert in this area, but as far as I can tell, there's no way to update the process title in Linux without overwriting environment, while other platforms provide functions (.e.g, BSD |
Yeah, having |
Seems however to work on Rocky Linux 8.5. I'm trying to figure out when it is not working. |
This is a brute force approach to set the process title with the appropriate length. The idea is to compute the size of the process title as it has been requested, and set it to the computed size. This works on Rocky Linux release 8.6 (Green Obsidian). It could break some aggressive security-enforced environments. See agroal#215
This is a brute force approach to set the process title with the appropriate length. The idea is to compute the size of the process title as it has been requested, and set it to the computed size. This works on Rocky Linux release 8.6 (Green Obsidian). It could break some aggressive security-enforced environments. See agroal#215
This is a brute force approach to set the process title with the appropriate length. The idea is to compute the size of the process title as it has been requested, and set it to the computed size. This works on Rocky Linux release 8.6 (Green Obsidian). It could break some aggressive security-enforced environments. See agroal#215
This commit introduces the function `pgagroal_set_connection_proc_title()` that builds a process title with the form: user@host:port/database using in turn the `pgagroal_set_proc_title` function. The `pgagroal_set_connection_proc_title` function is used only by the `worker` process stuff and required to identify the primary server (to get the hostname and port). Related to agroal#215.
Version 1.4 (
HEAD
):the process title should be
pgagroal: main
, according to https://github.com/agroal/pgagroal/blob/master/src/libpgagroal/utils.c#L774 but it is truncated at https://github.com/agroal/pgagroal/blob/master/src/libpgagroal/utils.c#L777 becausemax_process_title_size
is lower. The problem appears to be here https://github.com/agroal/pgagroal/blob/master/src/libpgagroal/utils.c#L762 because themax_process_title
is computed on the basis ofargv
and therefore it depends on the length of the command line.In other words, invoking
pgagroal
will result inmax_process_title_suze
to be9
, invokingpgagroal -d
will makemax_process-title_size
to be 12, and/usr/local/bin/pgagroal -d
will makemax_process_title_size
bigger.I don't know if we should care about
argv
at such level, I don't know if there's a way to get a safe length for the process title and then to use such asmax_process_title_size
default value.The text was updated successfully, but these errors were encountered: