From c99338b750aed3714d56faa39bd0074db58a0d4a Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 27 Nov 2017 19:38:02 +0000 Subject: [PATCH] Stop linking cmdline.c into the gtkapp-based programs. They don't do normal command-line processing, so they don't need it. A few stray references to machinery provided in there are now satisfied instead by a new stub module nocmdline.c. --- Recipe | 19 ++++++++++--------- nocmdline.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 9 deletions(-) create mode 100644 nocmdline.c diff --git a/Recipe b/Recipe index 33d0f2f7..e065c37d 100644 --- a/Recipe +++ b/Recipe @@ -241,6 +241,7 @@ GUITERM = TERMINAL window windlg winctrls sizetip winprint winutils UXTERM = TERMINAL uxcfg sercfg uxucs uxprint timing callback miscucs GTKTERM = UXTERM gtkwin gtkcfg gtkdlg gtkfont gtkcols gtkmisc xkeysym + x11misc gtkcomm +GTKMAIN = gtkmain cmdline # Non-SSH back ends (putty, puttytel, plink). NONSSH = telnet raw rlogin ldisc pinger @@ -255,14 +256,14 @@ WINSSH = SSH winnoise wincapi winpgntc wingss winshare winnps winnpc UXSSH = SSH uxnoise uxagentc uxgss uxshare # SFTP implementation (pscp, psftp). -SFTP = sftp int64 logging +SFTP = sftp int64 logging cmdline # Miscellaneous objects appearing in all the network utilities (not # Pageant or PuTTYgen). MISC = timing callback misc version settings tree234 proxy conf be_misc WINMISC = MISC winstore winnet winhandl cmdline windefs winmisc winproxy + wintime winhsock errsock winsecur winucs miscucs -UXMISC = MISC uxstore uxsel uxnet uxpeer cmdline uxmisc uxproxy time +UXMISC = MISC uxstore uxsel uxnet uxpeer uxmisc uxproxy time # import.c and dependencies, for PuTTYgen-like utilities that have to # load foreign key files. @@ -315,16 +316,16 @@ puttygen : [G] winpgen sshrsag sshdssg sshprime sshdes sshbn sshmd5 version pterm : [X] GTKTERM uxmisc misc ldisc settings uxpty uxsel BE_NONE uxstore + uxsignal CHARSET cmdline uxpterm version time xpmpterm xpmptcfg - + nogss gtkmain + + nogss GTKMAIN putty : [X] GTKTERM uxmisc misc ldisc settings uxsel U_BE_ALL uxstore + uxsignal CHARSET uxputty NONSSH UXSSH UXMISC ux_x11 xpmputty - + xpmpucfg gtkmain + + xpmpucfg GTKMAIN puttytel : [X] GTKTERM uxmisc misc ldisc settings uxsel U_BE_NOSSH + uxstore uxsignal CHARSET uxputty NONSSH UXMISC xpmputty xpmpucfg - + nogss gtkmain + + nogss GTKMAIN plink : [U] uxplink uxcons NONSSH UXSSH U_BE_ALL logging UXMISC uxsignal - + ux_x11 noterm uxnogtk + + ux_x11 noterm uxnogtk cmdline PUTTYGEN_UNIX = sshrsag sshdssg sshprime sshdes sshbn sshmd5 version + sshrand uxnoise sshsha misc sshrsa sshdss uxcons uxstore uxmisc @@ -342,11 +343,11 @@ pageant : [X] uxpgnt uxagentc aqsync pageant sshrsa sshpubk sshdes sshbn + gtkask gtkmisc UXMISC ptermapp : [XT] GTKTERM uxmisc misc ldisc settings uxpty uxsel BE_NONE uxstore - + uxsignal CHARSET cmdline uxpterm version time xpmpterm xpmptcfg - + nogss gtkapp + + uxsignal CHARSET uxpterm version time xpmpterm xpmptcfg + + nogss gtkapp nocmdline puttyapp : [XT] GTKTERM uxmisc misc ldisc settings uxsel U_BE_ALL uxstore + uxsignal CHARSET uxputty NONSSH UXSSH UXMISC ux_x11 xpmputty - + xpmpucfg gtkapp + + xpmpucfg gtkapp nocmdline osxlaunch : [UT] osxlaunch fuzzterm : [UT] UXTERM CHARSET misc version uxmisc uxucs fuzzterm time settings diff --git a/nocmdline.c b/nocmdline.c new file mode 100644 index 00000000..a7643385 --- /dev/null +++ b/nocmdline.c @@ -0,0 +1,42 @@ +/* + * nocmdline.c - stubs in applications which don't do the + * standard(ish) PuTTY tools' command-line parsing + */ + +#include +#include +#include +#include "putty.h" + +/* + * Stub version of the function in cmdline.c which provides the + * password to SSH authentication by remembering it having been passed + * as a command-line option. If we're not doing normal command-line + * handling, then there is no such option, so that function always + * returns failure. + */ +int cmdline_get_passwd_input(prompts_t *p, const unsigned char *in, int inlen) +{ + return -1; +} + +/* + * The main cmdline_process_param function is normally called from + * applications' main(). An application linking against this stub + * module shouldn't have a main() that calls it in the first place :-) + * but it is just occasionally called by other supporting functions, + * such as one in uxputty.c which sometimes handles a non-option + * argument by making up equivalent options and passing them back to + * this function. So we have to provide a link-time stub of this + * function, but it had better not end up being called at run time. + */ +int cmdline_process_param(const char *p, char *value, + int need_save, Conf *conf) +{ + assert(FALSE && "cmdline_process_param should never be called"); +} + +/* + * This variable will be referred to, so it has to exist. It's ignored. + */ +int cmdline_tooltype = 0;