s3:passdb make pdb_sid_to_id honor backend responsibilities
authorChristian Ambach <ambi@samba.org>
Tue, 18 Jun 2013 08:47:33 +0000 (10:47 +0200)
committerMichael Adam <obnox@samba.org>
Fri, 21 Jun 2013 08:44:21 +0000 (10:44 +0200)
only ask passdb backend for mapping if it is responsible

Pair-Programmed-With: Michael Adam <obnox@samba.org>

Signed-off-by: Christian Ambach <ambi@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
source3/passdb/pdb_interface.c

index b45b4d66bbd528770adacdf056f6e40f0e1b02de..ea67e2faf51d5e7602e40dfc914b18c71743bb50 100644 (file)
@@ -34,6 +34,7 @@
 #include "../libcli/security/security.h"
 #include "../lib/util/util_pw.h"
 #include "passdb/pdb_secrets.h"
+#include "lib/util_sid_passdb.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_PASSDB
@@ -1217,6 +1218,12 @@ bool pdb_gid_to_sid(gid_t gid, struct dom_sid *sid)
 bool pdb_sid_to_id(const struct dom_sid *sid, struct unixid *id)
 {
        struct pdb_methods *pdb = pdb_get_methods();
+
+       /* only ask the backend if it is responsible */
+       if (!sid_check_object_is_for_passdb(sid)) {
+               return false;
+       }
+
        return pdb->sid_to_id(pdb, sid, id);
 }