Mimir has been busy with patches again, and sent in the following
authorAndrew Bartlett <abartlet@samba.org>
Fri, 26 Jul 2002 13:05:29 +0000 (13:05 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 26 Jul 2002 13:05:29 +0000 (13:05 +0000)
patches:

Andrew Bartlett

From his e-mail:

Below I attach the following patches as a result of my work
on trusted domains support:
 1) srv_samr_nt.c.diff
    This fixes a bug which caused to return null string as
    the first entry of enumerated accounts list (no matter what
    entry, it was always null string and rid) and possibly
    spoiled further names, depeding on their length.
    I found that while testing my 'net rpc trustdom list'
    against nt servers and samba server.
 2) libsmb.diff
    Now, fallback to anonymous connection works correctly.
 3) smbpasswd.c.diff
    Just a little fix which actually allows one to create
    a trusting domain account using smbpasswd
 4) typos.diff
    As the name suggests, it's just a few typos fix :)
(This used to be commit 888d595fab4f6b28318b743f47378cb7ca35d479)

source3/libsmb/cliconnect.c
source3/passdb/pdb_tdb.c
source3/rpc_server/srv_samr_nt.c
source3/smbd/process.c
source3/utils/smbpasswd.c

index d304da7f51868311c2fb37e9f80c63d93b42be93..d29a6115fb1b472abfb9815c55cf10a1a2406b5d 100644 (file)
@@ -1191,9 +1191,8 @@ again:
        if (!cli_session_setup(cli, user, password, strlen(password)+1, 
                               password, strlen(password)+1, 
                               domain)) {
-               if (!(flags & CLI_FULL_CONNECTION_ANNONYMOUS_FALLBACK) 
-                   || cli_session_setup(cli, "", "", 0, 
-                                        "", 0, domain)) {
+               if ((flags & CLI_FULL_CONNECTION_ANNONYMOUS_FALLBACK)
+                   && cli_session_setup(cli, "", "", 0, "", 0, domain)) {
                } else {
                        nt_status = cli_nt_error(cli);
                        DEBUG(1,("failed session setup with %s\n", nt_errstr(nt_status)));
index 0b3eaea900d6169672af0e1f397d9594388d0f50..17b440264462124d9965925a525f6c0de0e2c963 100644 (file)
@@ -542,7 +542,7 @@ static BOOL tdbsam_getsampwent(struct pdb_methods *my_methods, SAM_ACCOUNT *user
                /* increment to next in line */
                tdb_state->key = tdb_nextkey(tdb_state->passwd_tdb, tdb_state->key);
 
-       /* do we have an valid interation pointer? */
+       /* do we have an valid iteration pointer? */
        if(tdb_state->passwd_tdb == NULL) {
                DEBUG(0,("pdb_get_sampwent: Bad TDB Context pointer.\n"));
                return False;
index eb74acf35be34584e432ec39ce87d41f6c32ab40..2a7a5518cdddca2c9dd969bc41189f59863676ab 100644 (file)
@@ -727,8 +727,6 @@ static NTSTATUS make_user_sam_entry_list(TALLOC_CTX *ctx, SAM_ENTRY **sam_pp, UN
        }
 
        for (i = 0; i < num_entries; i++) {
-               int len = uni_temp_name.uni_str_len;
-               
                pwd = disp_user_info[i+start_idx].sam;
                temp_name = pdb_get_username(pwd);
                init_unistr2(&uni_temp_name, temp_name, strlen(temp_name)+1);
@@ -743,7 +741,7 @@ static NTSTATUS make_user_sam_entry_list(TALLOC_CTX *ctx, SAM_ENTRY **sam_pp, UN
                        return NT_STATUS_UNSUCCESSFUL;
                }
 
-               init_sam_entry(&sam[i], len, user_rid);
+               init_sam_entry(&sam[i], uni_temp_name.uni_str_len, user_rid);
                copy_unistr2(&uni_name[i], &uni_temp_name);
        }
 
index 6e38f3736e5ae35a728c937fe58152484deaf87a..55234ec896e422b7b14899401bea15fddce9facc 100644 (file)
@@ -152,7 +152,7 @@ static void async_processing(char *buffer, int buffer_len)
   Returns False on timeout or error.
   Else returns True.
 
-The timeout is in milli seconds
+The timeout is in milliseconds
 ****************************************************************************/
 
 static BOOL receive_message_or_smb(char *buffer, int buffer_len, int timeout)
index 70bf551edbfdb3561971e0230bf22477a849a22f..98993676c98637fe3a90535c8fbbe116d9f05d44 100644 (file)
@@ -92,7 +92,7 @@ static int process_options(int argc, char **argv, int local_flags)
 
        user_name[0] = '\0';
 
-       while ((ch = getopt(argc, argv, "c:axdehmnjr:sw:R:D:U:L")) != EOF) {
+       while ((ch = getopt(argc, argv, "c:axdehminjr:sw:R:D:U:L")) != EOF) {
                switch(ch) {
                case 'L':
                        local_flags |= LOCAL_AM_ROOT;
@@ -416,9 +416,11 @@ static int process_root(int local_flags)
                                exit(1);
                        }
                }
+               
+               /* prepare uppercased and '$' terminated username */
                slprintf(buf, sizeof(buf) - 1, "%s$", user_name);
                fstrcpy(user_name, buf);
-
+               
        } else {
                
                if (remote_machine != NULL) {