drs-crackname: Fix cracknames for the format UNKNOWN when the data is actually a...
authorMatthieu Patou <mat@matws.net>
Sat, 29 Jun 2013 23:02:32 +0000 (16:02 -0700)
committerMatthieu Patou <mat@matws.net>
Wed, 7 Aug 2013 04:22:02 +0000 (21:22 -0700)
The cannonical crackname expect a "/" or it returns
DRSUAPI_DS_NAME_STATUS_RESOLVE_ERROR, when doing UNKNOWN format it's not
an error to not have a "/" in the name to crack it's just a sign the
name is not a cannonical one.

Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Andrew Bartlett <abarlett@samba.org>
source4/dsdb/samdb/cracknames.c

index 0c4cdfc2d3f539f0328940e140a22b25db980e5f..388b6c7cec0e174bbfe4b64e4c95e3dd14c00a56 100644 (file)
@@ -488,7 +488,10 @@ WERROR DsCrackNameOneName(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ctx,
                        if (!W_ERROR_IS_OK(werr)) {
                                return werr;
                        }
-                       if (info1->status != DRSUAPI_DS_NAME_STATUS_NOT_FOUND) {
+                       if (info1->status != DRSUAPI_DS_NAME_STATUS_NOT_FOUND &&
+                           (formats[i] != DRSUAPI_DS_NAME_FORMAT_CANONICAL ||
+                            info1->status != DRSUAPI_DS_NAME_STATUS_RESOLVE_ERROR))
+                       {
                                return werr;
                        }
                }