[SCM] Samba Shared Repository - branch master updated

Michael Adam obnox at samba.org
Fri May 2 20:15:04 MDT 2014


The branch, master has been updated
       via  4b324f7 s3: Always cache idmapping results of pdb backend.
       via  a0ab8cb waf: fetch and use some exit codes of called processes
       via  4b4f4e0 samba-tool ldapcmp: fix a typo
      from  ffaa284 s3: smbd: Remove open_file_fchmod().

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 4b324f7f08829ca3df0af291301d5272ae5cede1
Author: Alexander Werth <alexander.werth at de.ibm.com>
Date:   Fri Apr 25 13:53:48 2014 +0200

    s3: Always cache idmapping results of pdb backend.
    
    And don't cache in the pdb_ldap module on the id_to_sid calls.
    
    Signed-off-by: Alexander Werth <alexander.werth at de.ibm.com>
    Reviewed-by: Alexander Bokovoy <ab at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>
    
    Autobuild-User(master): Michael Adam <obnox at samba.org>
    Autobuild-Date(master): Sat May  3 04:14:05 CEST 2014 on sn-devel-104

commit a0ab8cb53712cf77cae1d46f49d8eb56e6d5703b
Author: Björn Baumbach <bb at sernet.de>
Date:   Fri Apr 25 22:05:54 2014 +0200

    waf: fetch and use some exit codes of called processes
    
    Without this patch for example "make ctags" reports "Success",
    also if ctags fails or is not available.
    
    Signed-off-by: Björn Baumbach <bb at sernet.de>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 4b4f4e0f4fafc72da7ab8e594595adcba9a383b6
Author: Björn Baumbach <bb at sernet.de>
Date:   Mon Nov 25 15:29:09 2013 +0100

    samba-tool ldapcmp: fix a typo
    
    Signed-off-by: Björn Baumbach <bb at sernet.de>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 python/samba/netcmd/ldapcmp.py |    4 ++--
 source3/passdb/pdb_interface.c |   36 +++++++++++++++++++++++++++++++++---
 source3/passdb/pdb_ldap.c      |   14 --------------
 wscript                        |   20 +++++++++++++++-----
 4 files changed, 50 insertions(+), 24 deletions(-)


Changeset truncated at 500 lines:

diff --git a/python/samba/netcmd/ldapcmp.py b/python/samba/netcmd/ldapcmp.py
index 7bd118e..89c175b 100644
--- a/python/samba/netcmd/ldapcmp.py
+++ b/python/samba/netcmd/ldapcmp.py
@@ -462,7 +462,7 @@ class LDAPObject(object):
 
     def log(self, msg):
         """
-        Log on the screen if there is no --quiet oprion set
+        Log on the screen if there is no --quiet option set
         """
         if not self.quiet:
             self.outf.write(msg+"\n")
@@ -679,7 +679,7 @@ class LDAPBundel(object):
 
     def log(self, msg):
         """
-        Log on the screen if there is no --quiet oprion set
+        Log on the screen if there is no --quiet option set
         """
         if not self.quiet:
             self.outf.write(msg+"\n")
diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c
index 7a0a824..a984fcb 100644
--- a/source3/passdb/pdb_interface.c
+++ b/source3/passdb/pdb_interface.c
@@ -35,6 +35,7 @@
 #include "../lib/util/util_pw.h"
 #include "passdb/pdb_secrets.h"
 #include "lib/util_sid_passdb.h"
+#include "idmap_cache.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_PASSDB
@@ -1206,25 +1207,54 @@ bool pdb_get_seq_num(time_t *seq_num)
 bool pdb_uid_to_sid(uid_t uid, struct dom_sid *sid)
 {
 	struct pdb_methods *pdb = pdb_get_methods();
-	return pdb->uid_to_sid(pdb, uid, sid);
+	bool ret;
+
+	ret = pdb->uid_to_sid(pdb, uid, sid);
+
+	if (ret == true) {
+		struct unixid id;
+		id.id = uid;
+		id.type = ID_TYPE_UID;
+		idmap_cache_set_sid2unixid(sid, &id);
+	}
+
+	return ret;
 }
 
 bool pdb_gid_to_sid(gid_t gid, struct dom_sid *sid)
 {
 	struct pdb_methods *pdb = pdb_get_methods();
-	return pdb->gid_to_sid(pdb, gid, sid);
+	bool ret;
+
+	ret = pdb->gid_to_sid(pdb, gid, sid);
+
+	if (ret == true) {
+		struct unixid id;
+		id.id = gid;
+		id.type = ID_TYPE_GID;
+		idmap_cache_set_sid2unixid(sid, &id);
+	}
+
+	return ret;
 }
 
 bool pdb_sid_to_id(const struct dom_sid *sid, struct unixid *id)
 {
 	struct pdb_methods *pdb = pdb_get_methods();
+	bool ret;
 
 	/* 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);
+	ret = pdb->sid_to_id(pdb, sid, id);
+
+	if (ret == true) {
+		idmap_cache_set_sid2unixid(sid, id);
+	}
+
+	return ret;
 }
 
 uint32_t pdb_capabilities(void)
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index cea8627..7dccc03 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -4970,7 +4970,6 @@ static bool ldapsam_sid_to_id(struct pdb_methods *methods,
 
 		id->id = strtoul(gid_str, NULL, 10);
 		id->type = ID_TYPE_GID;
-		idmap_cache_set_sid2unixid(sid, id);
 		ret = True;
 		goto done;
 	}
@@ -4987,7 +4986,6 @@ static bool ldapsam_sid_to_id(struct pdb_methods *methods,
 
 	id->id = strtoul(value, NULL, 10);
 	id->type = ID_TYPE_UID;
-	idmap_cache_set_sid2unixid(sid, id);
 
 	ret = True;
  done:
@@ -5013,7 +5011,6 @@ static bool ldapsam_uid_to_sid(struct pdb_methods *methods, uid_t uid,
 	struct dom_sid user_sid;
 	int rc;
 	TALLOC_CTX *tmp_ctx = talloc_stackframe();
-	struct unixid id;
 
 	filter = talloc_asprintf(tmp_ctx,
 				 "(&(uidNumber=%u)"
@@ -5058,11 +5055,6 @@ static bool ldapsam_uid_to_sid(struct pdb_methods *methods, uid_t uid,
 
 	sid_copy(sid, &user_sid);
 
-	id.id = uid;
-	id.type = ID_TYPE_UID;
-
-	idmap_cache_set_sid2unixid(sid, &id);
-
 	ret = true;
 
  done:
@@ -5088,7 +5080,6 @@ static bool ldapsam_gid_to_sid(struct pdb_methods *methods, gid_t gid,
 	struct dom_sid group_sid;
 	int rc;
 	TALLOC_CTX *tmp_ctx = talloc_stackframe();
-	struct unixid id;
 
 	filter = talloc_asprintf(tmp_ctx,
 				 "(&(gidNumber=%u)"
@@ -5131,11 +5122,6 @@ static bool ldapsam_gid_to_sid(struct pdb_methods *methods, gid_t gid,
 
 	sid_copy(sid, &group_sid);
 
-	id.id = gid;
-	id.type = ID_TYPE_GID;
-
-	idmap_cache_set_sid2unixid(sid, &id);
-
 	ret = true;
 
  done:
diff --git a/wscript b/wscript
index 87541da..5114e26 100644
--- a/wscript
+++ b/wscript
@@ -218,7 +218,9 @@ def etags(ctx):
     source_root = os.path.dirname(Utils.g_module.root_path)
     cmd = 'rm -f %s/TAGS && (find %s -name "*.[ch]" | egrep -v \.inst\. | xargs -n 100 etags -a)' % (source_root, source_root)
     print("Running: %s" % cmd)
-    os.system(cmd)
+    status = os.system(cmd)
+    if os.WEXITSTATUS(status):
+        raise Utils.WafError('etags failed')
 
 def ctags(ctx):
     "build 'tags' file using ctags"
@@ -226,7 +228,9 @@ def ctags(ctx):
     source_root = os.path.dirname(Utils.g_module.root_path)
     cmd = 'ctags --python-kinds=-i $(find %s -name "*.[ch]" | grep -v "*_proto\.h" | egrep -v \.inst\.) $(find %s -name "*.py")' % (source_root, source_root)
     print("Running: %s" % cmd)
-    os.system(cmd)
+    status = os.system(cmd)
+    if os.WEXITSTATUS(status):
+        raise Utils.WafError('ctags failed')
 
 # putting this here enabled build in the list
 # of commands in --help
@@ -249,14 +253,18 @@ def pydoctor(ctx):
     cmd='PYTHONPATH=%s pydoctor --introspect-c-modules --project-name=Samba --project-url=http://www.samba.org --make-html --docformat=restructuredtext --add-package bin/python/samba --add-module %s --add-module %s --add-module %s' % (
         bp, mpaths['tdb'], mpaths['ldb'], mpaths['talloc'], mpaths['ntdb'])
     print("Running: %s" % cmd)
-    os.system(cmd)
+    status = os.system(cmd)
+    if os.WEXITSTATUS(status):
+        raise Utils.WafError('pydoctor failed')
 
 
 def pep8(ctx):
     '''run pep8 validator'''
     cmd='PYTHONPATH=bin/python pep8 -r bin/python/samba'
     print("Running: %s" % cmd)
-    os.system(cmd)
+    status = os.system(cmd)
+    if os.WEXITSTATUS(status):
+        raise Utils.WafError('pep8 failed')
 
 
 def wafdocs(ctx):
@@ -270,7 +278,9 @@ def wafdocs(ctx):
     for f in list:
         cmd += ' --add-module %s' % f
     print("Running: %s" % cmd)
-    os.system(cmd)
+    status = os.system(cmd)
+    if os.WEXITSTATUS(status):
+        raise Utils.WafError('wafdocs failed')
 
 
 def dist():


-- 
Samba Shared Repository


More information about the samba-cvs mailing list