]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
Do not clean DISPLAY unconditionally master
authorMichal Ruprich <mruprich@redhat.com>
Mon, 8 Sep 2025 07:49:22 +0000 (09:49 +0200)
committerAndrew Tridgell <andrew@tridgell.net>
Wed, 22 Apr 2026 03:05:35 +0000 (13:05 +1000)
main.c

diff --git a/main.c b/main.c
index 9d764e16b6eb4c583dfc74de26994305da80b35a..ccad28a1e9554a7be37edb33a729ca915a4f902d 100644 (file)
--- a/main.c
+++ b/main.c
@@ -1743,7 +1743,9 @@ int main(int argc,char *argv[])
        our_gid = MY_GID();
        am_root = our_uid == ROOT_UID;
 
        our_gid = MY_GID();
        am_root = our_uid == ROOT_UID;
 
-       unset_env_var("DISPLAY");
+       // DISPLAY should not be emptied unconditionally
+       if (!getenv("SSH_ASKPASS"))
+               unset_env_var("DISPLAY");
 
 #if defined USE_OPENSSL && defined SET_OPENSSL_CONF
 #define TO_STR2(x) #x
 
 #if defined USE_OPENSSL && defined SET_OPENSSL_CONF
 #define TO_STR2(x) #x