Patch for parse_samr.c:make_sam_info_1

Sean Mathews mathewss at nutech.com
Mon Jan 11 17:47:05 GMT 1999


patch for parse_samr.c
ya there probably is a function that reads in the list of
group #'s but i dont know the code set well enough yet 
to have found it. So this is just a test on my part to 
eliminate the problem.


 Regards 
  Sean Mathews Nu Tech CTO

struct SoftwareProfessional { 
  double salary;
  long   lunches;
  float  jobs;
  char   unstable;
  void   work;
  short  tempers; 
};

-------------- next part --------------
--- parse_samr.c	Mon Jan 11 09:37:06 1999
+++ ../parse_samr.c	Sat Jan  9 23:14:01 1999
@@ -1066,7 +1066,7 @@
 		uint32 start_idx, uint32 num_sam_entries,
 		SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES])
 {
-	int i;
+	int i,x;
 	int entries_added;
 
 	if (sam == NULL) return;
@@ -1080,7 +1080,21 @@
 			 num_sam_entries));
 	}
 
-	for (i = start_idx, entries_added = 0; i < num_sam_entries; i++)
+	/* Actual start_idx needs to be based upon the acb_mask 
+	   so we will sync i to the needed starting point in pass[] 
+	   SeanM*/
+	for (i = 0, x = 0; i < num_sam_entries; i++)
+	{
+		if (IS_BITS_SET_ALL(pass[i].acb_info, acb_mask))
+		{			
+			if(x == start_idx)
+			     break;
+			x++;
+		}
+	}
+
+
+	for (entries_added = 0; i < num_sam_entries; i++)
 	{
 		if (IS_BITS_SET_ALL(pass[i].acb_info, acb_mask))
 		{
@@ -1148,7 +1162,7 @@
 		uint32 start_idx, uint32 num_sam_entries,
 		SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES])
 {
-	int i;
+	int i,x;
 	int entries_added;
 
 	if (sam == NULL) return;
@@ -1162,7 +1176,19 @@
 			 num_sam_entries));
 	}
 
-	for (i = start_idx, entries_added = 0; i < num_sam_entries; i++)
+	/* Actual start_idx needs to be based upon the acb_mask
+	   so we will sync i to the needed starting point in pass[] */
+	for (i = 0, x = 0; i < num_sam_entries; i++)
+	{
+	   if (IS_BITS_SET_ALL(pass[i].acb_info, acb_mask))
+	   {
+	     if(x == start_idx)
+		break;
+	     x++;
+	   }
+	}
+
+	for (entries_added = 0; i < num_sam_entries; i++)
 	{
 		if (IS_BITS_SET_ALL(pass[i].acb_info, acb_mask))
 		{


More information about the samba-ntdom mailing list