1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Use shell to start eval_password command

Since d92c576aa5
we rely on g_spawn_sync().
Which doesn't do variable/glob expansion.

For our use of call_external() in opening and URL or avatar this is
fine.

For getting the password we want to be able to use ~ for our files.
Let's use a shell here.

Fix https://github.com/profanity-im/profanity/issues/1364
This commit is contained in:
Michael Vetter 2020-06-19 20:17:20 +02:00
parent cffce4de8a
commit 448f7f0936

View File

@ -201,16 +201,12 @@ account_eval_password(ProfAccount *account)
assert(account->eval_password != NULL);
gchar **output = NULL;
gchar **argv = g_strsplit(account->eval_password, " ", 0);
gchar *argv[] = {"sh", "-c", account->eval_password};
if (!call_external(argv, &output, NULL)) {
g_strfreev(argv);
argv = NULL;
return FALSE;
}
g_strfreev(argv);
if (!output || !output[0]) {
log_error("Failed to read eval_password output");
g_strfreev(output);