Diff

Differences From Artifact [62c599dc55]:

To Artifact [37599cae0e]:


7486
7487
7488
7489
7490
7491
7492
7493

7494
7495
7496
7497
7498
7499
7500
7501
7502




7503
7504
7505
7506
7507
7508
7509
7510
7511
7486
7487
7488
7489
7490
7491
7492

7493









7494
7495
7496
7497


7498
7499
7500
7501
7502
7503
7504







-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-







	ssh2_pkt_adduint32(pktout, ssh->x11disp->screennum);
	ssh2_pkt_send(ssh, pktout);

	ssh2_queue_chanreq_handler(ssh->mainchan, ssh2_maybe_setup_x11, s);

	crWaitUntilV(pktin);

	if (pktin->type != SSH2_MSG_CHANNEL_SUCCESS) {
	if (pktin->type == SSH2_MSG_CHANNEL_SUCCESS) {
	    if (pktin->type != SSH2_MSG_CHANNEL_FAILURE) {
		bombout(("Unexpected response to X11 forwarding request:"
			 " packet type %d", pktin->type));
		sfree(s);
		crStopV;
	    }
	    logevent("X11 forwarding refused");
	} else {
	    logevent("X11 forwarding enabled");
	    logevent("X11 forwarding enabled");
	    ssh->X11_fwd_enabled = TRUE;
	} else
	    logevent("X11 forwarding refused");
	    ssh->X11_fwd_enabled = TRUE;
	}
    }
    sfree(s);
    crFinishV;
}

static void ssh2_maybe_setup_agent(struct ssh_channel *c, struct Packet *pktin,
				   void *ctx)
7527
7528
7529
7530
7531
7532
7533
7534

7535
7536
7537
7538
7539
7540
7541
7542




7543
7544
7545
7546
7547
7548
7549
7550
7551
7520
7521
7522
7523
7524
7525
7526

7527








7528
7529
7530
7531


7532
7533
7534
7535
7536
7537
7538







-
+
-
-
-
-
-
-
-
-
+
+
+
+
-
-







	ssh2_pkt_addbool(pktout, 1);	       /* want reply */
	ssh2_pkt_send(ssh, pktout);

	ssh2_queue_chanreq_handler(ssh->mainchan, ssh2_maybe_setup_agent, s);

	crWaitUntilV(pktin);

	if (pktin->type != SSH2_MSG_CHANNEL_SUCCESS) {
	if (pktin->type == SSH2_MSG_CHANNEL_SUCCESS) {
	    if (pktin->type != SSH2_MSG_CHANNEL_FAILURE) {
		bombout(("Unexpected response to agent forwarding request:"
			 " packet type %d", pktin->type));
		crStopV;
	    }
	    logevent("Agent forwarding refused");
	} else {
	    logevent("Agent forwarding enabled");
	    logevent("Agent forwarding enabled");
	    ssh->agentfwd_enabled = TRUE;
	} else
	    logevent("Agent forwarding refused");
	    ssh->agentfwd_enabled = TRUE;
	}
    }
    sfree(s);
    crFinishV;
}

static void ssh2_maybe_setup_pty(struct ssh_channel *c, struct Packet *pktin,
				 void *ctx)
7584
7585
7586
7587
7588
7589
7590
7591

7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602



7603
7604
7605
7606
7607
7608
7609
7571
7572
7573
7574
7575
7576
7577

7578








7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591







-
+
-
-
-
-
-
-
-
-



+
+
+







	ssh2_pkt_send(ssh, pktout);
	ssh->state = SSH_STATE_INTERMED;

	ssh2_queue_chanreq_handler(ssh->mainchan, ssh2_maybe_setup_pty, s);

	crWaitUntilV(pktin);

	if (pktin->type != SSH2_MSG_CHANNEL_SUCCESS) {
	if (pktin->type == SSH2_MSG_CHANNEL_SUCCESS) {
	    if (pktin->type != SSH2_MSG_CHANNEL_FAILURE) {
		bombout(("Unexpected response to pty request:"
			 " packet type %d", pktin->type));
		crStopV;
	    }
	    c_write_str(ssh, "Server refused to allocate pty\r\n");
	    ssh->editing = ssh->echoing = 1;
	} else {
	    logeventf(ssh, "Allocated pty (ospeed %dbps, ispeed %dbps)",
		      ssh->ospeed, ssh->ispeed);
            ssh->got_pty = TRUE;
	} else {
	    c_write_str(ssh, "Server refused to allocate pty\r\n");
	    ssh->editing = ssh->echoing = 1;
	}
    } else {
	ssh->editing = ssh->echoing = 1;
    }
    sfree(s);
    crFinishV;
}
7651
7652
7653
7654
7655
7656
7657
7658
7659

7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7633
7634
7635
7636
7637
7638
7639


7640






7641


7642
7643
7644
7645
7646
7647
7648







-
-
+
-
-
-
-
-
-

-
-








    if (s->num_env) {
	s->env_ok = 0;
	s->env_left = s->num_env;

	while (s->env_left > 0) {
	    crWaitUntilV(pktin);

	    if (pktin->type != SSH2_MSG_CHANNEL_SUCCESS) {
	    if (pktin->type == SSH2_MSG_CHANNEL_SUCCESS)
		if (pktin->type != SSH2_MSG_CHANNEL_FAILURE) {
		    bombout(("Unexpected response to environment request:"
			     " packet type %d", pktin->type));
		    crStopV;
		}
	    } else {
		s->env_ok++;
	    }

	    s->env_left--;
	}

	if (s->env_ok == s->num_env) {
	    logevent("All environment variables successfully set");
	} else if (s->env_ok == 0) {
	    logevent("All environment variables refused");