about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2020-06-19 20:17:20 +0200
committerMichael Vetter <jubalh@iodoru.org>2020-06-19 20:17:20 +0200
commit448f7f0936fe8b92b472cdb608195382b8eeba34 (patch)
tree4ef2e364e99b8900ae011054e8299311d0b8408a
parentcffce4de8a28f3b4d929f7fcbf22882dca5a1e59 (diff)
downloadprofani-tty-448f7f0936fe8b92b472cdb608195382b8eeba34.tar.gz
Use shell to start eval_password command
Since https://github.com/profanity-im/profanity/commit/d92c576aa53505d712715b1acc6344af3262c84f
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
-rw-r--r--src/config/account.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/config/account.c b/src/config/account.c
index 1fc13429..6fc80eb7 100644
--- a/src/config/account.c
+++ b/src/config/account.c
@@ -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);