summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>2000-01-16 17:41:40 +0000
committerLuke Leighton <lkcl@samba.org>2000-01-16 17:41:40 +0000
commit19dca64bb21f4a9a14a0e9465da1c9ddde199956 (patch)
tree86acb95d4934bd2babf0ecc5233a5864360d38c9
parent0d73371384287b1ad0e17e9a05393ed5c954b20c (diff)
downloadsamba-19dca64bb21f4a9a14a0e9465da1c9ddde199956.tar.gz
samba-19dca64bb21f4a9a14a0e9465da1c9ddde199956.tar.xz
samba-19dca64bb21f4a9a14a0e9465da1c9ddde199956.zip
rpcclient wasn't asking for a password if you didn't supply one.
nmbd reload_services() renamed to a static reload_nmbd_services() stopped clientgen.c filling in the domain name in usr_creds, this is "unexpected" behaviour that stops cli_net_use_del() from being able to unlink the SMB connection!
-rw-r--r--source/libsmb/clientgen.c2
-rw-r--r--source/nmbd/nmbd.c12
-rw-r--r--source/rpc_client/cli_use.c11
-rw-r--r--source/rpcclient/display_srv.c4
-rw-r--r--source/rpcclient/rpcclient.c10
5 files changed, 26 insertions, 13 deletions
diff --git a/source/libsmb/clientgen.c b/source/libsmb/clientgen.c
index 8069ebe208a..ceffdada37f 100644
--- a/source/libsmb/clientgen.c
+++ b/source/libsmb/clientgen.c
@@ -3116,11 +3116,13 @@ BOOL cli_establish_connection(struct cli_state *cli,
return False;
}
+#if 0
if (cli->usr.domain[0] == 0)
{
safe_strcpy(cli->usr.domain, cli->server_domain,
sizeof(cli->usr.domain));
}
+#endif
if (IS_BITS_SET_ALL(cli->capabilities, CAP_EXTENDED_SECURITY))
{
diff --git a/source/nmbd/nmbd.c b/source/nmbd/nmbd.c
index b1f3d77150d..270a327ed92 100644
--- a/source/nmbd/nmbd.c
+++ b/source/nmbd/nmbd.c
@@ -61,7 +61,7 @@ extern struct in_addr ipzero;
/**************************************************************************** **
reload the services file
**************************************************************************** */
-static BOOL reload_services(BOOL test)
+static BOOL reload_nmbd_services(BOOL test)
{
BOOL ret;
extern fstring remote_machine;
@@ -88,7 +88,7 @@ static BOOL reload_services(BOOL test)
if ( !test )
{
DEBUG( 3, ( "services not loaded\n" ) );
- reload_services( True );
+ reload_nmbd_services( True );
}
/* Do a sanity check for a misconfigured nmbd */
@@ -100,7 +100,7 @@ cannot be set in the smb.conf file. nmbd aborting.\n"));
}
return(ret);
-} /* reload_services */
+} /* reload_nmbd_services */
/**************************************************************************** **
catch a sigterm
@@ -139,7 +139,7 @@ static void sig_hup(int sig)
write_browse_list( 0, True );
dump_all_namelists();
- reload_services( True );
+ reload_nmbd_services( True );
set_samba_nb_type();
@@ -667,7 +667,7 @@ static void usage(char *pname)
return -1;
}
- if ( !reload_services(False) )
+ if ( !reload_nmbd_services(False) )
return(-1);
codepage_initialise(lp_client_code_page());
@@ -675,7 +675,7 @@ static void usage(char *pname)
if(!init_structs())
return -1;
- reload_services( True );
+ reload_nmbd_services( True );
if (!init_myworkgroup())
{
diff --git a/source/rpc_client/cli_use.c b/source/rpc_client/cli_use.c
index de0c6405a22..7165d1390f7 100644
--- a/source/rpc_client/cli_use.c
+++ b/source/rpc_client/cli_use.c
@@ -288,8 +288,10 @@ BOOL cli_net_use_del(const char* srv_name,
int i;
const char *sv_name = srv_name;
- DEBUG(10,("cli_net_use_del: %s. force close: %s\n",
- srv_name, BOOLSTR(force_close)));
+ DEBUG(10,("cli_net_use_del: %s. %s. %s. force close: %s\n",
+ srv_name,
+ usr_creds->user_name, usr_creds->domain,
+ BOOLSTR(force_close)));
if (strnequal("\\\\", sv_name, 2))
{
@@ -309,6 +311,11 @@ BOOL cli_net_use_del(const char* srv_name,
if (clis[i]->cli == NULL) continue;
cli_name = clis[i]->cli->desthost;
+
+ DEBUG(10,("connection: %s %s %s\n", cli_name,
+ clis[i]->cli->usr.user_name,
+ clis[i]->cli->usr.domain));
+
if (strnequal("\\\\", cli_name, 2))
{
cli_name = &cli_name[2];
diff --git a/source/rpcclient/display_srv.c b/source/rpcclient/display_srv.c
index f0069c0d532..57cfa13dde9 100644
--- a/source/rpcclient/display_srv.c
+++ b/source/rpcclient/display_srv.c
@@ -51,13 +51,14 @@ char *get_file_mode_str(uint32 share_mode)
{
static fstring mode;
- switch ((share_mode>>4)&0xF)
+ switch (GET_DENY_MODE(share_mode))
{
case DENY_NONE : fstrcpy(mode, "DENY_NONE "); break;
case DENY_ALL : fstrcpy(mode, "DENY_ALL "); break;
case DENY_DOS : fstrcpy(mode, "DENY_DOS "); break;
case DENY_READ : fstrcpy(mode, "DENY_READ "); break;
case DENY_WRITE: fstrcpy(mode, "DENY_WRITE "); break;
+ case DENY_FCB: fstrcpy(mode, "DENY_FCB "); break;
default : fstrcpy(mode, "DENY_???? "); break;
}
@@ -71,7 +72,6 @@ char *get_file_mode_str(uint32 share_mode)
return mode;
}
-
/****************************************************************************
convert an oplock mode to a string
****************************************************************************/
diff --git a/source/rpcclient/rpcclient.c b/source/rpcclient/rpcclient.c
index 762b2f65e65..e164d21b3f7 100644
--- a/source/rpcclient/rpcclient.c
+++ b/source/rpcclient/rpcclient.c
@@ -1566,8 +1566,8 @@ static void cmd_set(struct client_info *info, int argc, char *argv[])
pstring password; /* local copy only, if one is entered */
extern struct user_creds *usr_creds;
+ password[0] = 0;
usr_creds = &usr;
-
info->reuse = False;
#ifdef KANJI
pstrcpy(term_code, KANJI);
@@ -1784,9 +1784,11 @@ static void cmd_set(struct client_info *info, int argc, char *argv[])
{
set_user_password(&usr.ntc, True, NULL);
}
- else if (IS_BITS_SET_ALL(cmd_set_options, CMD_PASS))
+ else
{
- set_user_password(&usr.ntc, True, password);
+ set_user_password(&usr.ntc,
+ IS_BITS_SET_ALL(cmd_set_options, CMD_PASS),
+ password);
}
/* paranoia: destroy the local copy of the password */
@@ -1916,6 +1918,8 @@ void readline_init(void)
cmd_set_options &= ~CMD_HELP;
cmd_set_options &= ~CMD_NOPW;
+ cmd_set_options &= ~CMD_USER;
+ cmd_set_options &= ~CMD_PASS;
codepage_initialise(lp_client_code_page());