pkexec: improve pkexec authentication message
This MR is an improved version of the !90 (closed).
Instead of the program
variable, output the command_line
.
If is the length of a command_line
bigger than 80 characters
output: "{first 38 chars} ... {last 42 chars}"
gchar *cmdline_short = NULL;
// A newly-allocated copy of command_line
cmdline_short = g_strdup(command_line);
// Copies a null-terminated string into the dest buffer,
// include the trailing null, and return a pointer to the
// trailing null byte.
if (strlen(command_line) > 80)
g_stpcpy(g_stpcpy( cmdline_short + 38, " ... " ),
command_line + strlen(command_line) - 37 );