From 9c3588e7a98e08dfd3dc67a9eceb86da7f8b1fae Mon Sep 17 00:00:00 2001 From: David Fillingham Date: Sat, 14 Feb 2026 00:04:10 +1000 Subject: [PATCH 1/2] Add RDP_ASKPASS config to retrieve password from an external command Signed-off-by: David Fillingham --- bin/winapps | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/bin/winapps b/bin/winapps index 1eaccc8..1c05096 100755 --- a/bin/winapps +++ b/bin/winapps @@ -41,6 +41,7 @@ readonly RUNID="${RANDOM}" # WINAPPS CONFIGURATION FILE RDP_USER="" RDP_PASS="" +RDP_ASKPASS="" RDP_DOMAIN="" RDP_IP="" VM_NAME="RDPWindows" # FOR 'libvirt' ONLY @@ -611,7 +612,7 @@ function waRunCommand() { $RDP_FLAGS_WINDOWS \ /d:"$RDP_DOMAIN" \ /u:"$RDP_USER" \ - /p:"$RDP_PASS" \ + ${RDP_PASSWORD_ARG:+"$RDP_PASSWORD_ARG"} \ /scale:"$RDP_SCALE" \ +auto-reconnect \ +dynamic-resolution \ @@ -629,7 +630,7 @@ function waRunCommand() { $RDP_FLAGS_NON_WINDOWS \ /d:"$RDP_DOMAIN" \ /u:"$RDP_USER" \ - /p:"$RDP_PASS" \ + ${RDP_PASSWORD_ARG:+"$RDP_PASSWORD_ARG"} \ /scale:"$RDP_SCALE" \ +auto-reconnect \ /app:program:"$2",hidef:"$HIDEF" \ @@ -663,7 +664,7 @@ function waRunCommand() { $RDP_FLAGS_NON_WINDOWS \ /d:"$RDP_DOMAIN" \ /u:"$RDP_USER" \ - /p:"$RDP_PASS" \ + ${RDP_PASSWORD_ARG:+"$RDP_PASSWORD_ARG"} \ /scale:"$RDP_SCALE" \ +auto-reconnect \ /wm-class:"$FULL_NAME" \ @@ -686,7 +687,7 @@ function waRunCommand() { $RDP_FLAGS_NON_WINDOWS \ /d:"$RDP_DOMAIN" \ /u:"$RDP_USER" \ - /p:"$RDP_PASS" \ + ${RDP_PASSWORD_ARG:+"$RDP_PASSWORD_ARG"} \ /scale:"$RDP_SCALE" \ +auto-reconnect \ /drive:media,"$REMOVABLE_MEDIA" \ @@ -804,6 +805,15 @@ waLastRun waLoadConfig waGetFreeRDPCommand +# Send password on the command line if a command to retrieve the password from is not given +# Otherwise, set FREERDP_ASKPASS which freerdp will read the stdout of to use as the password +RDP_PASSWORD_ARG="/p:$RDP_PASS" + +if [[ ! -z "$RDP_ASKPASS" ]]; then + export FREERDP_ASKPASS="$RDP_ASKPASS" + unset RDP_PASSWORD_ARG +fi + # If using podman backend, modify the FreeRDP command to enter a new namespace. if [ "$WAFLAVOR" = "podman" ]; then FREERDP_COMMAND="podman unshare --rootless-netns ${FREERDP_COMMAND}" From 4665a44a9c70d9be671f39e37cdd9a234aa7dc9b Mon Sep 17 00:00:00 2001 From: David Fillingham Date: Sat, 14 Feb 2026 00:11:53 +1000 Subject: [PATCH 2/2] Update README to include RDP_ASKPASS Signed-off-by: David Fillingham --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index f5acf00..b95870c 100644 --- a/README.md +++ b/README.md @@ -393,7 +393,17 @@ RDP_USER="MyWindowsUser" # [WINDOWS PASSWORD] # NOTES: # - If using FreeRDP v3.9.0 or greater, you *have* to set a password +# - RDP_ASKPASS is provided as a more secure option to RDP_PASS: +# - Calls an external command and uses its stdout as the password +# - The password is not passed on the command line to freerdp, keeping it out of logs +# - If specified, takes precedence over RDP_PASS +# - Examples to use this: +# - RDP_ASKPASS="~/some-custom-command" +# - RDP_ASKPASS="bash -c 'cat ~/.some-secret-file'" +# - RDP_ASKPASS="bash -c 'kwallet-query --folder winapps --read-password rdp kdewallet'" +# RDP_PASS="MyWindowsPassword" +RDP_ASKPASS="" # [WINDOWS DOMAIN] # DEFAULT VALUE: '' (BLANK)