[PATCH] in sshd make some global variables static.

Markus Schmidt markus at blueflash.cc
Tue Dec 11 00:09:57 AEDT 2018

I think in sshd.c a bunch of global variables could be made static.

Three of them could even be easily moved into main() as normal 
variables: test_flag, inetd_flag, no_daemon_flag.

Instead of a patch, here is merely a list, because I'm not sure if you 
really want to do this and/or if you want to transfer the the comments 
for the test_flag, inetd_flag, no_deamon_flag into main as well.

All of these can be made static.
The first three can be moved to main() as normal variables.

Tested on openssh 7.9 portable.

  static int test_flag = 0;  /* XXX move to main() */
  static int inetd_flag = 0;  /* XXX move to main() */
  static int no_daemon_flag = 0;  /* XXX move to main() */

  static int log_stderr = 0;
  static char **saved_argv;
  static int saved_argc;
  static int rexeced_flag = 0;
  static int rexec_flag = 1;
  static int rexec_argc = 0;
  static char **rexec_argv;
  static int listen_socks[MAX_LISTEN_SOCKS];
  static int num_listen_socks = 0;
  static int have_agent = 0;
  static int *startup_pipes = NULL;
  static int startup_pipe;


More information about the openssh-unix-dev mailing list