- ctrl_radiobuttons(s, "Session logging:", NO_SHORTCUT, 1,
- HELPCTX(logging_main),
- dlg_stdradiobutton_handler, I(offsetof(Config, logtype)),
- "Logging turned off completely", 't', I(LGTYP_NONE),
- "Log printable output only", 'p', I(LGTYP_ASCII),
- "Log all session output", 'l', I(LGTYP_DEBUG),
- "Log SSH packet data", 's', I(LGTYP_PACKETS),
- NULL);
+ /*
+ * The logging buttons change depending on whether SSH packet
+ * logging can sensibly be available.
+ */
+ {
+ char *sshlogname;
+ if ((midsession && protocol == PROT_SSH) ||
+ (!midsession && backends[3].name != NULL))
+ sshlogname = "Log SSH packet data";
+ else
+ sshlogname = NULL; /* this will disable the button */
+ ctrl_radiobuttons(s, "Session logging:", NO_SHORTCUT, 1,
+ HELPCTX(logging_main),
+ dlg_stdradiobutton_handler,
+ I(offsetof(Config, logtype)),
+ "Logging turned off completely", 't', I(LGTYP_NONE),
+ "Log printable output only", 'p', I(LGTYP_ASCII),
+ "Log all session output", 'l', I(LGTYP_DEBUG),
+ sshlogname, 's', I(LGTYP_PACKETS),
+ NULL);
+ }