From d30b6ab54847164aa3add34f3b50132af58f9453 Mon Sep 17 00:00:00 2001 From: Herb Lewis Date: Thu, 12 Nov 1998 22:17:51 +0000 Subject: .cvsignore: Removed old entries. client/client.c: include/client.h: Added some debug messages that the old client used to generate. These are needed to make scripts such as 'findsmb' work - there may be other changes to keep backwards output compatibility. Do we need a -old-client-compat argument ? libsmb/clientgen.c: Fixed crash bug where malloc'ed data wasn't being cleared - corrupted malloc chains. web/swat.c: John's changes to get rid of "ghost" table entries. (This used to be commit 3c45a3503ea57d17e98eb3e57514161a5c82e45e) --- source3/.cvsignore | 30 +----------------------------- source3/client/client.c | 14 +++++++++++++- source3/include/client.h | 9 +++++++++ source3/libsmb/clientgen.c | 18 +++++++++++++++++- source3/web/swat.c | 45 ++++++++++++++++++++++++--------------------- 5 files changed, 64 insertions(+), 52 deletions(-) (limited to 'source3') diff --git a/source3/.cvsignore b/source3/.cvsignore index 7d823233f5..247b980fa8 100644 --- a/source3/.cvsignore +++ b/source3/.cvsignore @@ -1,36 +1,8 @@ -.deps bin Makefile -Makefile.RPM -config config.cache config.h config.log config.status cvs.log -d2 -make_printerdef -make_smbcodepage -makefile -makefile.sunos5 -memcheck.awk -nmbd -nmblookup -nmfns.txt -nmlist.txt -nmused.txt -notes.txt -smbclient -smbd -smbpasswd -smbrun -smbstatus -smbtorture -swat -testparm -testprns -text.txt -unused.txt -wsmbconf -wsmbstatus -*.p +so_locations diff --git a/source3/client/client.c b/source3/client/client.c index e23875fc1b..185919bf5f 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -1685,6 +1685,18 @@ struct cli_state *do_connect(char *server, char *share) return NULL; } + /* + * These next two lines are needed to emulate + * old client behaviour for people who have + * scripts based on client output. + * QUESTION ? Do we want to have a 'client compatibility + * mode to turn these on/off ? JRA. + */ + + if (*c->server_domain || *c->server_os || *c->server_name) + DEBUG(1,("Domain=[%s] OS=[%s] Server=[%s]\n", + c->server_domain,c->server_os,c->server_name)); + DEBUG(4,(" session setup ok\n")); if (!cli_send_tconX(c, share, "?????", @@ -1710,7 +1722,7 @@ static BOOL process(char *base_directory) if (!cli) { return(False); } - + if (*base_directory) do_cd(base_directory); if (cmdstr) { diff --git a/source3/include/client.h b/source3/include/client.h index 0d5d2ea8fb..0f28fa0d08 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -87,6 +87,15 @@ struct cli_state { fstring user_name; fstring domain; + /* + * The following strings are the + * ones returned by the server if + * the protocol > NT1. + */ + fstring server_type; + fstring server_os; + fstring server_domain; + fstring share; fstring dev; struct nmb_name called; diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index b4ca7a1d77..4eaebfa6ed 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -772,6 +772,20 @@ BOOL cli_session_setup(struct cli_state *cli, /* use the returned vuid from now on */ cli->vuid = SVAL(cli->inbuf,smb_uid); + if (cli->protocol >= PROTOCOL_NT1) { + /* + * Save off some of the connected server + * info. + */ + char *server_domain,*server_os,*server_type; + server_os = smb_buf(cli->inbuf); + server_type = skip_string(server_os,1); + server_domain = skip_string(server_type,1); + fstrcpy(cli->server_os, server_os); + fstrcpy(cli->server_type, server_type); + fstrcpy(cli->server_domain, server_domain); + } + fstrcpy(cli->user_name, user); return True; @@ -2349,7 +2363,9 @@ struct cli_state *cli_initialise(struct cli_state *cli) { if (!cli) { cli = (struct cli_state *)malloc(sizeof(*cli)); - if (!cli) return NULL; + if (!cli) + return NULL; + ZERO_STRUCTP(cli); } if (cli->initialised) { diff --git a/source3/web/swat.c b/source3/web/swat.c index c2e5ea560e..ecfc480395 100644 --- a/source3/web/swat.c +++ b/source3/web/swat.c @@ -702,25 +702,26 @@ static void passwd_page(void) /* * Create all the dialog boxes for data collection */ - printf("

User Name : \n", - USER, new_name); + printf(" User Name : \n"); + printf(" \n", USER, new_name); if (am_root() == False) { - printf("

Old Password: \n",OLD_PSWD); + printf(" Old Password : \n"); + printf(" \n",OLD_PSWD); } - printf("

New Password: \n",NEW_PSWD); - printf("

Re-type New Password: \n",NEW2_PSWD); + printf(" New Password : \n"); + printf("\n",NEW_PSWD); + printf(" Re-type New Password : \n"); + printf("\n",NEW2_PSWD); /* * Create all the control buttons for requesting action */ - printf("

"); - printf("", CHG_S_PASSWD_FLAG); + printf("\n", CHG_S_PASSWD_FLAG); if (am_root() == True) { - printf("", ADD_USER_FLAG); - printf("", DISABLE_USER_FLAG); - printf("", ENABLE_USER_FLAG); + printf("\n", ADD_USER_FLAG); + printf("\n", DISABLE_USER_FLAG); + printf("\n", ENABLE_USER_FLAG); } - printf("\n"); /* * Do some work if change, add, disable or enable was requested. It could be @@ -731,7 +732,7 @@ static void passwd_page(void) chg_passwd(); } - printf(""); + printf("\n"); printf("\n"); @@ -744,19 +745,21 @@ static void passwd_page(void) /* * Create all the dialog boxes for data collection */ - printf("

User Name : \n", - USER, new_name); - printf("

Old Password: \n",OLD_PSWD); - printf("

New Password: \n",NEW_PSWD); - printf("

Re-type New Password: \n",NEW2_PSWD); - printf("

Remote Machine: \n",RHOST); + printf(" User Name : \n"); + printf("\n",USER, new_name); + printf(" Old Password : \n"); + printf("\n",OLD_PSWD); + printf(" New Password : \n"); + printf("\n",NEW_PSWD); + printf(" Re-type New Password : \n"); + printf("\n",NEW2_PSWD); + printf(" Remote Machine : \n"); + printf("\n",RHOST); /* * Create all the control buttons for requesting action */ - printf("

"); - printf("", CHG_R_PASSWD_FLAG); - printf("\n"); + printf("", CHG_R_PASSWD_FLAG); /* * Do some work if a request has been made to change the password somewhere other -- cgit