@@ -112,9 +112,6 @@ FIXME: GFPZR: Function stat() may be undeclared.
112
112
#include <Userenv.h>
113
113
#include <shlobj.h>
114
114
115
- #ifdef WIN32_PRAGMA_REMCON
116
- #include <shlwapi.h>
117
- #endif
118
115
extern char HomeDirLsaW [MAX_PATH ];
119
116
120
117
#endif
@@ -498,24 +495,6 @@ int do_exec_windows(Session *s, const char *command, int pty) {
498
495
wchar_t * pw_dir_utf16 = utf8_to_utf16 (s -> pw -> pw_dir );
499
496
extern int debug_flag ;
500
497
501
- if (s -> is_subsystem == SUBSYSTEM_INT_SFTP_ERROR )
502
- {
503
- printf ("This service allows sftp connections only.\n" );
504
- fflush (NULL );
505
- exit (1 );
506
- }
507
- else if (s -> is_subsystem == SUBSYSTEM_INT_SFTP )
508
- {
509
- u_int i ;
510
- for (i = 0 ; i < options .num_subsystems ; i ++ )
511
- {
512
- if (strcmp ("sftp" , options .subsystem_name [i ]) == 0 )
513
- {
514
- command = options .subsystem_args [i ];
515
- }
516
- }
517
- }
518
-
519
498
PROCESS_INFORMATION pi ;
520
499
STARTUPINFOW si ;
521
500
@@ -532,9 +511,14 @@ int do_exec_windows(Session *s, const char *command, int pty) {
532
511
char * exec_command ;
533
512
char * laddr ;
534
513
char buf [256 ];
535
- #ifdef WIN32_PRAGMA_REMCON
536
- char exec_command_str [512 ];
537
- #endif
514
+
515
+ if (s -> is_subsystem >= SUBSYSTEM_INT_SFTP_ERROR )
516
+ {
517
+ error ("sub system not supported, exiting\n" );
518
+ fflush (NULL );
519
+ exit (1 );
520
+ }
521
+
538
522
539
523
if (!command )
540
524
{
@@ -555,12 +539,6 @@ int do_exec_windows(Session *s, const char *command, int pty) {
555
539
int retcode = -1 ;
556
540
if ((!s -> is_subsystem ) && (s -> ttyfd != -1 ))
557
541
{
558
- extern HANDLE hInputConsole ;
559
- extern HANDLE hOutputConsole ;
560
- hInputConsole = GetConsoleInputHandle ();
561
- hOutputConsole = GetConsoleOutputHandle ();
562
- ConSetScreenSize (s -> col , s -> row );
563
- s -> ptyfd = pipein [1 ]; // hConsole; // the pty is the Windows console output handle in our Win32 port
564
542
}
565
543
566
544
debug3 ("sockin[0]: %d sockin[1]: %d" , pipein [0 ], pipein [1 ]);
@@ -2539,19 +2517,15 @@ session_pty_req(Session *s)
2539
2517
/* for SSH1 the tty modes length is not given */
2540
2518
if (!compat20 )
2541
2519
n_bytes = packet_remaining ();
2542
- #ifndef WIN32_PRAGMA_REMCON
2543
2520
tty_parse_modes (s -> ttyfd , & n_bytes );
2544
- #endif
2545
2521
2546
2522
if (!use_privsep )
2547
2523
pty_setowner (s -> pw , s -> tty );
2548
2524
2549
2525
/* Set window size from the packet. */
2550
2526
pty_change_window_size (s -> ptyfd , s -> row , s -> col , s -> xpixel , s -> ypixel );
2551
2527
2552
- #ifndef WIN32_PRAGMA_REMCON
2553
2528
packet_check_eom ();
2554
- #endif
2555
2529
session_proctitle (s );
2556
2530
return 1 ;
2557
2531
}
0 commit comments