svn commit: samba r2064 - branches/SAMBA_4_0/source/libnet

metze at samba.org metze at samba.org
Wed Aug 25 11:04:48 GMT 2004


Author: metze
Date: 2004-08-25 11:04:47 +0000 (Wed, 25 Aug 2004)
New Revision: 2064

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/&rev=2064&nolog=1

Log:
fix some error cases

metze

Modified:
   branches/SAMBA_4_0/source/libnet/libnet_passwd.c


Changeset:
Modified: branches/SAMBA_4_0/source/libnet/libnet_passwd.c
===================================================================
--- branches/SAMBA_4_0/source/libnet/libnet_passwd.c	2004-08-25 10:46:28 UTC (rev 2063)
+++ branches/SAMBA_4_0/source/libnet/libnet_passwd.c	2004-08-25 11:04:47 UTC (rev 2064)
@@ -107,7 +107,8 @@
 						r->samr.in.domain_name, r->samr.in.account_name, 
 						nt_errstr(pw3.out.result));
 						/* TODO: give the reason of the reject */
-		if (NT_STATUS_EQUAL(status, NT_STATUS_PASSWORD_RESTRICTION)) {
+		if (NT_STATUS_EQUAL(pw3.out.result, NT_STATUS_PASSWORD_RESTRICTION)) {
+			status = pw3.out.result;
 			goto disconnect;
 		}
 		goto ChangePasswordUser2;
@@ -148,6 +149,10 @@
 						"samr_ChangePasswordUser2 for '%s\\%s' failed: %s\n",
 						r->samr.in.domain_name, r->samr.in.account_name, 
 						nt_errstr(pw2.out.result));
+		if (NT_STATUS_EQUAL(pw2.out.result, NT_STATUS_PASSWORD_RESTRICTION)) {
+			status = pw2.out.result;
+			goto disconnect;
+		}
 		goto OemChangePasswordUser2;
 	}
 
@@ -182,6 +187,10 @@
 						"samr_OemChangePasswordUser2 for '%s\\%s' failed: %s\n",
 						r->samr.in.domain_name, r->samr.in.account_name, 
 						nt_errstr(oe2.out.result));
+		if (NT_STATUS_EQUAL(oe2.out.result, NT_STATUS_PASSWORD_RESTRICTION)) {
+			status = oe2.out.result;
+			goto disconnect;
+		}
 		goto ChangePasswordUser;
 	}
 
@@ -225,6 +234,10 @@
 						"samr_ChangePasswordUser for '%s\\%s' failed: %s\n",
 						r->samr.in.domain_name, r->samr.in.account_name, 
 						nt_errstr(pw.out.result));
+		if (NT_STATUS_EQUAL(pw.out.result, NT_STATUS_PASSWORD_RESTRICTION)) {
+			status = pw.out.result;
+			goto disconnect;
+		}
 		goto disconnect;
 	}
 #endif
@@ -341,6 +354,7 @@
 		r->samr.out.error_string = talloc_asprintf(mem_ctx,
 						"samr_Connect failed: %s\n", 
 						nt_errstr(sc.out.result));
+		status = sc.out.result;
 		goto disconnect;
 	}
 
@@ -363,6 +377,7 @@
 		r->samr.out.error_string = talloc_asprintf(mem_ctx,
 						"samr_LookupDomain for [%s] failed: %s\n",
 						r->samr.in.domain_name, nt_errstr(ld.out.result));
+		status = ld.out.result;
 		goto disconnect;
 	}
 
@@ -387,6 +402,7 @@
 		r->samr.out.error_string = talloc_asprintf(mem_ctx,
 						"samr_OpenDomain for [%s] failed: %s\n",
 						r->samr.in.domain_name, nt_errstr(od.out.result));
+		status = od.out.result;
 		goto disconnect;
 	}
 
@@ -414,6 +430,7 @@
 		r->samr.out.error_string = talloc_asprintf(mem_ctx,
 						"samr_LookupNames for [%s] failed: %s\n",
 						r->samr.in.account_name, nt_errstr(ln.out.result));
+		status = ln.out.result;
 		goto disconnect;
 	}
 
@@ -422,6 +439,7 @@
 		r->samr.out.error_string = talloc_asprintf(mem_ctx,
 						"samr_LookupNames for [%s] returns %d RIDs\n",
 						r->samr.in.account_name, ln.out.rids.count);
+		status = NT_STATUS_INVALID_PARAMETER;
 		goto disconnect;	
 	}
 
@@ -446,6 +464,7 @@
 		r->samr.out.error_string = talloc_asprintf(mem_ctx,
 						"samr_OpenUser for [%s] failed: %s\n",
 						r->samr.in.account_name, nt_errstr(ou.out.result));
+		status = ou.out.result;
 		goto disconnect;
 	}
 
@@ -490,6 +509,10 @@
 		r->samr.out.error_string = talloc_asprintf(mem_ctx,
 						"SetUserInfo level 26 for [%s] failed: %s\n",
 						r->samr.in.account_name, nt_errstr(sui.out.result));
+		if (NT_STATUS_EQUAL(sui.out.result, NT_STATUS_WRONG_PASSWORD)) {
+			status = sui.out.result;
+			goto disconnect;
+		}
 		goto UserInfo25;
 	}
 
@@ -537,6 +560,10 @@
 		r->samr.out.error_string = talloc_asprintf(mem_ctx,
 						"SetUserInfo level 25 for [%s] failed: %s\n",
 						r->samr.in.account_name, nt_errstr(sui.out.result));
+		if (NT_STATUS_EQUAL(sui.out.result, NT_STATUS_WRONG_PASSWORD)) {
+			status = sui.out.result;
+			goto disconnect;
+		}
 		goto UserInfo24;
 	}
 
@@ -577,6 +604,10 @@
 		r->samr.out.error_string = talloc_asprintf(mem_ctx,
 						"SetUserInfo level 24 for [%s] failed: %s\n",
 						r->samr.in.account_name, nt_errstr(sui.out.result));
+		if (NT_STATUS_EQUAL(sui.out.result, NT_STATUS_WRONG_PASSWORD)) {
+			status = sui.out.result;
+			goto disconnect;
+		}
 		goto UserInfo23;
 	}
 
@@ -616,6 +647,10 @@
 		r->samr.out.error_string = talloc_asprintf(mem_ctx,
 						"SetUserInfo level 23 for [%s] failed: %s\n",
 						r->samr.in.account_name, nt_errstr(sui.out.result));
+		if (NT_STATUS_EQUAL(sui.out.result, NT_STATUS_WRONG_PASSWORD)) {
+			status = sui.out.result;
+			goto disconnect;
+		}
 		goto disconnect;
 	}
 



More information about the samba-cvs mailing list