a few quite serious fixes

mimir at diament.ists.pwr.wroc.pl mimir at diament.ists.pwr.wroc.pl
Thu Jul 25 09:40:02 GMT 2002


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 :)


More patches (for net tool mostly) on the way. I just need
to split them out from quite big 'cvs diff' result.


-- 
cheers,
+------------------------------------------------------------+
|Rafal 'Mimir' Szczesniak <mimir at diament.ists.pwr.wroc.pl>   |
|*BSD, GNU/Linux and Samba                                  /
|__________________________________________________________/
-------------- next part --------------
Index: rpc_server/srv_samr_nt.c
===================================================================
RCS file: /cvsroot/samba/source/rpc_server/srv_samr_nt.c,v
retrieving revision 1.104
diff -u -r1.104 srv_samr_nt.c
--- rpc_server/srv_samr_nt.c	21 Jul 2002 00:08:16 -0000	1.104
+++ rpc_server/srv_samr_nt.c	24 Jul 2002 16:40:19 -0000
@@ -727,8 +727,6 @@
 	}
 
 	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 @@
 			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);
 	}
 
-------------- next part --------------
Index: libsmb/cliconnect.c
===================================================================
RCS file: /cvsroot/samba/source/libsmb/cliconnect.c,v
retrieving revision 1.90
diff -u -r1.90 cliconnect.c
--- libsmb/cliconnect.c	22 Jul 2002 14:00:40 -0000	1.90
+++ libsmb/cliconnect.c	24 Jul 2002 16:40:01 -0000
@@ -1191,9 +1191,8 @@
 	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)));
-------------- next part --------------
Index: utils/smbpasswd.c
===================================================================
RCS file: /cvsroot/samba/source/utils/smbpasswd.c,v
retrieving revision 1.143
diff -u -r1.143 smbpasswd.c
--- utils/smbpasswd.c	22 May 2002 12:44:45 -0000	1.143
+++ utils/smbpasswd.c	24 Jul 2002 16:40:29 -0000
@@ -92,7 +92,7 @@
 
 	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 @@
 				exit(1);
 			}
 		}
+		
+		/* prepare uppercased and '$' terminated username */
 		slprintf(buf, sizeof(buf) - 1, "%s$", user_name);
 		fstrcpy(user_name, buf);
-
+		
 	} else {
 		
 		if (remote_machine != NULL) {
-------------- next part --------------
Index: smbd/process.c
===================================================================
RCS file: /cvsroot/samba/source/smbd/process.c,v
retrieving revision 1.99
diff -u -r1.99 process.c
--- smbd/process.c	20 Jul 2002 08:44:34 -0000	1.99
+++ smbd/process.c	24 Jul 2002 16:40:23 -0000
@@ -152,7 +152,7 @@
   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: passdb/pdb_tdb.c
===================================================================
RCS file: /cvsroot/samba/source/passdb/pdb_tdb.c,v
retrieving revision 1.67
diff -u -r1.67 pdb_tdb.c
--- passdb/pdb_tdb.c	21 Jul 2002 04:55:11 -0000	1.67
+++ passdb/pdb_tdb.c	24 Jul 2002 16:40:08 -0000
@@ -542,7 +542,7 @@
 		/* 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;


More information about the samba-technical mailing list