Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mRemoteNG/PuTTYNG.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/unix
diff options
context:
space:
mode:
authorJacob Nevins <jacobn@chiark.greenend.org.uk>2022-05-19 12:57:35 +0300
committerJacob Nevins <jacobn@chiark.greenend.org.uk>2022-05-19 12:57:35 +0300
commit069b0c0caf4bbf97d96d0f83abd03aa279859643 (patch)
tree7a1fe02a269688a7181104ee8f2ff04d1ae38e07 /unix
parent386b094e3f6351d4c81eaffa3e7f385291ae5fad (diff)
parente45c6b76dad062e1e2c492524f2c05e27913b382 (diff)
Merge recent misc fixes from 'pre-0.77'.
Diffstat (limited to 'unix')
-rw-r--r--unix/plink.c7
-rw-r--r--unix/pty.c2
-rw-r--r--unix/sftp.c8
-rw-r--r--unix/window.c7
4 files changed, 20 insertions, 4 deletions
diff --git a/unix/plink.c b/unix/plink.c
index 8f53ceda..9e109f01 100644
--- a/unix/plink.c
+++ b/unix/plink.c
@@ -373,8 +373,13 @@ static bool plink_eof(Seat *seat)
static SeatPromptResult plink_get_userpass_input(Seat *seat, prompts_t *p)
{
+ /* Plink doesn't support Restart Session, so we can just have a
+ * single static cmdline_get_passwd_input_state that's never reset */
+ static cmdline_get_passwd_input_state cmdline_state =
+ CMDLINE_GET_PASSWD_INPUT_STATE_INIT;
+
SeatPromptResult spr;
- spr = cmdline_get_passwd_input(p);
+ spr = cmdline_get_passwd_input(p, &cmdline_state, false);
if (spr.kind == SPRK_INCOMPLETE)
spr = console_get_userpass_input(p);
return spr;
diff --git a/unix/pty.c b/unix/pty.c
index 0747b584..625f1bb1 100644
--- a/unix/pty.c
+++ b/unix/pty.c
@@ -227,6 +227,8 @@ static void setup_utmp(char *ttyname, char *location)
endutxent();
#if HAVE_UPDWTMPX
+ /* Reportedly, AIX 5.1 has <utmpx.h> and pututxline(), but no
+ * updwtmpx(). */
updwtmpx(WTMPX_FILE, &utmp_entry);
#endif
diff --git a/unix/sftp.c b/unix/sftp.c
index 17a83a89..9d099f55 100644
--- a/unix/sftp.c
+++ b/unix/sftp.c
@@ -65,8 +65,14 @@ Filename *platform_default_filename(const char *name)
SeatPromptResult filexfer_get_userpass_input(Seat *seat, prompts_t *p)
{
+ /* The file transfer tools don't support Restart Session, so we
+ * can just have a single static cmdline_get_passwd_input_state
+ * that's never reset */
+ static cmdline_get_passwd_input_state cmdline_state =
+ CMDLINE_GET_PASSWD_INPUT_STATE_INIT;
+
SeatPromptResult spr;
- spr = cmdline_get_passwd_input(p);
+ spr = cmdline_get_passwd_input(p, &cmdline_state, false);
if (spr.kind == SPRK_INCOMPLETE)
spr = console_get_userpass_input(p);
return spr;
diff --git a/unix/window.c b/unix/window.c
index 167020b4..f4a50007 100644
--- a/unix/window.c
+++ b/unix/window.c
@@ -160,6 +160,7 @@ struct GtkFrontend {
Ldisc *ldisc;
Backend *backend;
Terminal *term;
+ cmdline_get_passwd_input_state cmdline_get_passwd_state;
LogContext *logctx;
bool exited;
struct unicode_data ucsdata;
@@ -361,7 +362,7 @@ static SeatPromptResult gtk_seat_get_userpass_input(Seat *seat, prompts_t *p)
{
GtkFrontend *inst = container_of(seat, GtkFrontend, seat);
SeatPromptResult spr;
- spr = cmdline_get_passwd_input(p);
+ spr = cmdline_get_passwd_input(p, &inst->cmdline_get_passwd_state, true);
if (spr.kind == SPRK_INCOMPLETE)
spr = term_get_userpass_input(inst->term, p);
return spr;
@@ -4551,7 +4552,7 @@ void set_geom_hints(GtkFrontend *inst)
* So instead, I simply avoid setting geometry hints at all on any
* GDK backend other than X11, and hopefully that's a workaround.
*/
-#if GTK_CHECK_VERSION(3,0,0)
+#if GTK_CHECK_VERSION(3,0,0) && !defined NOT_X_WINDOWS
if (!GDK_IS_X11_DISPLAY(gdk_display_get_default()))
return;
#endif
@@ -5150,6 +5151,8 @@ static void start_backend(GtkFrontend *inst)
const struct BackendVtable *vt;
char *error, *realhost;
+ inst->cmdline_get_passwd_state = cmdline_get_passwd_input_state_new;
+
vt = select_backend(inst->conf);
seat_set_trust_status(&inst->seat, true);