From af00e63c9c4adda4f69e0ef90694ffd07081636b Mon Sep 17 00:00:00 2001 From: Simon McVittie <smcv@collabora.com> Date: Thu, 5 Aug 2021 19:39:50 +0100 Subject: [PATCH] pv-adverb, pv-wrap: Take LD_AUDIT, LD_PRELOAD modules as filenames If the user's locale is not UTF-8, we want to pass all filenames through as arbitrary blobs of bytes in no particular encoding, rather than requiring them to be UTF-8. Signed-off-by: Simon McVittie <smcv@collabora.com> --- pressure-vessel/adverb.c | 4 ++-- pressure-vessel/wrap.c | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pressure-vessel/adverb.c b/pressure-vessel/adverb.c index 12056a0a6..4e7c4df9e 100644 --- a/pressure-vessel/adverb.c +++ b/pressure-vessel/adverb.c @@ -788,11 +788,11 @@ static GOptionEntry options[] = NULL }, { "ld-audit", '\0', - G_OPTION_FLAG_NONE, G_OPTION_ARG_CALLBACK, &opt_ld_audit_cb, + G_OPTION_FLAG_FILENAME, G_OPTION_ARG_CALLBACK, &opt_ld_audit_cb, "Add MODULE to LD_AUDIT before executing COMMAND.", "MODULE" }, { "ld-preload", '\0', - G_OPTION_FLAG_NONE, G_OPTION_ARG_CALLBACK, &opt_ld_preload_cb, + G_OPTION_FLAG_FILENAME, G_OPTION_ARG_CALLBACK, &opt_ld_preload_cb, "Add MODULE to LD_PRELOAD before executing COMMAND. Some adjustments " "may be performed, e.g. joining together multiple gameoverlayrenderer.so " "preloads into a single path by leveraging the dynamic linker token expansion", diff --git a/pressure-vessel/wrap.c b/pressure-vessel/wrap.c index e7fd9b9e5..3ffd165ec 100644 --- a/pressure-vessel/wrap.c +++ b/pressure-vessel/wrap.c @@ -1081,7 +1081,8 @@ static GOptionEntry options[] = "Use HOME as home directory. Implies --unshare-home. " "[Default: $PRESSURE_VESSEL_HOME if set]", "HOME" }, { "host-ld-preload", '\0', - G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_CALLBACK, &opt_host_ld_preload_cb, + G_OPTION_FLAG_FILENAME | G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_CALLBACK, + &opt_host_ld_preload_cb, "Deprecated alias for --ld-preload=MODULE, which despite its name " "does not necessarily take the module from the host system", "MODULE" }, @@ -1102,12 +1103,12 @@ static GOptionEntry options[] = "container, or that needs to inherit the value from the host system, " "will be locked. This option implies --batch.", NULL }, { "ld-audit", '\0', - G_OPTION_FLAG_NONE, G_OPTION_ARG_CALLBACK, &opt_ld_audit_cb, + G_OPTION_FLAG_FILENAME, G_OPTION_ARG_CALLBACK, &opt_ld_audit_cb, "Add MODULE from current execution environment to LD_AUDIT when " "executing COMMAND.", "MODULE" }, { "ld-preload", '\0', - G_OPTION_FLAG_NONE, G_OPTION_ARG_CALLBACK, &opt_ld_preload_cb, + G_OPTION_FLAG_FILENAME, G_OPTION_ARG_CALLBACK, &opt_ld_preload_cb, "Add MODULE from current execution environment to LD_PRELOAD when " "executing COMMAND.", "MODULE" }, -- GitLab