about unification of error/return codes

Michael Adam ma at sernet.de
Thu Aug 17 13:11:48 GMT 2006


Hi!

Find attached the uncontroversial part of the patch 
to ads_ntstatus() which makes use of map_nt_error_from_unix
and adds the mapping of the kerberos clock skew error.

Michael

On Thu, Aug 17, 2006 at 02:55:19PM +0200, Michael Adam wrote:
>
> [...]
> 
> Any opinions about this integration of LDAP error codes into NTSTATUS?

-------------- next part --------------
Index: libads/ads_status.c
===================================================================
--- libads/ads_status.c	(revision 17585)
+++ libads/ads_status.c	(working copy)
@@ -72,18 +72,18 @@
 	if (status.error_type == ENUM_ADS_ERROR_NT){
 		return status.err.nt_status;	
 	}
-#ifdef HAVE_LDAP
-	if ((status.error_type == ENUM_ADS_ERROR_LDAP) 
-	    && (status.err.rc == LDAP_NO_MEMORY)) {
-		return NT_STATUS_NO_MEMORY;
+	if (status.error_type == ENUM_ADS_ERROR_SYSTEM) {
+		return map_nt_error_from_unix(status.err.rc);
 	}
-#endif
 #ifdef HAVE_KRB5
+	/* preliminary mapping of selected krb5 error codes */
 	if (status.error_type == ENUM_ADS_ERROR_KRB5) { 
 		if (status.err.rc == KRB5KDC_ERR_PREAUTH_FAILED) {
 			return NT_STATUS_LOGON_FAILURE;
 		} else if (status.err.rc == KRB5_KDC_UNREACH) {
 			return NT_STATUS_NO_LOGON_SERVERS;
+		} else if (status.err.rc == KRB5KRB_AP_ERR_SKEW) {
+			return NT_STATUS_TIME_DIFFERENCE_AT_DC;
 		}
 	}
 #endif


More information about the samba-technical mailing list