]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
clearing up connection-related stuff. password credentials were messing
authorLuke Leighton <lkcl@samba.org>
Thu, 2 Dec 1999 01:16:05 +0000 (01:16 +0000)
committerLuke Leighton <lkcl@samba.org>
Thu, 2 Dec 1999 01:16:05 +0000 (01:16 +0000)
up.

added a complicated prompt which i don't like, but it tells you
domain\user@hostname$
(This used to be commit 338d08f69b0eeefa0f3f2c0217ef17ea3e815e1f)

source3/libsmb/pwd_cache.c
source3/rpc_client/cli_connect.c
source3/rpcclient/rpcclient.c

index 9680349a86e3724c0c548c696e062eb407ed6d7c..548777d434d75cb868ffe26182a3275f55d7e2f2 100644 (file)
@@ -85,16 +85,8 @@ BOOL pwd_compare(struct pwd_info *pwd1, struct pwd_info *pwd2)
                pwd_obfuscate(pwd2);
                return True;
        }
-       if (pwd1->crypted || pwd2->crypted)
-       {
-               DEBUG(5,("pwd_compare: cannot compare crypted passwords\n"));
-               pwd_obfuscate(pwd1);
-               pwd_obfuscate(pwd2);
-               return False;
-       }
 
-       if (!pwd1->crypted   && !pwd2->crypted &&
-           !pwd1->null_pwd  && !pwd2->null_pwd &&
+       if (!pwd1->null_pwd  && !pwd2->null_pwd &&
            !pwd1->cleartext && !pwd2->cleartext)
        {
                if (memcmp(pwd1->smb_nt_pwd, pwd2->smb_nt_pwd, 16) == 0)
index d9ae71e6c960a22be2ea45943f2bc1b232232562..6faf7cc28b9526510646646bcd7434401fb3ba29 100644 (file)
@@ -159,7 +159,9 @@ void cli_connection_free(struct cli_connection *con)
        {
                for (i = 0; i < num_cons; i++)
                {
-                       if (con != con_list[i] && con_list[i]->cli == con->cli)
+                       if (con_list[i] != NULL &&
+                           con != con_list[i] &&
+                           con_list[i]->cli == con->cli)
                        {
                                /* WHOOPS! fnum already open: too bad!!! */
                                con_list[i]->cli = NULL;
index dfbd3fae7a64bb5d0e0fdfc53e4dbf0a481009f0..2339cc892b94ec668983e37b6b18d1072320ef63 100644 (file)
@@ -755,14 +755,32 @@ static BOOL process( struct client_info *info, char *cmd_str)
        }
        else while (!feof(stdin))
        {
-#ifdef HAVE_LIBREADLINE
-               pstring promptline;
-#endif
+               pstring pline;
+               BOOL at_sym = False;
+               pline[0] = 0;
+               if (usr.domain[0] != 0)
+               {
+                       safe_strcat(pline, usr.domain, sizeof(pline)-1);
+                       safe_strcat(pline, "\\", sizeof(pline)-1);
+                       at_sym = True;
+               }
+               if (usr.user_name[0] != 0)
+               {
+                       safe_strcat(pline, usr.user_name, sizeof(pline)-1);
+                       at_sym = True;
+               }
+               if (at_sym)
+               {
+                       safe_strcat(pline, "@", sizeof(pline)-1);
+               }
+       
+               safe_strcat(pline, cli_info.dest_host, sizeof(pline)-1);
+               safe_strcat(pline, "$ ", sizeof(pline)-1);
 
 #ifndef HAVE_LIBREADLINE
 
                /* display a prompt */
-               fprintf(out_hnd, "%s$ ", CNV_LANG(cli_info.dest_host));
+               fprintf(out_hnd, "%s", CNV_LANG(promptline));
                fflush(out_hnd);
 
                cli_net_wait_keyboard();
@@ -775,10 +793,7 @@ static BOOL process( struct client_info *info, char *cmd_str)
 
 #else /* HAVE_LIBREADLINE */
 
-               slprintf(promptline, sizeof(promptline) - 1, "%s$ ",
-                        CNV_LANG(cli_info.dest_host));
-
-               if (!readline(promptline))
+               if (!readline(pline))
                    break;
 
                /* Copy read line to samba buffer */